[struts2] tabbedpanel bug? Remote content retrieved 2/3 times

2008-07-26 Thread Bruyn, Bill
Using Struts 2.0.11, the following markup causes goodbyeWorld's execute
method to be called twice:

sx:tabbedpanel id=tabContainer  

   s:url action=goodbyeWorld id=url/
   sx:div label=Tab 1 href=%{#url}Remote Tab/sx:div   

   sx:div label=Tab 2Local Tab/sx:div 
/sx:tabbedpanel

When the remote content follows the local content (Tab 1 is placed after
Tab 2), it's called just once.

Switch out the libraries and change the tags accordingly to use 2.1.2
syntax, and I think you'll find that remote content on tab 1 calls the
action 3 times.  Remote content on tab 2 is called twice.


Bill
-
Win XP
IE6/FF2/Safari 3.1
Tomcat 6.0.16
JDK 1.5.0_06
Struts 2.0.11 / 2.1.2 (binary)


?xml version=1.0 encoding=UTF-8?
web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID
version=2.5
  display-namehello/display-name
  filter
filter-namestruts2/filter-name
 
filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-cla
ss
  /filter
  filter-mapping
filter-namestruts2/filter-name
url-pattern/*/url-pattern
  /filter-mapping
/web-app



?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd;

struts
package name=base-package namespace=/ extends=struts-default
action name=helloWorld class=hello.HelloWorld
resulthelloWorld.jsp/result
/action
action name=goodbyeWorld class=goodbye.GoodbyeWorld
resultgoodbyeWorld.jsp/result
/action
/package
/struts



package hello;

import com.opensymphony.xwork2.ActionSupport;

public class HelloWorld extends ActionSupport {

private String message = Hello World!;

public String getMessage() {
return message;
}

@Override
public String execute() throws Exception {
System.out.println(message);
return SUCCESS;
}
}



%@ taglib prefix=s uri=/struts-tags %
%@ taglib prefix=sx uri=/struts-dojo-tags %
html
head
sx:head debug=true/
/head
body

sx:tabbedpanel id=tabContainer  

   sx:div label=Local
s:property value=message/
   /sx:div 

   s:url action=goodbyeWorld id=url/
   sx:div label=Remote href=%{#url}/   
 
/sx:tabbedpanel

/body 
/html



package goodbye;

import com.opensymphony.xwork2.ActionSupport;

public class GoodbyeWorld extends ActionSupport {

private String message = Goodbye, World!;

public String getMessage() {
return message;
}

@Override
public String execute() throws Exception {

System.out.println(message);
return super.execute();
}
}



%@ taglib prefix=s uri=/struts-tags %
html
head/
body
s:property value=message/
/body
/html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[s2.1.2] DEBUG: widget ID collision on ID:

2008-07-25 Thread Bruyn, Bill
Hi all,

Was having trouble with the app I'm writing, so devolved it to a hello
world type experiment with tabbed panels.  The original issue aside or
the moment, I'm still seeing a  DEBUG: widget ID collision on ID: (x)
error for each nested div in the panel with sx:head debug=true.  I
wasn't able to find anything on the Jira / list / Google that seemed
relevant to this situation - is this a known issue?  Detail follows.


Thanks,

Bill
-

Win XP
IE6/FF2/Safari 3.1
Tomcat 6.0.16
JDK 1.5.0_06
Struts 2.1.2 (binary)
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.0.4.jar
commons-logging-api-1.1.jar
freemarker-2.3.12.jar
ognl-2.6.11.jar
struts2-core-2.1.2.jar
struts2-dojo-plugin-2.1.2.jar
xwork-2.1.1.jar


web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID
version=2.5
  display-nameexample/display-name
  filter
filter-namestruts2/filter-name
 
filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-cla
ss
  /filter
  filter-mapping
filter-namestruts2/filter-name
url-pattern/*/url-pattern
  /filter-mapping
/web-app


!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd;

struts
package name=example namespace=/ extends=struts-default
action name=HelloWorld class=example.HelloWorld
result/HelloWorld.jsp/result
/action
/package
/struts


package example;

import com.opensymphony.xwork2.ActionSupport;

public class HelloWorld extends ActionSupport {

public String execute() throws Exception {
return SUCCESS;
}
}


%@ taglib prefix=sx uri=/struts-dojo-tags % 
html
head
titleBusted panels/title
sx:head debug=true/
/head

body

sx:tabbedpanel id=tabContainer
   sx:div label=Tab 1 
   Local Tab 1
   /sx:div   
   sx:div label=Tab 2 
   Local Tab 2
   /sx:div   
/sx:tabbedpanel

/body 
/html



DEBUG:  widget ID collision on ID: widget_1235718373
DEBUG:  widget ID collision on ID: widget_754832838

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[s2] Case-insensitive request parameter binding

2007-06-19 Thread Bruyn, Bill-p6141c
Apologies in advance if this somehow gets posted twice - I sent the
first message from another account, which is not subscribed to the list.
I don't suppose it should go through, but it hasn't bounced either...

Anyway, I have a requirement that reads, parameter names shall not be
case sensitive, but parameter values shall be.  Which of course is a
problem for binding request parameters to my action/model properties
(e.g., foo=bar, Foo=bar FOO=bar) unless I want to provide setters for
every permutation...  :-|

I'm pretty new to Struts2, but it seems like I could either make sure
that all of my getters use uppercase property names [e.g., getFOO()] and
convert the inbound parameter name before the ParameterInterceptor is
applied...  

Or maybe I could replace the ParametersInterceptor with one that used
reflection to figure out which property to set, ignoring case.  Do
either of those options seem right to anyone else?  Something like

//for each request parameter

//for each getter method on the requested action

//if beanPropertyName.equalsIgnoreCase(parameterName)

//valueStack.setValue(propertyName,
parameterValue)


