Author Login
Post Reply
user Digest 16 Jul 2009 19:48:42 -0000 Issue 8756
Topics (messages 200800 through 200811):
Re: Setter in action triggers twice. Bug?
200800 by: Ritvars RundzÄns
200807 by: Musachy Barroso
Re: URL to underlying action
200801 by: mathias-ewald
Date Validation in Struts 2
200802 by: Siddiq Syed
200803 by: Siddiq Syed
Re: unit testing Struts2 application (with Spring and Hibernate)
200804 by: Dimitrios Christodoulakis
200808 by: Haroon Rafique
200810 by: Nils-Helge Garli Hegvik
Login with Struts2
200805 by: mathias-ewald
200806 by: Kawczynski, David
200811 by: Robin Mannering
Plug-in creation and freemarker page location
200809 by: stanlick
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_200800.ezm (zipped)I put BP @ setCmd.
1st hit:
-------------------------------------------------------------------------------------------->
Daemon Thread [http-8080-2] (Suspended (breakpoint at line 28 in Person))
Person.setCmd(String) line: 28
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
OgnlRuntime.invokeMethod(Object, Method, Object[]) line: 517
OgnlRuntime.callAppropriateMethod(OgnlContext, Object, Object, String,
String, List, Object[]) line: 812
OgnlRuntime.setMethodValue(OgnlContext, Object, String, Object, boolean)
line: 964
ObjectAccessor(ObjectPropertyAccessor).setPossibleProperty(Map, Object,
String, Object) line: 75
ObjectAccessor(ObjectPropertyAccessor).setProperty(Map, Object, Object,
Object) line: 131
ObjectAccessor.setProperty(Map, Object, Object, Object) line: 28
OgnlRuntime.setProperty(OgnlContext, Object, Object, Object) line:
1656
CompoundRootAccessor.setProperty(Map, Object, Object, Object) line:
50
OgnlRuntime.setProperty(OgnlContext, Object, Object, Object) line:
1656
ASTProperty.setValueBody(OgnlContext, Object, Object) line: 101
ASTProperty(SimpleNode).evaluateSetValueBody(OgnlContext, Object,
Object) line: 177
ASTProperty(SimpleNode).setValue(OgnlContext, Object, Object) line:
246
Ognl.setValue(Object, Map, Object, Object) line: 476
OgnlUtil.setValue(String, Map<String,Object>, Object, Object) line:
192
OgnlValueStack.setValue(String, Object, boolean) line: 155
OgnlValueStack.setValue(String, Object) line: 143
StaticParametersInterceptor.intercept(ActionInvocation) line: 129
DefaultActionInvocation.invoke() line: 236
CheckboxInterceptor.intercept(ActionInvocation) line: 93
DefaultActionInvocation.invoke() line: 236
FileUploadInterceptor.intercept(ActionInvocation) line: 235
DefaultActionInvocation.invoke() line: 236
ModelDrivenInterceptor.intercept(ActionInvocation) line: 89
DefaultActionInvocation.invoke() line: 236
ScopedModelDrivenInterceptor.intercept(ActionInvocation) line: 128
DefaultActionInvocation.invoke() line: 236
ProfilingActivationInterceptor.intercept(ActionInvocation) line: 104
DefaultActionInvocation.invoke() line: 236
DebuggingInterceptor.intercept(ActionInvocation) line: 267
DefaultActionInvocation.invoke() line: 236
ChainingInterceptor.intercept(ActionInvocation) line: 126
DefaultActionInvocation.invoke() line: 236
PrepareInterceptor.doIntercept(ActionInvocation) line: 138
PrepareInterceptor(MethodFilterInterceptor).intercept(ActionInvocation)
line: 87
DefaultActionInvocation.invoke() line: 236
I18nInterceptor.intercept(ActionInvocation) line: 148
DefaultActionInvocation.invoke() line: 236
ServletConfigInterceptor.intercept(ActionInvocation) line: 164
DefaultActionInvocation.invoke() line: 236
AliasInterceptor.intercept(ActionInvocation) line: 128
DefaultActionInvocation.invoke() line: 236
ExceptionMappingInterceptor.intercept(ActionInvocation) line: 176
DefaultActionInvocation.invoke() line: 236
StrutsActionProxy.execute() line: 52
Dispatcher.serviceAction(HttpServletRequest, HttpServletResponse,
ServletContext, ActionMapping) line: 468
ExecuteOperations.executeAction(HttpServletRequest, HttpServletResponse,
ActionMapping) line: 77
StrutsPrepareAndExecuteFilter.doFilter(ServletRequest, ServletResponse,
FilterChain) line: 76
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse)
line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line:
206
StandardWrapperValve.invoke(Request, Response) line: 233
StandardContextValve.invoke(Request, Response) line: 191
StandardHostValve.invoke(Request, Response) line: 128
ErrorReportValve.invoke(Request, Response) line: 102
StandardEngineValve.invoke(Request, Response) line: 109
CoyoteAdapter.service(Request, Response) line: 286
Http11Processor.process(Socket) line: 845
Http11Protocol$Http11ConnectionHandler.process(Socket) line: 583
JIoEndpoint$Worker.run() line: 447
Thread.run() line: 619
<-------------------------------------------------------------------------------------------------------------------------------------------
2nd one:
-------------------------------------------------------------------------------------------->
Daemon Thread [http-8080-2] (Suspended (breakpoint at line 28 in Person))
Person.setCmd(String) line: 28
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
OgnlRuntime.invokeMethod(Object, Method, Object[]) line: 517
OgnlRuntime.callAppropriateMethod(OgnlContext, Object, Object, String,
String, List, Object[]) line: 812
OgnlRuntime.setMethodValue(OgnlContext, Object, String, Object, boolean)
line: 964
ObjectAccessor(ObjectPropertyAccessor).setPossibleProperty(Map, Object,
String, Object) line: 75
ObjectAccessor(ObjectPropertyAccessor).setProperty(Map, Object, Object,
Object) line: 131
ObjectAccessor.setProperty(Map, Object, Object, Object) line: 28
OgnlRuntime.setProperty(OgnlContext, Object, Object, Object) line:
1656
CompoundRootAccessor.setProperty(Map, Object, Object, Object) line:
50
OgnlRuntime.setProperty(OgnlContext, Object, Object, Object) line:
1656
ASTProperty.setValueBody(OgnlContext, Object, Object) line: 101
ASTProperty(SimpleNode).evaluateSetValueBody(OgnlContext, Object,
Object) line: 177
ASTProperty(SimpleNode).setValue(OgnlContext, Object, Object) line:
246
Ognl.setValue(Object, Map, Object, Object) line: 476
OgnlUtil.setValue(String, Map<String,Object>, Object, Object) line:
192
OgnlValueStack.setValue(String, Object, boolean) line: 155
OgnlValueStack.setValue(String, Object) line: 143
ParametersInterceptor.setParameters(Object, ValueStack,
Map<String,Object>) line: 273
ParametersInterceptor.doIntercept(ActionInvocation) line: 187
ParametersInterceptor(MethodFilterInterceptor).intercept(ActionInvocation)
line: 87
DefaultActionInvocation.invoke() line: 236
ActionMappingParametersInteceptor(ParametersInterceptor).doIntercept(ActionInvocation)
line: 195
ActionMappingParametersInteceptor(MethodFilterInterceptor).intercept(ActionInvocation)
line: 87
DefaultActionInvocation.invoke() line: 236
StaticParametersInterceptor.intercept(ActionInvocation) line: 148
DefaultActionInvocation.invoke() line: 236
CheckboxInterceptor.intercept(ActionInvocation) line: 93
DefaultActionInvocation.invoke() line: 236
FileUploadInterceptor.intercept(ActionInvocation) line: 235
DefaultActionInvocation.invoke() line: 236
ModelDrivenInterceptor.intercept(ActionInvocation) line: 89
DefaultActionInvocation.invoke() line: 236
ScopedModelDrivenInterceptor.intercept(ActionInvocation) line: 128
DefaultActionInvocation.invoke() line: 236
ProfilingActivationInterceptor.intercept(ActionInvocation) line: 104
DefaultActionInvocation.invoke() line: 236
DebuggingInterceptor.intercept(ActionInvocation) line: 267
DefaultActionInvocation.invoke() line: 236
ChainingInterceptor.intercept(ActionInvocation) line: 126
DefaultActionInvocation.invoke() line: 236
PrepareInterceptor.doIntercept(ActionInvocation) line: 138
PrepareInterceptor(MethodFilterInterceptor).intercept(ActionInvocation)
line: 87
DefaultActionInvocation.invoke() line: 236
I18nInterceptor.intercept(ActionInvocation) line: 148
DefaultActionInvocation.invoke() line: 236
ServletConfigInterceptor.intercept(ActionInvocation) line: 164
DefaultActionInvocation.invoke() line: 236
AliasInterceptor.intercept(ActionInvocation) line: 128
DefaultActionInvocation.invoke() line: 236
ExceptionMappingInterceptor.intercept(ActionInvocation) line: 176
DefaultActionInvocation.invoke() line: 236
StrutsActionProxy.execute() line: 52
Dispatcher.serviceAction(HttpServletRequest, HttpServletResponse,
ServletContext, ActionMapping) line: 468
ExecuteOperations.executeAction(HttpServletRequest, HttpServletResponse,
ActionMapping) line: 77
StrutsPrepareAndExecuteFilter.doFilter(ServletRequest, ServletResponse,
FilterChain) line: 76
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse)
line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line:
206
StandardWrapperValve.invoke(Request, Response) line: 233
StandardContextValve.invoke(Request, Response) line: 191
StandardHostValve.invoke(Request, Response) line: 128
ErrorReportValve.invoke(Request, Response) line: 102
StandardEngineValve.invoke(Request, Response) line: 109
CoyoteAdapter.service(Request, Response) line: 286
Http11Processor.process(Socket) line: 845
Http11Protocol$Http11ConnectionHandler.process(Socket) line: 583
JIoEndpoint$Worker.run() line: 447
Thread.run() line: 619
<
--------------------------------------------------------------------------------------------
Tomcat 6 used as a container.
Just compared 2 traces. They are almost identical, except 1st one has:
StaticParametersInterceptor.intercept(ActionInvocation) line: 129
, but 2nd one [has it replaced with]
ParametersInterceptor.setParameters(Object, ValueStack,
Map<String,Object>) line: 273
ParametersInterceptor.doIntercept(ActionInvocation) line: 187
ParametersInterceptor(MethodFilterInterceptor).intercept(ActionInvocation)
line: 87
DefaultActionInvocation.invoke() line: 236
ActionMappingParametersInteceptor(ParametersInterceptor).doIntercept(ActionInvocation)
line: 195
ActionMappingParametersInteceptor(MethodFilterInterceptor).intercept(ActionInvocation)
line: 87
DefaultActionInvocation.invoke() line: 236
StaticParametersInterceptor.intercept(ActionInvocation) line: 148
.

