Author Login
Post Reply
user Digest 20 Feb 2010 15:13:26 -0000 Issue 9009
Topics (messages 205082 through 205096):
Re: Interceptor
205082 by: CRANFORD, CHRIS
205083 by: John Orr
205084 by: Cimballi
205085 by: CRANFORD, CHRIS
205086 by: CRANFORD, CHRIS
version conflict?
205087 by: Bill Bohnenberger
Re: XSS vulnerability with <s:text>
205088 by: Wes Wannemacher
Content DIV update strategy
205089 by: Jose A. Corbacho
205091 by: Martin Gainty
Re: <html:select.../> and its selected option's label
205090 by: farmer2008
Re: how to eliminate time in <s:textfield>
205092 by: Juan Chung
205094 by: Andy Sykes
205095 by: wild_oscar
Doubt in json response
205093 by: Karthik Screen
205096 by: Martin Gainty
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_205082.ezm (zipped)
My RequestTimerInterceptor is very basic and looks just like this below. What I find is that if I use a <s:debug/> tag in my JSP, the action context parameter is being set to 0 but the update at the end of the interceptor isn't applied.
What have I missed?
public String interceptor(ActionInvocation actionInvocation)
throws Exception {
// Get objects
ActionContext ac = actionInvocation.getInvocationContext();
Map parameters = ac.getParameters();
// Initialize variables
parameters.put(Constants.REQUEST_TIME_KEY,new Long(0));
ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(0));
// Get start time
Calendar started = Calendar.getInstance();
started.setTime(new Date());
// Invoke
String result = actionInvocation.invoke();
// Get end time and difference
Calendar ended = Calendar.getInstance();
Ended.setTime(new Date());
long diffMS = (ended.getTimeInMillis()-started.getTimeInMillis());
// Set values with total time
parameters.put(Constants.REQUEST_TIME_KEY,new Long(diffMS));
ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(diffMS));
return(result);
}
Chris
-----Original Message-----
From: Cimballi [mailto:cimballi.cimballi@(protected)]
Sent: Friday, February 19, 2010 10:16 AM
To: Struts Users Mailing List
Subject: Re: Interceptor
Look at ParameterRemoverInterceptor for example, you can access the
action context like this :
ActionContext ac = invocation.getInvocationContext();
And then you can set values in the value stack. Didn't test it but should work.
Cimballi
On Fri, Feb 19, 2010 at 11:10 AM, CRANFORD, CHRIS
<Chris.Cranford@(protected):
> Is it possible to set a value in the request or valuestack from an
> interceptor that contains the total time it took for the action to be
> invoked and executed? I have a requirement to show this on the JSP page
> and didn't know if I could do this within the Interceptor or if I have
> to do this in my base action object.
>
> Chris
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_205083.ezm (zipped)Yes, I think this is exactly the issue raised in my last post. Your
result is being processed before the lines that follow the action
invocation. Insert a PreResultListener and it can do the job of
updating.
(BTW, your method is called interceptor() but it should be Intercept()
- I'm guessing that's probably a typo.)
John
On Fri, Feb 19, 2010 at 10:39 AM, CRANFORD, CHRIS
<Chris.Cranford@(protected):
>
> My RequestTimerInterceptor is very basic and looks just like this below. What I find is that if I use a <s:debug/> tag in my JSP, the action context parameter is being set to 0 but the update at the end of the interceptor isn't applied.
>
> What have I missed?
>
> public String interceptor(ActionInvocation actionInvocation)
> throws Exception {
> // Get objects
> ActionContext ac = actionInvocation.getInvocationContext();
> Map parameters = ac.getParameters();
> // Initialize variables
> parameters.put(Constants.REQUEST_TIME_KEY,new Long(0));
> ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(0));
> // Get start time
> Calendar started = Calendar.getInstance();
> started.setTime(new Date());
> // Invoke
> String result = actionInvocation.invoke();
> // Get end time and difference
> Calendar ended = Calendar.getInstance();
> Ended.setTime(new Date());
> long diffMS = (ended.getTimeInMillis()-started.getTimeInMillis());
> // Set values with total time
> parameters.put(Constants.REQUEST_TIME_KEY,new Long(diffMS));
> ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(diffMS));
> return(result);
> }
>
> Chris
>
> -----Original Message-----
> From: Cimballi [mailto:cimballi.cimballi@(protected)]
> Sent: Friday, February 19, 2010 10:16 AM
> To: Struts Users Mailing List
> Subject: Re: Interceptor
>
> Look at ParameterRemoverInterceptor for example, you can access the
> action context like this :
> ActionContext ac = invocation.getInvocationContext();
>
> And then you can set values in the value stack. Didn't test it but should work.
>
> Cimballi
>
>
> On Fri, Feb 19, 2010 at 11:10 AM, CRANFORD, CHRIS
> <Chris.Cranford@(protected):
>> Is it possible to set a value in the request or valuestack from an
>> interceptor that contains the total time it took for the action to be
>> invoked and executed? I have a requirement to show this on the JSP page
>> and didn't know if I could do this within the Interceptor or if I have
>> to do this in my base action object.
>>
>> Chris
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_205084.ezm (zipped)Chris,
Your algorithm with Calendars is realyl complicated, can't you simply
use System.currentTimeMillis() ?
Then, can you also add a log to the interceptor so that you can log
the value before you put it in the value stack ?
It will not solve your pb but it will make things more clear and will
help to debug.
You can look at this class too,
com.opensymphony.xwork2.interceptor.TimerInterceptor, they do the
same, only they don't put it in the value stack.
Cimballi
On Fri, Feb 19, 2010 at 11:39 AM, CRANFORD, CHRIS
<Chris.Cranford@(protected):
>
> My RequestTimerInterceptor is very basic and looks just like this below. What I find is that if I use a <s:debug/> tag in my JSP, the action context parameter is being set to 0 but the update at the end of the interceptor isn't applied.
>
> What have I missed?
>
> public String interceptor(ActionInvocation actionInvocation)
> throws Exception {
> // Get objects
> ActionContext ac = actionInvocation.getInvocationContext();
> Map parameters = ac.getParameters();
> // Initialize variables
> parameters.put(Constants.REQUEST_TIME_KEY,new Long(0));
> ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(0));
> // Get start time
> Calendar started = Calendar.getInstance();
> started.setTime(new Date());
> // Invoke
> String result = actionInvocation.invoke();
> // Get end time and difference
> Calendar ended = Calendar.getInstance();
> Ended.setTime(new Date());
> long diffMS = (ended.getTimeInMillis()-started.getTimeInMillis());
> // Set values with total time
> parameters.put(Constants.REQUEST_TIME_KEY,new Long(diffMS));
> ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(diffMS));
> return(result);
> }
>
> Chris
>
> -----Original Message-----
> From: Cimballi [mailto:cimballi.cimballi@(protected)]
> Sent: Friday, February 19, 2010 10:16 AM
> To: Struts Users Mailing List
> Subject: Re: Interceptor
>
> Look at ParameterRemoverInterceptor for example, you can access the
> action context like this :
> ActionContext ac = invocation.getInvocationContext();
>
> And then you can set values in the value stack. Didn't test it but should work.
>
> Cimballi
>
>
> On Fri, Feb 19, 2010 at 11:10 AM, CRANFORD, CHRIS
> <Chris.Cranford@(protected):
>> Is it possible to set a value in the request or valuestack from an
>> interceptor that contains the total time it took for the action to be
>> invoked and executed? I have a requirement to show this on the JSP page
>> and didn't know if I could do this within the Interceptor or if I have
>> to do this in my base action object.
>>
>> Chris
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>