Though I suppose this breaks down pretty fast for complex properties (I
won't have any, AFAIK)...  I'd appreciate a better idea.


Many TIA,

Bill Bruyn


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [s2] Case-insensitive request parameter binding

2007-06-19 Thread Bruyn, Bill-p6141c
Yeah, that's about what I'd come up with too (unless I'm
misunderstanding you, this sounds like my option 1.)

That'll work I guess, but I was hoping not to have to muck up all my
method names (e.g., getWhatwouldordinarilybeacamelcasename(),
getWHATWOULDORDINARILYBEACAMELCASENAME()) if there's another way.

Thanks,

Bill

 -Original Message-
 From: Jeromy Evans [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 19, 2007 6:10 PM
 To: Struts Users Mailing List
 Subject: Re: [s2] Case-insensitive request parameter binding
 
 Bruyn, Bill-p6141c wrote:
  Or maybe I could replace the ParametersInterceptor with one 
 that used 
  reflection to figure out which property to set, ignoring case.  Do 
  either of those options seem right to anyone else?  Something like
 
  //for each request parameter
 
  //for each getter method on the requested action
 
  //if beanPropertyName.equalsIgnoreCase(parameterName)
 
  //valueStack.setValue(propertyName,
  parameterValue)
 
 

 I would leave the ParametersInterceptor as-is, but place a 
 custom interceptor in the stack prior to it.  The custom 
 interceptor could change all request parameter names to 
 camelcase or lowercase.
 You should also be able to achieve the same effect with a filter too.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[s2] struts2-portlet-2.0.6 example

2007-04-23 Thread Bruyn, Bill-p6141c
Hi all,
 
Is the Ajax example bundled with struts2-portlet-2.0.6 example app
supposed to work out of the box?  I've deployed to WebLogic 9.2, and
seem to have at least a few problems with it:
 
1.  Tags containing 'nested' quotation marks yield some sort of
attribute not recgnized error.  e.g.,  href=s:url
action=ajaxData/ is a problem, so I switched that to an el
expression as illustrated in the documentation:  

s:url id=ajaxExampleAction action=ajaxData /

href=%{ajaxExampleAction}

which seems to work, except that

 

2.  The inclusion of the Ajax result on more than one place crashes my
IE 6.0 browser pretty consistently (I don't have another browser to test
with yet, unfortunately).  e.g.,

s:div id=once href=%{ajaxExampleAction} ...

s:div id=twice href=%{ajaxExampleAction} ...

is a problem.  Hacked the example to include just a single ajax-enabled
div and

 

3.  it all seems to work, except that the portal has aggregated the
content instead of allowing the browser to do it in-place.  i.e., the
ajaxData.jsp content is surrounded by portal markup (title bar, window
state controls, etc.) which is clearly not the desired result.

I've fooled around a bit with the configuration, but I have to say that
I'm relatively new to both Struts and Portlets, and have so far not been
able to get the results I expected.  Appreicate any help I can get.

 

TIA,

Bill Bruyn

(BTW, the Velocity example doesn't seem to work either, although the
resource in question is in fact where it's supposed to be:
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource '/WEB-INF/view/helloWorld.vm')