Attachment:
user_200807.ezm (zipped)#1 is from the static param interceptor, so you have that set up
somewhere, and the second one is from the normal request parameter
(params interceptor)
On Thu, Jul 16, 2009 at 10:35 AM, Ritvars Rundzāns<rrundzans@(protected):
> I put BP @ setCmd.
>
> 1st hit:
> -------------------------------------------------------------------------------------------->
> Daemon Thread [http-8080-2] (Suspended (breakpoint at line 28 in Person))
>
> Person.setCmd(String) line: 28
> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
> available [native method]
> NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
> Method.invoke(Object, Object...) line: 597
> OgnlRuntime.invokeMethod(Object, Method, Object[]) line: 517
> OgnlRuntime.callAppropriateMethod(OgnlContext, Object, Object, String,
> String, List, Object[]) line: 812
> OgnlRuntime.setMethodValue(OgnlContext, Object, String, Object, boolean)
> line: 964
> ObjectAccessor(ObjectPropertyAccessor).setPossibleProperty(Map, Object,
> String, Object) line: 75
> ObjectAccessor(ObjectPropertyAccessor).setProperty(Map, Object, Object,
> Object) line: 131
> ObjectAccessor.setProperty(Map, Object, Object, Object) line: 28
> OgnlRuntime.setProperty(OgnlContext, Object, Object, Object) line:
> 1656
> CompoundRootAccessor.setProperty(Map, Object, Object, Object) line:
> 50
> OgnlRuntime.setProperty(OgnlContext, Object, Object, Object) line:
> 1656
> ASTProperty.setValueBody(OgnlContext, Object, Object) line: 101
> ASTProperty(SimpleNode).evaluateSetValueBody(OgnlContext, Object,
> Object) line: 177
> ASTProperty(SimpleNode).setValue(OgnlContext, Object, Object) line:
> 246
> Ognl.setValue(Object, Map, Object, Object) line: 476
> OgnlUtil.setValue(String, Map<String,Object>, Object, Object) line:
> 192
> OgnlValueStack.setValue(String, Object, boolean) line: 155
> OgnlValueStack.setValue(String, Object) line: 143
> StaticParametersInterceptor.intercept(ActionInvocation) line: 129
> DefaultActionInvocation.invoke() line: 236
> CheckboxInterceptor.intercept(ActionInvocation) line: 93
> DefaultActionInvocation.invoke() line: 236
> FileUploadInterceptor.intercept(ActionInvocation) line: 235
> DefaultActionInvocation.invoke() line: 236
> ModelDrivenInterceptor.intercept(ActionInvocation) line: 89
> DefaultActionInvocation.invoke() line: 236
> ScopedModelDrivenInterceptor.intercept(ActionInvocation) line: 128
> DefaultActionInvocation.invoke() line: 236
> ProfilingActivationInterceptor.intercept(ActionInvocation) line: 104
> DefaultActionInvocation.invoke() line: 236
> DebuggingInterceptor.intercept(ActionInvocation) line: 267
> DefaultActionInvocation.invoke() line: 236
> ChainingInterceptor.intercept(ActionInvocation) line: 126
> DefaultActionInvocation.invoke() line: 236
> PrepareInterceptor.doIntercept(ActionInvocation) line: 138
> PrepareInterceptor(MethodFilterInterceptor).intercept(ActionInvocation)
> line: 87
> DefaultActionInvocation.invoke() line: 236
> I18nInterceptor.intercept(ActionInvocation) line: 148
> DefaultActionInvocation.invoke() line: 236
> ServletConfigInterceptor.intercept(ActionInvocation) line: 164
> DefaultActionInvocation.invoke() line: 236
> AliasInterceptor.intercept(ActionInvocation) line: 128
> DefaultActionInvocation.invoke() line: 236
> ExceptionMappingInterceptor.intercept(ActionInvocation) line: 176
> DefaultActionInvocation.invoke() line: 236
> StrutsActionProxy.execute() line: 52
> Dispatcher.serviceAction(HttpServletRequest, HttpServletResponse,
> ServletContext, ActionMapping) line: 468
> ExecuteOperations.executeAction(HttpServletRequest, HttpServletResponse,
> ActionMapping) line: 77
> StrutsPrepareAndExecuteFilter.doFilter(ServletRequest, ServletResponse,
> FilterChain) line: 76
> ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse)
> line: 235
> ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line:
> 206
> StandardWrapperValve.invoke(Request, Response) line: 233
> StandardContextValve.invoke(Request, Response) line: 191
> StandardHostValve.invoke(Request, Response) line: 128
> ErrorReportValve.invoke(Request, Response) line: 102
> StandardEngineValve.invoke(Request, Response) line: 109
> CoyoteAdapter.service(Request, Response) line: 286
> Http11Processor.process(Socket) line: 845
> Http11Protocol$Http11ConnectionHandler.process(Socket) line: 583
> JIoEndpoint$Worker.run() line: 447
> Thread.run() line: 619
> <-------------------------------------------------------------------------------------------------------------------------------------------
>
> 2nd one:
> -------------------------------------------------------------------------------------------->
> Daemon Thread [http-8080-2] (Suspended (breakpoint at line 28 in Person))
>
> Person.setCmd(String) line: 28
> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
> available [native method]
> NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
> Method.invoke(Object, Object...) line: 597
> OgnlRuntime.invokeMethod(Object, Method, Object[]) line: 517
> OgnlRuntime.callAppropriateMethod(OgnlContext, Object, Object, String,
> String, List, Object[]) line: 812
> OgnlRuntime.setMethodValue(OgnlContext, Object, String, Object, boolean)
> line: 964
> ObjectAccessor(ObjectPropertyAccessor).setPossibleProperty(Map, Object,
> String, Object) line: 75
> ObjectAccessor(ObjectPropertyAccessor).setProperty(Map, Object, Object,
> Object) line: 131
> ObjectAccessor.setProperty(Map, Object, Object, Object) line: 28
> OgnlRuntime.setProperty(OgnlContext, Object, Object, Object) line:
> 1656
> CompoundRootAccessor.setProperty(Map, Object, Object, Object) line:
> 50
> OgnlRuntime.setProperty(OgnlContext, Object, Object, Object) line:
> 1656
> ASTProperty.setValueBody(OgnlContext, Object, Object) line: 101
> ASTProperty(SimpleNode).evaluateSetValueBody(OgnlContext, Object,
> Object) line: 177
> ASTProperty(SimpleNode).setValue(OgnlContext, Object, Object) line:
> 246
> Ognl.setValue(Object, Map, Object, Object) line: 476
> OgnlUtil.setValue(String, Map<String,Object>, Object, Object) line:
> 192
> OgnlValueStack.setValue(String, Object, boolean) line: 155
> OgnlValueStack.setValue(String, Object) line: 143
> ParametersInterceptor.setParameters(Object, ValueStack,
> Map<String,Object>) line: 273
> ParametersInterceptor.doIntercept(ActionInvocation) line: 187
>
> ParametersInterceptor(MethodFilterInterceptor).intercept(ActionInvocation)
> line: 87
> DefaultActionInvocation.invoke() line: 236
>
> ActionMappingParametersInteceptor(ParametersInterceptor).doIntercept(ActionInvocation)
> line: 195
>
> ActionMappingParametersInteceptor(MethodFilterInterceptor).intercept(ActionInvocation)
> line: 87
> DefaultActionInvocation.invoke() line: 236
> StaticParametersInterceptor.intercept(ActionInvocation) line: 148
> DefaultActionInvocation.invoke() line: 236
> CheckboxInterceptor.intercept(ActionInvocation) line: 93
> DefaultActionInvocation.invoke() line: 236
> FileUploadInterceptor.intercept(ActionInvocation) line: 235
> DefaultActionInvocation.invoke() line: 236
> ModelDrivenInterceptor.intercept(ActionInvocation) line: 89
> DefaultActionInvocation.invoke() line: 236
> ScopedModelDrivenInterceptor.intercept(ActionInvocation) line: 128
> DefaultActionInvocation.invoke() line: 236
> ProfilingActivationInterceptor.intercept(ActionInvocation) line: 104
> DefaultActionInvocation.invoke() line: 236
> DebuggingInterceptor.intercept(ActionInvocation) line: 267
> DefaultActionInvocation.invoke() line: 236
> ChainingInterceptor.intercept(ActionInvocation) line: 126
> DefaultActionInvocation.invoke() line: 236
> PrepareInterceptor.doIntercept(ActionInvocation) line: 138
> PrepareInterceptor(MethodFilterInterceptor).intercept(ActionInvocation)
> line: 87
> DefaultActionInvocation.invoke() line: 236
> I18nInterceptor.intercept(ActionInvocation) line: 148
> DefaultActionInvocation.invoke() line: 236
> ServletConfigInterceptor.intercept(ActionInvocation) line: 164
> DefaultActionInvocation.invoke() line: 236
> AliasInterceptor.intercept(ActionInvocation) line: 128
> DefaultActionInvocation.invoke() line: 236
> ExceptionMappingInterceptor.intercept(ActionInvocation) line: 176
> DefaultActionInvocation.invoke() line: 236
> StrutsActionProxy.execute() line: 52
> Dispatcher.serviceAction(HttpServletRequest, HttpServletResponse,
> ServletContext, ActionMapping) line: 468
> ExecuteOperations.executeAction(HttpServletRequest, HttpServletResponse,
> ActionMapping) line: 77
> StrutsPrepareAndExecuteFilter.doFilter(ServletRequest, ServletResponse,
> FilterChain) line: 76
> ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse)
> line: 235
> ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line:
> 206
> StandardWrapperValve.invoke(Request, Response) line: 233
> StandardContextValve.invoke(Request, Response) line: 191
> StandardHostValve.invoke(Request, Response) line: 128
> ErrorReportValve.invoke(Request, Response) line: 102
> StandardEngineValve.invoke(Request, Response) line: 109
> CoyoteAdapter.service(Request, Response) line: 286
> Http11Processor.process(Socket) line: 845
> Http11Protocol$Http11ConnectionHandler.process(Socket) line: 583
> JIoEndpoint$Worker.run() line: 447
> Thread.run() line: 619
> <
> --------------------------------------------------------------------------------------------
>
> Tomcat 6 used as a container.
>
> Just compared 2 traces. They are almost identical, except 1st one has:
> StaticParametersInterceptor.intercept(ActionInvocation) line: 129
>
> , but 2nd one [has it replaced with]
> ParametersInterceptor.setParameters(Object, ValueStack,
> Map<String,Object>) line: 273
> ParametersInterceptor.doIntercept(ActionInvocation) line: 187
>
> ParametersInterceptor(MethodFilterInterceptor).intercept(ActionInvocation)
> line: 87
> DefaultActionInvocation.invoke() line: 236
>
> ActionMappingParametersInteceptor(ParametersInterceptor).doIntercept(ActionInvocation)
> line: 195
>
> ActionMappingParametersInteceptor(MethodFilterInterceptor).intercept(ActionInvocation)
> line: 87
> DefaultActionInvocation.invoke() line: 236
> StaticParametersInterceptor.intercept(ActionInvocation) line: 148
> .
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_200801.ezm (zipped)
Works - thx. I should have seen that in the doc though ^^
Nils-Helge Garli wrote:
>
> Try using the url tag without specifying value or action.
>
> Nils-H
>
> Den 16. juli. 2009 kl. 13.14 skrev mathias-ewald <nitehoaxxer@(protected)>:
>
>>
>> Hi,
>>
>> is there a way to create a URL (like <s:url>) to the Action that
>> called a
>> JSP file? I would like to reuse some code like forms and other stuff
>>
>> cu
>> mathias
>> --
>> View this message in context:
>> http://www.nabble.com/URL-to-underlying-action-tp24514500p24514500.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)
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200802.ezm (zipped)
Hi all,
I am trying to validate the date field through the xml by using the date
validator defined.
<field-validator type="date">
The problem with this is we can't have leap year validation with this, nor
formate validation and need to specify the date range.
Is there any way where I can validate the date(which implicity take care of
leap year validation with MM/DD/YYY format) and without giving the date
range.
The field type defined in my view bean is java.util.date.
Thanks
Siddiq.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200803.ezm (zipped)Hi all,
I am trying to validate the date field through the xml by using the date validator defined.
<field-validator type="date">
The problem with this is we can't have leap year validation with this, nor formate validation and need to specify the date range.
Is there any way where I can validate the date(which implicity take care of leap year validation with MM/DD/YYY format) and without giving the date range.
The field type defined in my view bean is java.util.date.
Thanks
Siddiq.