Attachment:
user_205085.ezm (zipped)Correct it was a typo.
I have modified my Interceptor with the following internal class:
private class TimerPreResultListener
implements PreResultListener {
private long started;
private Logger log = LogManager.getLogger(TimerInterceptor.class);
public TimerPreResultListener() {
started = System.currentTimeMillis();
}
@Override
public void beforeResult(ActionInvocation invocation, String result) {
long timeDiff = System.currentTimeMillis() - started;
ActionContext ac = invocation.getInvocationContext();
ac.getParameters().put(Constants.REQUEST_TIME_KEY,new Long(timediff));
ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(timediff));
log.debug("Request Execution Time: " + timeDiff + " milliseconds.");
}
}
The interceptor's intercept method now looks like this:
@Override
public String intercept(ActionInvocation actionInvocation)
throws Exception {
actionInvocation.addPreResultListener(new TimerPreResultListener());
return actionInvocation.invoke();
}
The problem I face is I still cannot get the value to print in my JSP using the s:property tag. Constants.REQUEST_TIME_KEY = 'seekRequestTimeKey'.
Thoughts?
-----Original Message-----
From: John Orr [mailto:webskate101@(protected)]
Sent: Friday, February 19, 2010 10:46 AM
To: Struts Users Mailing List
Subject: Re: Interceptor
Yes, I think this is exactly the issue raised in my last post. Your
result is being processed before the lines that follow the action
invocation. Insert a PreResultListener and it can do the job of
updating.
(BTW, your method is called interceptor() but it should be Intercept()
- I'm guessing that's probably a typo.)
John
On Fri, Feb 19, 2010 at 10:39 AM, CRANFORD, CHRIS
<Chris.Cranford@(protected):
>
> My RequestTimerInterceptor is very basic and looks just like this below. What I find is that if I use a <s:debug/> tag in my JSP, the action context parameter is being set to 0 but the update at the end of the interceptor isn't applied.
>
> What have I missed?
>
> public String interceptor(ActionInvocation actionInvocation)
> throws Exception {
> // Get objects
> ActionContext ac = actionInvocation.getInvocationContext();
> Map parameters = ac.getParameters();
> // Initialize variables
> parameters.put(Constants.REQUEST_TIME_KEY,new Long(0));
> ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(0));
> // Get start time
> Calendar started = Calendar.getInstance();
> started.setTime(new Date());
> // Invoke
> String result = actionInvocation.invoke();
> // Get end time and difference
> Calendar ended = Calendar.getInstance();
> Ended.setTime(new Date());
> long diffMS = (ended.getTimeInMillis()-started.getTimeInMillis());
> // Set values with total time
> parameters.put(Constants.REQUEST_TIME_KEY,new Long(diffMS));
> ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(diffMS));
> return(result);
> }
>
> Chris
>
> -----Original Message-----
> From: Cimballi [mailto:cimballi.cimballi@(protected)]
> Sent: Friday, February 19, 2010 10:16 AM
> To: Struts Users Mailing List
> Subject: Re: Interceptor
>
> Look at ParameterRemoverInterceptor for example, you can access the
> action context like this :
> ActionContext ac = invocation.getInvocationContext();
>
> And then you can set values in the value stack. Didn't test it but should work.
>
> Cimballi
>
>
> On Fri, Feb 19, 2010 at 11:10 AM, CRANFORD, CHRIS
> <Chris.Cranford@(protected):
>> Is it possible to set a value in the request or valuestack from an
>> interceptor that contains the total time it took for the action to be
>> invoked and executed? I have a requirement to show this on the JSP page
>> and didn't know if I could do this within the Interceptor or if I have
>> to do this in my base action object.
>>
>> Chris
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_205086.ezm (zipped)Have to use ac.getValueStack().set(key,value) instead.
This fixed the issue.
-----Original Message-----
From: CRANFORD, CHRIS [mailto:Chris.Cranford@(protected)]
Sent: Friday, February 19, 2010 11:11 AM
To: Struts Users Mailing List
Subject: RE: Interceptor
Correct it was a typo.
I have modified my Interceptor with the following internal class:
private class TimerPreResultListener
implements PreResultListener {
private long started;
private Logger log = LogManager.getLogger(TimerInterceptor.class);
public TimerPreResultListener() {
started = System.currentTimeMillis();
}
@Override
public void beforeResult(ActionInvocation invocation, String result) {
long timeDiff = System.currentTimeMillis() - started;
ActionContext ac = invocation.getInvocationContext();
ac.getParameters().put(Constants.REQUEST_TIME_KEY,new Long(timediff));
ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(timediff));
log.debug("Request Execution Time: " + timeDiff + " milliseconds.");
}
}
The interceptor's intercept method now looks like this:
@Override
public String intercept(ActionInvocation actionInvocation)
throws Exception {
actionInvocation.addPreResultListener(new TimerPreResultListener());
return actionInvocation.invoke();
}
The problem I face is I still cannot get the value to print in my JSP using the s:property tag. Constants.REQUEST_TIME_KEY = 'seekRequestTimeKey'.
Thoughts?
-----Original Message-----
From: John Orr [mailto:webskate101@(protected)]
Sent: Friday, February 19, 2010 10:46 AM
To: Struts Users Mailing List
Subject: Re: Interceptor
Yes, I think this is exactly the issue raised in my last post. Your
result is being processed before the lines that follow the action
invocation. Insert a PreResultListener and it can do the job of
updating.
(BTW, your method is called interceptor() but it should be Intercept()
- I'm guessing that's probably a typo.)
John
On Fri, Feb 19, 2010 at 10:39 AM, CRANFORD, CHRIS
<Chris.Cranford@(protected):
>
> My RequestTimerInterceptor is very basic and looks just like this below. What I find is that if I use a <s:debug/> tag in my JSP, the action context parameter is being set to 0 but the update at the end of the interceptor isn't applied.
>
> What have I missed?
>
> public String interceptor(ActionInvocation actionInvocation)
> throws Exception {
> // Get objects
> ActionContext ac = actionInvocation.getInvocationContext();
> Map parameters = ac.getParameters();
> // Initialize variables
> parameters.put(Constants.REQUEST_TIME_KEY,new Long(0));
> ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(0));
> // Get start time
> Calendar started = Calendar.getInstance();
> started.setTime(new Date());
> // Invoke
> String result = actionInvocation.invoke();
> // Get end time and difference
> Calendar ended = Calendar.getInstance();
> Ended.setTime(new Date());
> long diffMS = (ended.getTimeInMillis()-started.getTimeInMillis());
> // Set values with total time
> parameters.put(Constants.REQUEST_TIME_KEY,new Long(diffMS));
> ac.getValueStack().setValue(Constants.REQUEST_TIME_KEY,new Long(diffMS));
> return(result);
> }
>
> Chris
>
> -----Original Message-----
> From: Cimballi [mailto:cimballi.cimballi@(protected)]
> Sent: Friday, February 19, 2010 10:16 AM
> To: Struts Users Mailing List
> Subject: Re: Interceptor
>
> Look at ParameterRemoverInterceptor for example, you can access the
> action context like this :
> ActionContext ac = invocation.getInvocationContext();
>
> And then you can set values in the value stack. Didn't test it but should work.
>
> Cimballi
>
>
> On Fri, Feb 19, 2010 at 11:10 AM, CRANFORD, CHRIS
> <Chris.Cranford@(protected):
>> Is it possible to set a value in the request or valuestack from an
>> interceptor that contains the total time it took for the action to be
>> invoked and executed? I have a requirement to show this on the JSP page
>> and didn't know if I could do this within the Interceptor or if I have
>> to do this in my base action object.
>>
>> Chris
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_205087.ezm (zipped)Struts 2 documentaion at *
http://struts.apache.org/2.x/docs/building-the-framework-from-source.html*
implies (at the bottom of the page) that only java 1.5 is required. But when
I deploy my app to a tomcat 5.5.27 server using jdk 1.5.0_20, I get the
UnsupportedClassVersionError below. Am I right in believing that this error
is because some struts class file has been compiled with a later java
version?
My webapp uses jar files from struts 2.1.8.1
Tomcat stdout:
Feb 19, 2010 11:32:50 AM
org.apache.catalina.core.AprLifecycleListenerlifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path: F:\Program
Files\Java\jdk1.5.0_20\bin;.;F:\WINDOWS\system32;F:\WINDOWS;F:\Program
Files\Java\jdk1.5.0_20\jre\bin;F:/Program
Files/Java/jre1.5.0_20/bin/client;F:/Program
Files/Java/jre1.5.0_20/bin;F:\WINDOWS\system32;F:\WINDOWS;F:\WINDOWS\System32\Wbem;F:\Program
Files\Common Files\Roxio Shared\DLLShared\;F:\Program Files\Common
Files\Adobe\AGL;F:\development\thinkmap\apache-ant-1.7.1\bin;F:\development\jdk1.6.0_16\bin;F:\development\mysql\bin;f:\util;F:\Program
Files\QuickTime\QTSystem\;F:\development\sun\sdk\bin;F:\Sun\SDK\bin
Feb 19, 2010 11:32:50 AM
org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-9081
Feb 19, 2010 11:32:50 AM
org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 875 ms
Feb 19, 2010 11:32:50 AM
org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 19, 2010 11:32:50 AM
org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.27
Feb 19, 2010 11:32:50 AM
org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Feb 19, 2010 11:32:51 AM
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-default.xml]
Feb 19, 2010 11:32:51 AM
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Unable to locate configuration files of the name struts-plugin.xml,
skipping
Feb 19, 2010 11:32:51 AM
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-plugin.xml]
Feb 19, 2010 11:32:51 AM
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts.xml]
Feb 19, 2010 11:32:51 AM
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Loading global messages from global-messages
Feb 19, 2010 11:32:52 AM
org.apache.catalina.core.StandardContextfilterStart
SEVERE: Exception starting filter struts2
*
java.lang.UnsupportedClassVersionError: Bad version number in .class file*
at
java.lang.ClassLoader.defineClass1(Native Method)
at
java.lang.ClassLoader.defineClass (
ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass (
SecureClassLoader.java:124)
at
org.apache.catalina.loader.WebappClassLoader.findClassInternal (
WebappClassLoader.java:1876)
at
org.apache.catalina.loader.WebappClassLoader.findClass (
WebappClassLoader.java:889)
at
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1353)
at
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1232)
at
java.lang.ClassLoader.loadClassInternal (
ClassLoader.java:319)
at
java.lang.Class.getDeclaredConstructors0(Native Method)
at
java.lang.Class.privateGetDeclaredConstructors (
Class.java:2357)
at
java.lang.Class.getConstructor0 (
Class.java:2671)
at
java.lang.Class.getConstructor (
Class.java:1629)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction (
XmlConfigurationProvider.java:403)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction (
XmlConfigurationProvider.java:354)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage (
XmlConfigurationProvider.java:468)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages (
XmlConfigurationProvider.java:264)
at
org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages (
StrutsXmlConfigurationProvider.java:111)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer (
DefaultConfiguration.java:193)
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration (
ConfigurationManager.java:55)
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration (
Dispatcher.java:374)
at
org.apache.struts2.dispatcher.Dispatcher.init (
Dispatcher.java:418)
at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher (
InitOperations.java:69)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init (
StrutsPrepareAndExecuteFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter (
ApplicationFilterConfig.java:221)
at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef (
ApplicationFilterConfig.java:302)
at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
at
org.apache.catalina.core.StandardContext.filterStart (
StandardContext.java:3635)
at
org.apache.catalina.core.StandardContext.start (
StandardContext.java:4222)
at
org.apache.catalina.core.ContainerBase.start (
ContainerBase.java:1014)
at
org.apache.catalina.core.StandardHost.start (
StandardHost.java:736)
at
org.apache.catalina.core.ContainerBase.start (
ContainerBase.java:1014)
at
org.apache.catalina.core.StandardEngine.start (
StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start (
StandardService.java:448)
at
org.apache.catalina.core.StandardServer.start (
StandardServer.java:700)
at
org.apache.catalina.startup.Catalina.start (
Catalina.java:552)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke (
NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke (
DelegatingMethodAccessorImpl.java:25)
at
java.lang.reflect.Method.invoke (
Method.java:592)
at
org.apache.catalina.startup.Bootstrap.start (
Bootstrap.java:295)
at
org.apache.catalina.startup.Bootstrap.main (
Bootstrap.java:433)
Feb 19, 2010 11:32:52 AM
org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Feb 19, 2010 11:32:52 AM
org.apache.catalina.core.StandardContext start
SEVERE: Context [/marmoset] startup failed due to previous errors
Feb 19, 2010 11:32:52 AM
org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-9081
Feb 19, 2010 11:32:53 AM
org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8010
Feb 19, 2010 11:32:53 AM
org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/62 config=null
Feb 19, 2010 11:32:53 AM
org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Feb 19, 2010 11:32:53 AM
org.apache.catalina.startup.Catalina start
INFO: Server startup in 3094 ms
Thanks,
Bill

Attachment:
user_205088.ezm (zipped)Go ahead and file a jira. Better yet, file one with a patch and unit
test. I don't know if we would make escaping the default (it might
break backward compatibility). But it is definitely worth putting in
the next release.
-Wes
On 2/19/10, John Orr <webskate101@(protected):
> Thanks for the cleaner code - that is an improvement, and I'll use that
> idiom.
>
> I agree that generally <s:text> is intended for displaying safe text.
> However the use case "Hello, {0}" has to be pretty common, when
> something like a user name is inserted. Also the ability to access
> OGNL inside resource bundles ("Hello, ${user.firstName}") guarantees
> that parameters that may well originate with user input can end up
> inside <s:text>. (Note, parameter escaping wouldn't help in this
> case.)
>
> The problem becomes most serious if different people have different
> responsibilities. If the person responsible for writing the JSP's is
> not involved with the resource bundles or the action layer, then they
> have no way of knowing whether the text they are inserting is safe or
> not. And I'd say they really need a clean way to take responsibility
> to ensure what goes on the page is safe. Perhaps an "escape" attribute
> on <s:text> which defaults to "false" would help.
>
> Thanks, again,
>
> John
>
> On Fri, Feb 19, 2010 at 8:24 AM, Greg Lindholm <greg.lindholm@(protected)>
> wrote:
>> A slightly cleaner way would be like this:
>>
>> <s:text name="resource.key" ><s:param><s:property
>> value="param1"/></s:param></s:text>
>>
>> I think in most cases <s:text> is used for displaying "safe" text that
>> the app either supplies or generates.
>> Obviously if you do use it to echo user supplied data you need to be
>> careful.
>> It would be nice to have a flag like you suggest however it might be
>> difficult to get the behavior exactly right since the text may contain
>> formatting tags and what you really want is to just escape the
>> parameters.
>>
>>
>> On Thu, Feb 18, 2010 at 5:25 PM, John Orr <webskate101@(protected)>
>> wrote:
>>> This is my first posting to this list, so excuse me if this is an
>>> issue that's already been addressed.
>>>
>>> My concern is with the XSS vulnerability in the following use case:
>>>
>>> <s:text name="resource.key">
>>> <s:param value="param1"/>
>>> </s:text>
>>>
>>> It seems (Struts 2.1.8.1) that there is no mechanism in s:text or
>>> s:param to do HTML escaping. If param1 contains user input then this
>>> opens the door to XSS attacks.
>>>
>>> The easiest solution I can see is to modify the code to
>>>
>>> <s:text var="v" name="resource.key">
>>> <s:param value="param1"/>
>>> </s:text>
>>> <s:property value="v"/>
>>>
>>> This works, but it is a lot of work. It seems to me it would be better
>>> if Struts2 supported
>>>
>>> <s:text name="resource.key" escape="true">
>>> <s:param value="param1"/>
>>> </s:text>
>>>
>>> or, better yet, had escape="true" as its default.
>>>
>>> Is there another way round this problem which I am missing?
>>>
>>> Thanks,
>>>
>>> John
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Wes Wannemacher
Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

Attachment:
user_205089.ezm (zipped)Hi all,
I would like your advise for a problem I'm facing with sx:div.
I'm using JDK 1.5, Struts 2.1.6 and Firefox 3.0.18 under Ubuntu.
In our application, we have a central sx:div in the Main action page where
the content is displayed. It is declared as follows:
<sx:div id="contentDiv" listenTopics="showActionContent_topic"
executeScripts="true">
<s:action name="ListOwnProjects" namespace="/"
executeResult="true"/> <!-- Default action -->
</sx:div>
Then, the action ListOwnProjects displays as follows:
<s:url id="viewOwnProject" action="ViewOwnProject" namespace="/">
<s:param name="id" value="%{id}"/>
</s:url>
<sx:a href="%{viewOwnProject}" targets="contentDiv">
<s:property value="name"/>
</sx:a>
This means (or so is my understanding) that the content div should be
updated from an element inside itself. This, however, brings the whole page
(Main) into "contentDiv" and not the content of "ViewOwnProject" action.
The different JSPs are placed correctly and struts.xml associates the
actions with the proper files (everything is ok if I call these actions
separately).
<sx:head/> is set and working in other places of the code.
Any hint?
Thanks,
Jose A. Corbacho

Attachment:
user_205091.ezm (zipped)
i would suggest including handler attribute e.g.
<script type=text/javvascript>
function handler(widget,node) {
node.innerHtml="new content goes here";
}
</script>
<sx:div id="node" href="/AjaxTest.action"
handler="hander" >
</sx:div>
i would suggest reading and studying XMLHttpRequest for an understanding of Asynchronous Request Model as implemented by AJAX..
Saludos Cordiales,
Martin Gainty
______________________________________________
Porfavor no modifica o interrupta esta communicacion/Please dont interrupt or modify this transmission.
> From: mccorby@(protected)
> Date: Sat, 20 Feb 2010 09:20:25 +0700
> Subject: Content DIV update strategy
> To: user@(protected)
>
> Hi all,
> I would like your advise for a problem I'm facing with sx:div.
>
> I'm using JDK 1.5, Struts 2.1.6 and Firefox 3.0.18 under Ubuntu.
>
> In our application, we have a central sx:div in the Main action page where
> the content is displayed. It is declared as follows:
>
> <sx:div id="contentDiv" listenTopics="showActionContent_topic"
> executeScripts="true">
> <s:action name="ListOwnProjects" namespace="/"
> executeResult="true"/> <!-- Default action -->
> </sx:div>
>
>
> Then, the action ListOwnProjects displays as follows:
>
> <s:url id="viewOwnProject" action="ViewOwnProject" namespace="/">
> <s:param name="id" value="%{id}"/>
> </s:url>
> <sx:a href="%{viewOwnProject}" targets="contentDiv">
> <s:property value="name"/>
> </sx:a>
>
>
> This means (or so is my understanding) that the content div should be
> updated from an element inside itself. This, however, brings the whole page
> (Main) into "contentDiv" and not the content of "ViewOwnProject" action.
>
> The different JSPs are placed correctly and struts.xml associates the
> actions with the proper files (everything is ok if I call these actions
> separately).
>
> <sx:head/> is set and working in other places of the code.
>
> Any hint?
> Thanks,
>
> Jose A. Corbacho
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/201469226/direct/01/

Attachment:
user_205090.ezm (zipped)
Hi,
The selected option's value can be retrieved via the property attribute in
<html:select> tag . Is there a way to retrieve the selected option's label
via <html:select> tag or <html:optionsCollection> tag?
Thanks.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_205092.ezm (zipped)maybe you can write a js function to format it or you rewrite your
getter method of startDate, in this method you will first format it
then return it. the latter requires all the other caller of the method
getStartDate needs the same format.
On Sat, Feb 20, 2010 at 12:09 AM, wild_oscar <miguel@(protected):
>
> Aaah, dates!
>
> Add an s:date and associate with the textfield, like:
>
> <s:date name="train.startDate" id="trainDateId" format="dd-MM-yyyy"/>
> <s:textfield name="train.startDate" value="%{#trainDateId}" label="Choo choo
> (dd-MM-yyyy)" />
>
> I'm not sure if both tags need the "name" or not - post your findings.
>
>
> fireapple wrote:
>>
>> Does that mean I have to create something like:
>>
>> public String getStartDateStr()
>> {
>> ...........
>> }
>>
>> to do this?
>>
>> I don't want to use this because if I use this getter, I have to create a
>> setter for this since user can edit the date.
>>
>> Any other options? Thanks
>>
>>
>>
>> Brian Thompson-5 wrote:
>>>
>>> Just add a getter to your "train" object that translates the startDate
>>> into
>>> the format you'd like. Use a DateFormat object.
>>>
>>> -Brian
>>>
>>>
>>>
>>> On Thu, Feb 18, 2010 at 5:07 PM, fireapple <taizhang1981@(protected)>
>>> wrote:
>>>
>>>>
>>>> Dear all, I'm using
>>>> <s:textfield name="train.startDate" cssClass="datepicker">
>>>>
>>>> where startDate is a
java.util.Date field of an object train.
>>>>
>>>> The output is something like this:
>>>>
>>>> http://old.nabble.com/file/p27647328/date.png
>>>>
>>>> How can I eliminate the 12:00:00 in the textfield? Thanks!
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/how-to-eliminate-time-in-%3Cs%3Atextfield%3E-tp27647328p27647328.html
>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>> For additional commands, e-mail: user-help@(protected)
>>>>
>>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/how-to-eliminate-time-in-%3Cs%3Atextfield%3E-tp27647328p27655381.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Life is irrational.

Attachment:
user_205094.ezm (zipped)You could write your own type converter - see type conversion in the S2 docs for a good overview. It handles the conversion of any Java object in your model class to a String for use in the view, and converts any String field into a Java object in forms/GET parameters.
That way you have total control over how the field appears without needing extra "type" getters (which is a bit hacky IMO).
----- Original message -----
> maybe you can write a js function to format it or you rewrite your
> getter method of startDate, in this method you will first format it
> then return it. the latter requires all the other caller of the method
> getStartDate needs the same format.
>
> On Sat, Feb 20, 2010 at 12:09 AM, wild_oscar <miguel@(protected):
> >
> > Aaah, dates!
> >
> > Add an s:date and associate with the textfield, like:
> >
> > <s:date name="train.startDate" id="trainDateId" format="dd-MM-yyyy"/>
> > <s:textfield name="train.startDate" value="%{#trainDateId}" label="Choo choo
> > (dd-MM-yyyy)" />
> >
> > I'm not sure if both tags need the "name" or not - post your findings.
> >
> >
> > fireapple wrote:
> > >
> > > Does that mean I have to create something like:
> > >
> > > public String getStartDateStr()
> > > {
> > > ...........
> > > }
> > >
> > > to do this?
> > >
> > > I don't want to use this because if I use this getter, I have to create a
> > > setter for this since user can edit the date.
> > >
> > > Any other options? Thanks
> > >
> > >
> > >
> > > Brian Thompson-5 wrote:
> > > >
> > > > Just add a getter to your "train" object that translates the startDate
> > > > into
> > > > the format you'd like. Use a DateFormat object.
> > > >
> > > > -Brian
> > > >
> > > >
> > > >
> > > > On Thu, Feb 18, 2010 at 5:07 PM, fireapple <taizhang1981@(protected)>
> > > > wrote:
> > > >
> > > > >
> > > > > Dear all, I'm using
> > > > > <s:textfield name="train.startDate" cssClass="datepicker">
> > > > >
> > > > > where startDate is a
java.util.Date field of an object train.
> > > > >
> > > > > The output is something like this:
> > > > >
> > > > > http://old.nabble.com/file/p27647328/date.png
> > > > >
> > > > > How can I eliminate the 12:00:00 in the textfield? Thanks!
> > > > > --
> > > > > View this message in context:
> > > > > http://old.nabble.com/how-to-eliminate-time-in-%3Cs%3Atextfield%3E-tp27647328p27647328.html
> > > > > Sent from the Struts - User mailing list archive at Nabble.com.
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > > For additional commands, e-mail: user-help@(protected)
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> > --
> > View this message in context:
> > http://old.nabble.com/how-to-eliminate-time-in-%3Cs%3Atextfield%3E-tp27647328p27655381.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
>
> --
> Life is irrational.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment:
user_205095.ezm (zipped)
Why bother with type conversion when all that it seems that is wanted is
display the correct format? It seems to me that the s:date tag was built for
that precisely (see http://cwiki.apache.org/WW/date.html ). It seems like
reinventing the wheel.
Andy Sykes wrote:
>
> You could write your own type converter - see type conversion in the S2
> docs for a good overview. It handles the conversion of any Java object in
> your model class to a String for use in the view, and converts any String
> field into a Java object in forms/GET parameters.
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_205093.ezm (zipped)
Hi guys
I am very new to the forum
i am providing a json response with recursive looping
import org.json.simple.JSONObject;
public class JsonClass {
public static void main(String args[])
{
System.out.println(call(5));
}
public static int call(int i)
{
if(i==1)
{
return 1;
}else
{
JSONObject jsObj=new JSONObject();
if(i>3)
{
jsObj.put("children", i);
}
jsObj.put("id", i);
System.out.println(jsObj);
return i*call(i-1);
}
}
}
o/p
{"id":5,"children":5}
{"id":4,"children":4}
{"id":3}
{"id":2}
my requirement is to place another child inside 5 as below
{"id":5,"children":5,"anotherchildren":"something"}
{"id":4,"children":4}
{"id":3}
{"id":2}
do you have any idea
karthik.k
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_205096.ezm (zipped)i dont know if JSONObject can dynamically build an object graph..(members please please correct me if this functionality has been added)
i would use AXIOM to add or replace elements to your Object Graph..and then use getChildren to acquire the iterator e.g.
java.util.Iterator=ParentNode.GetChildren();
to iterate thru the child nodes..
http://ws.apache.org/commons/axiom/
axis-users mailing list can help with any implementation issues..
HTH
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Sat, 20 Feb 2010 00:57:52 -0800
> From: cse.k.karthik@(protected)
> To: user@(protected)
> Subject: Doubt in json response
>
>
> Hi guys
>
> I am very new to the forum
>
> i am providing a json response with recursive looping
>
> import org.json.simple.JSONObject;
>
>
> public class JsonClass {
> public static void main(String args[])
> {
> System.out.println(call(5));
> }
> public static int call(int i)
> {
> if(i==1)
> {
> return 1;
> }else
> {
> JSONObject jsObj=new JSONObject();
> if(i>3)
> {
> jsObj.put("children", i);
> }
> jsObj.put("id", i);
> System.out.println(jsObj);
> return i*call(i-1);
> }
> }
> }
>
> o/p
>
> {"id":5,"children":5}
> {"id":4,"children":4}
> {"id":3}
> {"id":2}
>
> my requirement is to place another child inside 5 as below
> {"id":5,"children":5,"anotherchildren":"something"}
> {"id":4,"children":4}
> {"id":3}
> {"id":2}
>
> do you have any idea
>
> karthik.k
>
> --
> View this message in context: http://old.nabble.com/Doubt-in-json-response-tp27664575p27664575.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/201469227/direct/01/