Attachment:
user_200804.ezm (zipped)Thanks everyone for their opinions. I was indeed hoping to hear both
sides of this matter, with both bringing valid arguments and make good
points.
I was wondering with popular frameworks like struts, spring and
hibernate integrated together and the increasing adoption of test
driven, and agile development, there should be at least a couple of
comprehensive, and well documented strategies on how to perform such
kind of unit testing with the whole working stack included in the unit
tests.
I am somewhat curious in trying to do this and making it work, so if
anyone is aware of any other resources, or strategies in addition to
Greg's article, where Spring is involved, I'd be very interested in
taking a look at them.
Or, if someone has done such Struts testing before and wouldn't mind
sharing some high-level advice, or hints toward a good starting point,
that would be very helpful and I am sure others can find this
information of value too.
Again, thank you for your input.
On Thu, Jul 16, 2009 at 12:19 PM, Greg Lindholm<greg.lindholm@(protected):
> Well everyone has an opinion so here mine:
>
> I want to unit test my Struts actions in the full Struts context which
> includes the interceptor stack and validation. This way I know my actions
> and results are configured correctly since I test them. I also know my
> declarative validations are working correctly. I use junit and I really
> don't want or have time to have to learn another test tool for integration
> testing.
>
> So to do this type of testing I wrote a StrutsTestContext class to run my
> actions.
> For full info see:
> http://glindholm.wordpress.com/2008/06/30/unit-testing-struts-2-actions/
>
> I don't use Spring so this class would need to be tweaked for Spring but you
> are welcome to use this as a starting point.
>
> This gives me a lot of flexibility for testing, sometimes I test against an
> actual database (with hibernate) and sometimes I mock the services that the
> actions use.
>
>
>
> On Thu, Jul 16, 2009 at 10:43 AM, Dimitrios Christodoulakis <
> dimi.chr@(protected):
>
>> Hello,
>>
>> I was hoping to hear the community's views about unit testing a
>> Struts2 application which is integrated with Spring and Hibernate. My
>> plan is to unit test the actions with the framework's interceptors
>> running, rather than each action class in a stand-alone isolated
>> fashion.
>>
>> What approach do you usually follow? A highly regarded article:
>>
>> http://depressedprogrammer.wordpress.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/
>> provides some useful hints and starting points.
>>
>> I would like to use Junit 4 with Ant for this. Are there any other
>> resources, or documented steps to take as far as you know, or
>> recommend?
>>
>> I found quite a few bits and pieces searching online, but would
>> appreciate any general guidance or advice on how to begin with this.
>>
>> Many thanks and regards.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment:
user_200808.ezm (zipped)On Today at 1:19pm, GL=>Greg Lindholm <greg.lindholm@(protected):
GL> Well everyone has an opinion so here mine:
GL>
GL> I want to unit test my Struts actions in the full Struts context which
GL> includes the interceptor stack and validation. This way I know my
GL> actions and results are configured correctly since I test them. I also
GL> know my declarative validations are working correctly. I use junit and
GL> I really don't want or have time to have to learn another test tool
GL> for integration testing.
GL>
Hi,
+1. I'm biased in my opinion though. I helped write part of the code
that's being quoted on:
http://depressedprogrammer.wordpress.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/
We like to test against the complete struts context include the relevant
interceptor stack. This gives us the ability to test for all kinds of
combinations of compelte and partially incomplete input. We like to test
with mock database layer (for speed purposes). E.g., when providing
incomplete input, I can test for:
assertEquals(INPUT, proxy.execute());
assertEquals("4 field errors", 4, action.getFieldErrors().size());
In addition, we also like to test out the rendered result, all while
running the ActionTest. It helps catch fat-finger mistakes. E.g, we can
write code like to check that our freemarker template got rendered
properly:
assertTrue("Content contains first record",
content.contains("{'institutionType.type': 'CEC'}"));
assertTrue("Content contains last record",
content.contains("{'institutionType.type': 'COL'}"));
assertEquals("Number of records in list should be 4", 4,
StringUtils.countMatches(content, "'institutionType.type':"));
GL>
GL> So to do this type of testing I wrote a StrutsTestContext class to run my
GL> actions.
GL> For full info see:
GL> http://glindholm.wordpress.com/2008/06/30/unit-testing-struts-2-actions/
GL>
I glanced briefly at the provided code on Greg's and it looks similar in
principle to the depressedprogrammer (arsenalist) code. Good work, Greg.
GL>
GL> I don't use Spring so this class would need to be tweaked for Spring but you
GL> are welcome to use this as a starting point.
GL>
GL> This gives me a lot of flexibility for testing, sometimes I test
GL> against an actual database (with hibernate) and sometimes I mock the
GL> services that the actions use.
GL>
Later,
--
Haroon Rafique
<haroon.rafique@(protected)>

Attachment:
user_200810.ezm (zipped)If it's integration testing you want to do, I've had success embedding
Jetty and doing "full" in-container integration testing. Embedding
Jetty is really easy, and it's pretty fast too. Although not Struts 2
specific, take a look at this article:
http://today.java.net/pub/a/today/2007/04/12/embedded-integration-testing-of-web-applications.html
Nils-H
On Thu, Jul 16, 2009 at 8:27 PM, Dimitrios
Christodoulakis<dimi.chr@(protected):
> Thanks everyone for their opinions. I was indeed hoping to hear both
> sides of this matter, with both bringing valid arguments and make good
> points.
>
> I was wondering with popular frameworks like struts, spring and
> hibernate integrated together and the increasing adoption of test
> driven, and agile development, there should be at least a couple of
> comprehensive, and well documented strategies on how to perform such
> kind of unit testing with the whole working stack included in the unit
> tests.
>
> I am somewhat curious in trying to do this and making it work, so if
> anyone is aware of any other resources, or strategies in addition to
> Greg's article, where Spring is involved, I'd be very interested in
> taking a look at them.
>
> Or, if someone has done such Struts testing before and wouldn't mind
> sharing some high-level advice, or hints toward a good starting point,
> that would be very helpful and I am sure others can find this
> information of value too.
>
> Again, thank you for your input.
>
>
>
>
>
> On Thu, Jul 16, 2009 at 12:19 PM, Greg Lindholm<greg.lindholm@(protected):
>> Well everyone has an opinion so here mine:
>>
>> I want to unit test my Struts actions in the full Struts context which
>> includes the interceptor stack and validation. This way I know my actions
>> and results are configured correctly since I test them. I also know my
>> declarative validations are working correctly. I use junit and I really
>> don't want or have time to have to learn another test tool for integration
>> testing.
>>
>> So to do this type of testing I wrote a StrutsTestContext class to run my
>> actions.
>> For full info see:
>> http://glindholm.wordpress.com/2008/06/30/unit-testing-struts-2-actions/
>>
>> I don't use Spring so this class would need to be tweaked for Spring but you
>> are welcome to use this as a starting point.
>>
>> This gives me a lot of flexibility for testing, sometimes I test against an
>> actual database (with hibernate) and sometimes I mock the services that the
>> actions use.
>>
>>
>>
>> On Thu, Jul 16, 2009 at 10:43 AM, Dimitrios Christodoulakis <
>> dimi.chr@(protected):
>>
>>> Hello,
>>>
>>> I was hoping to hear the community's views about unit testing a
>>> Struts2 application which is integrated with Spring and Hibernate. My
>>> plan is to unit test the actions with the framework's interceptors
>>> running, rather than each action class in a stand-alone isolated
>>> fashion.
>>>
>>> What approach do you usually follow? A highly regarded article:
>>>
>>> http://depressedprogrammer.wordpress.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/
>>> provides some useful hints and starting points.
>>>
>>> I would like to use Junit 4 with Ant for this. Are there any other
>>> resources, or documented steps to take as far as you know, or
>>> recommend?
>>>
>>> I found quite a few bits and pieces searching online, but would
>>> appreciate any general guidance or advice on how to begin with this.
>>>
>>> Many thanks and regards.
>>>
>>> ---------------------------------------------------------------------
>>> 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_200805.ezm (zipped)
Hi,
I am trying to implement a login mechanism. I will now explain what I did
and what error I get but in case there is a more sophisticated way to do
that - please tell me!
I created a BaseAction which is the parent of all my Actions. The BaseAction
is supposed to be responsible for displaying a login page if there is no
User object in session scope. Then the login form should put the username
and password into the BaseAction. The BaseAction then tries to find a match
in the database and places the User object into session scope:
---------------------
public abstract class BaseAction {
private String username;
private String password;
protected Log log;
private Boolean loginStatus;
public String execute() {
if(log == null) {
log = LogFactory.getLog(getClass());
}
if(isProtected()) {
Map<String, Object> session = ActionContext.getContext().getSession();
Object o = session.get("user");
if(o instanceof User) {
loginStatus = true;
} else {
return "login";
}
}
return executeAction();
}
public abstract String executeAction();
public abstract Boolean isProtected();
public Boolean getLoginStatus() {
return loginStatus;
}
public void setLoginStatus(Boolean loginStatus) {
this.loginStatus = loginStatus;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
---------------------
An Action that wants to be password protected must implement #isProtected()
to return "true". This is my JSP file that is shown if #isProtected() ==
true and there's no User in session scope:
---------------------
...
<s:form>
<s:textfield label="Username" name="userData.username"></s:textfield>
<s:password label="Password" name="userData.password"></s:password>
<s:submit></s:submit>
</s:form>
...
---------------------
This is the error I get
---------------------
20:35:42,179 WARN OgnlValueStack:49 - Error setting value
ognl.OgnlException: target is null for setProperty(null, "password",
[Ljava.lang.String;@(protected))
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1651)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.ASTChain.setValueBody(ASTChain.java:172)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
...
---------------------
Why is that happening?
cu
mathias
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200806.ezm (zipped)Take a look at Spring Security (formerly ACEGI).
http://static.springsource.org/spring-security/site/
> -----Original Message-----
> From: mathias-ewald [mailto:nitehoaxxer@(protected)]
> Sent: Thursday, July 16, 2009 2:37 PM
> To: user@(protected)
> Subject: Login with Struts2
>
>
> Hi,
>
> I am trying to implement a login mechanism. I will now
> explain what I did
> and what error I get but in case there is a more
> sophisticated way to do
> that - please tell me!
>
> I created a BaseAction which is the parent of all my Actions.
> The BaseAction
> is supposed to be responsible for displaying a login page if
> there is no
> User object in session scope. Then the login form should put
> the username
> and password into the BaseAction. The BaseAction then tries
> to find a match
> in the database and places the User object into session scope:
>
> ---------------------
> public abstract class BaseAction {
>
> private String username;
>
> private String password;
>
> protected Log log;
>
> private Boolean loginStatus;
>
>
> public String execute() {
> if(log == null) {
> log = LogFactory.getLog(getClass());
> }
>
> if(isProtected()) {
> Map<String, Object> session =
> ActionContext.getContext().getSession();
> Object o = session.get("user");
> if(o instanceof User) {
> loginStatus = true;
> } else {
> return "login";
> }
> }
>
>
> return executeAction();
> }
>
>
> public abstract String executeAction();
>
> public abstract Boolean isProtected();
>
>
> public Boolean getLoginStatus() {
> return loginStatus;
> }
>
> public void setLoginStatus(Boolean loginStatus) {
> this.loginStatus = loginStatus;
> }
>
> public String getUsername() {
> return username;
> }
>
> public void setUsername(String username) {
> this.username = username;
> }
>
> public String getPassword() {
> return password;
> }
>
> public void setPassword(String password) {
> this.password = password;
> }
> }
> ---------------------
>
> An Action that wants to be password protected must implement
> #isProtected()
> to return "true". This is my JSP file that is shown if
> #isProtected() ==
> true and there's no User in session scope:
>
> ---------------------
> ...
> <s:form>
> <s:textfield label="Username"
> name="userData.username"></s:textfield>
> <s:password label="Password"
> name="userData.password"></s:password>
> <s:submit></s:submit>
> </s:form>
> ...
> ---------------------
>
> This is the error I get
>
> ---------------------
> 20:35:42,179 WARN OgnlValueStack:49 - Error setting value
> ognl.OgnlException: target is null for setProperty(null, "password",
> [Ljava.lang.String;@(protected))
> at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1651)
> at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
> at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
> at ognl.SimpleNode.setValue(SimpleNode.java:246)
> at ognl.ASTChain.setValueBody(ASTChain.java:172)
> at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
> at ognl.SimpleNode.setValue(SimpleNode.java:246)
> at ognl.Ognl.setValue(Ognl.java:476)
> ...
> ---------------------
>
>
> Why is that happening?
>
> cu
> mathias
> --
> View this message in context:
> http://www.nabble.com/Login-with-Struts2-tp24522078p24522078.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)
>
>
Notice: This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.

Attachment:
user_200811.ezm (zipped)Hi,
I recently implemented a login mechanism but did it slightly differently
after recommendations from this mailing list to use an interceptor.
Each action/page that requires a validated login is directed via a
Interceptor.
The sole purpose of the interceptor is to verify the existence of an
object in the session. Here is the guts of the method:
public String intercept(ActionInvocation invocation) throws Exception {
ActionContext ac = invocation.getInvocationContext();
Map session = ac.getSession();
// retrieve the login status from the session by key name.
User user = (User) session.get(Constants.USER_SESSION_SCOPE);
// if the user object is non null, the user is logged in.
if (user != null) {;
return invocation.invoke();
}
return "notLoggedIn";
}
It is then necessary to create a new interceptor stack:
<interceptor-stack name="my.validationWorkflowStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="amr.validation"/>
</interceptor-stack>
I also defined a global-result as follows to take care of directing the
client when not logged in.
<global-results>
<result name="notLoggedIn" type="redirectAction">
<param name="actionName">showLogin</param>
</result>
</global-results>
Finally, here is an example of a protected action using the new
interceptor stack:
<action name="showControlPanel">
<!-- Include our validation stack to ensure user is logged
in -->
<interceptor-ref name="my.validationWorkflowStack"/>
<result type="freemarker">/controlPanel.ftl</result>
</action>
You then simply need a regular action to take of the "login" which will
place a valid object/flag in the session.
Hope this helps
mathias-ewald wrote:
> Hi,
>
> I am trying to implement a login mechanism. I will now explain what I did
> and what error I get but in case there is a more sophisticated way to do
> that - please tell me!
>
> I created a BaseAction which is the parent of all my Actions. The BaseAction
> is supposed to be responsible for displaying a login page if there is no
> User object in session scope. Then the login form should put the username
> and password into the BaseAction. The BaseAction then tries to find a match
> in the database and places the User object into session scope:
>
> ---------------------
> public abstract class BaseAction {
>
> private String username;
>
> private String password;
>
> protected Log log;
>
> private Boolean loginStatus;
>
>
> public String execute() {
> if(log == null) {
> log = LogFactory.getLog(getClass());
> }
>
> if(isProtected()) {
> Map<String, Object> session = ActionContext.getContext().getSession();
> Object o = session.get("user");
> if(o instanceof User) {
> loginStatus = true;
> } else {
> return "login";
> }
> }
>
>
> return executeAction();
> }
>
>
> public abstract String executeAction();
>
> public abstract Boolean isProtected();
>
>
> public Boolean getLoginStatus() {
> return loginStatus;
> }
>
> public void setLoginStatus(Boolean loginStatus) {
> this.loginStatus = loginStatus;
> }
>
> public String getUsername() {
> return username;
> }
>
> public void setUsername(String username) {
> this.username = username;
> }
>
> public String getPassword() {
> return password;
> }
>
> public void setPassword(String password) {
> this.password = password;
> }
> }
> ---------------------
>
> An Action that wants to be password protected must implement #isProtected()
> to return "true". This is my JSP file that is shown if #isProtected() ==
> true and there's no User in session scope:
>
> ---------------------
> ...
> <s:form>
> <s:textfield label="Username" name="userData.username"></s:textfield>
> <s:password label="Password" name="userData.password"></s:password>
> <s:submit></s:submit>
> </s:form>
> ...
> ---------------------
>
> This is the error I get
>
> ---------------------
> 20:35:42,179 WARN OgnlValueStack:49 - Error setting value
> ognl.OgnlException: target is null for setProperty(null, "password",
> [Ljava.lang.String;@(protected))
> at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1651)
> at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
> at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
> at ognl.SimpleNode.setValue(SimpleNode.java:246)
> at ognl.ASTChain.setValueBody(ASTChain.java:172)
> at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
> at ognl.SimpleNode.setValue(SimpleNode.java:246)
> at ognl.Ognl.setValue(Ognl.java:476)
> ...
> ---------------------
>
>
> Why is that happening?
>
> cu
> mathias
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.387 / Virus Database: 270.13.16/2240 - Release Date: 07/15/09 17:58:00
>
>

Attachment:
user_200809.ezm (zipped)I am working on a plug-in and having trouble getting the runtime to find my
freemarker pages. I have a folder named pages in my plugin.jar where my
freemarker pages reside. My struts-plugin.xml is referring to the pages as
follows:
<result type="freemarker">/pages/config.ftl</result>
However, I am receiving a runtime
java.io.FileNotFoundException: Template /config/pages/config.ftl not found.
at
freemarker.template.Configuration.getTemplate (
Configuration.java:489)
I have studied the struts2-config-browser-plugin and I'm now starting to
wonder if there is some magic with respect to the freemarker folder being
called config-browser which happens to be the same namespace of the plugin.
Does anyone know the mechanics of these names?
Peace,
Scott
--
Sent from the Struts - User mailing list archive at Nabble.com.