Author Login
Post Reply
user Digest 15 Jan 2010 18:13:16 -0000 Issue 8981
Topics (messages 204638 through 204666):
Re: Can I implement interface of another project in a struts 2 project?
204638 by: fireapple
204642 by: Gabriel Belingueres
Re: Distinguish between request parameters and struts.xml parameters in Struts2
204639 by: Musachy Barroso
204640 by: Dale Newfield
204641 by: Musachy Barroso
write a test which tests an interceptor
204643 by: Michael Finney
204646 by: Greg Lindholm
Re: where to set 'struts.multipart.parser' property in struts2?
204644 by: Lukasz Lenart
Re: REST Plugin only for some actions
204645 by: Lotsopa
204647 by: Dale Newfield
Problem with jsp and session on first call
204648 by: Cimballi
204649 by: Cimballi
204650 by: Gabriel Belingueres
204651 by: Cimballi
204655 by: Gabriel Belingueres
204656 by: Cimballi
Struts2 s:head tag generates wrong paths?
204652 by: Stephan R. Mueller
204659 by: Wes Wannemacher
Struts 2 Tags / Freemarker performance
204653 by: Mark Greene
204654 by: Musachy Barroso
Struts 2 <s:if test syntax
204657 by: RogerV
204658 by: Saeed Iqbal
How to do programatic validation?
204660 by: doahh
204661 by: doahh
204664 by: Wes Wannemacher
Re: Struts2 s:head tag generates wrong paths? [SOLVED]
204662 by: Stephan R. Mueller
204663 by: Wes Wannemacher
Upgrade 2.1.6 to 2.1.8.1 - Action Results in 404
204665 by: CRANFORD, CHRIS
204666 by: Wes Wannemacher
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_204638.ezm (zipped)It solved the problem. Thanks!
I wonder what's the difference between putting jar in build path and putting
jar in WEB-INF/lib. Appreciate
Gabriel Belingueres-2 wrote:
>
> Seems it is not S2 related. This exception is raised when some
> dependency is not found by the JVM. Note that in addition to be
> available in your build path, the dependency must be available at
> runtime too (usually inside the WEB-INF/lib folder)
>
> 2010/1/12 fireapple <taizhang1981@(protected)>:
>>
>> In project1, I include project2 in order to use interfaces (interface A,
>> B,
>> C, D.....) of project2.
>> However, the system always claim
java.lang.NoClassDefFoundError for
>> interface of project2.
>>
>> I also exported project2 to a JAR and include it in project1's build
>> path,
>> still no luck.
>>
>> I tried 3 of my projects, all fail with the same error. I was wondering
>> if
>> it's a struts 2 issue of my configuration problem.
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Can-I-implement-interface-of-another-project-in-a-struts-2-project--tp27131976p27131976.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_204642.ezm (zipped)the build path is considered only by the java compiler, not by your
executing application server. The WEB-INF/lib is the folder the web
apps put required run time dependencies, so that the app server can
found them.
2010/1/13 fireapple <taizhang1981@(protected)>:
>
> It solved the problem. Thanks!
>
> I wonder what's the difference between putting jar in build path and putting
> jar in WEB-INF/lib. Appreciate
>
>
> Gabriel Belingueres-2 wrote:
>>
>> Seems it is not S2 related. This exception is raised when some
>> dependency is not found by the JVM. Note that in addition to be
>> available in your build path, the dependency must be available at
>> runtime too (usually inside the WEB-INF/lib folder)
>>
>> 2010/1/12 fireapple <taizhang1981@(protected)>:
>>>
>>> In project1, I include project2 in order to use interfaces (interface A,
>>> B,
>>> C, D.....) of project2.
>>> However, the system always claim
java.lang.NoClassDefFoundError for
>>> interface of project2.
>>>
>>> I also exported project2 to a JAR and include it in project1's build
>>> path,
>>> still no luck.
>>>
>>> I tried 3 of my projects, all fail with the same error. I was wondering
>>> if
>>> it's a struts 2 issue of my configuration problem.
>>>
>>> Thanks
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Can-I-implement-interface-of-another-project-in-a-struts-2-project--tp27131976p27131976.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)
>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Can-I-implement-interface-of-another-project-in-a-struts-2-project--tp27131976p27151209.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)
>
>

Attachment:
user_204639.ezm (zipped)No way to distinguish, that I know off. But the static params
interceptor has a setting to not merge them.
On Mon, Jan 11, 2010 at 7:54 PM, Jose Luis Martinez Avial
<jlmartinez@(protected):
> Hi all,
> I'm trying to distinguish the parameters that come from the request
> from those that come from the params defined in the struts.xml. For
> example, I have the following mapping in my struts.xml
>
> <action name="Login_*" method="{1}" class="example.Login">
> <param name="resource">my resource</param>
> <result name="input">/example/Login.jsp</result>
> <result type="redirectAction">Menu</result>
> </action>
>
> The call to that action will have a variable number of parameters, so I
> want to distinguish between them and the parameter defined in the
> struts.xml. How can I do that? In Struts 1 I was able to use the tag
> <set-property>, and since the action was separated from the form, there
> was no problem, but in Struts2 that is no longer possible. Any ideas?
>
> Thanks
>
> Jose Luis
>
>
> Internet communications are not secure and therefore Banco
> Santander International does not accept legal responsibility for
> the contents of this message. Any views or opinions presented
> are
> solely those of the author and do not necessarily represent those
> of Banco Santander International unless otherwise specifically
> stated.
>
> Las comunicaciones via Internet no son seguras y por lo tanto
> Banco Santander International no asume responsabilidad legal
> ni
> de ningun otro tipo por el contenido de este mensaje. Cualquier
> opinion transmitida pertenece unicamente al autor y no
> necesariamente representa la opinion del Banco Santander
> International a no ser que este expresamente detallado.
>
>

Attachment:
user_204640.ezm (zipped)Musachy Barroso wrote:
> No way to distinguish, that I know off.
Perhaps simply inserting a custom interceptor between params and
actionMappingParams/staticParams so you can track which are set before
the custom interceptor runs and which are set afterwards?
-Dale

Attachment:
user_204641.ezm (zipped)well, I meant built in :)
On Wed, Jan 13, 2010 at 2:17 PM, Dale Newfield <dale@(protected):
> Musachy Barroso wrote:
>>
>> No way to distinguish, that I know off.
>
> Perhaps simply inserting a custom interceptor between params and
> actionMappingParams/staticParams so you can track which are set before the
> custom interceptor runs and which are set afterwards?
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_204643.ezm (zipped)Hi,
I wish to write a test which tests an interceptor. The goal is writing
an integration test which hits the struts2 2.1.6 application and mocks
out the database DAO (data access object). I'm using JUnit. The
interceptor changes the HTTP Response headers. I am testing that and
indirectly the struts.xml configuration.
http://struts.apache.org/2.1.6/docs/how-can-we-test-actions.html gave
me high hopes. However, ActionProxyFactory.getFactory() does not
compile.
http://glindholm.wordpress.com/2008/06/30/unit-testing-struts-2-actions
looks promising.
It seems clear that I need to get an ActionProxy, get an action from
it, and call the action's execute.
Thoughts?
Thanks.
--
Michael Finney - "Always Striving To Serve You Better Every Day"
http://www.SmilingSoftwareSolutions.com

Attachment:
user_204646.ezm (zipped)I'm biased, but I think this one works pretty well, and I use it to
test interceptors.
>
> http://glindholm.wordpress.com/2008/06/30/unit-testing-struts-2-actions
> looks promising.
>

Attachment:
user_204644.ezm (zipped)2010/1/13 Stephen Ince <stephenpince@(protected)>:
> <bean type="
org.apache.struts2.dispatcher.multipart.MultiPartRequest"
> name="jakartax"
> class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequestx"
> scope="default"/>
> <constant name="struts.multipart.parser" value="jakartax" />
Is that class exists
org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequestx ?
Regards
--
Lukasz
Kapituła Javarsovia 2010
http://javarsovia.pl

Attachment:
user_204645.ezm (zipped)
Is there anything new about NamespaceBasedActionMapper :) I mean, does this
thing work?
DNewfield wrote:
>
>
> I built something I call NamespaceBasedActionMapper that allows you to
> specify different action mappers for different namespaces. If this is
> what you're looking for, let me know.
>
> -Dale
>
> ---------------------------------------------------------------------
> 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_204647.ezm (zipped)Lotsopa wrote:
> Is there anything new about NamespaceBasedActionMapper :) I mean, does this
> thing work?
Someone convinced me a better name was "PrefixBasedActionMapper", but
yes, it works fine. The code can be found as an attachment to this JIRA
issue: https://issues.apache.org/struts/browse/WW-3260
-Dale

Attachment:
user_204648.ezm (zipped)Hi,
I have a problem with a JSP and the session the first time I call the
action which redirects to the page.
The action sets a variable in the session using the code :
final HttpSession session =
ServletActionContext.getRequest().getSession(false);
session.setAttribute(name, value);
Then, the action redirects to a page where there is a select tag like :
<s:select name="xxx" list="#session.sessionValue" />
If I start the application, the first time I call the page I have the
following error :
org.apache.jasper.JasperException: tag 'select', field 'list', name
'xxx': The requested list key '#session.sessionValue' could not be
resolved as a collection/array/map/enumeration/iterator type. Example:
people or people.{name} - [unknown location]
On the second call, it works. Note : I am using a specific
interceptors stack, so the problem could come from there, even if I
doubt.
Do you have any idea about where the problem can come from ?
Thanks,
Cimballi

Attachment:
user_204649.ezm (zipped)Hi,
I have a problem with a JSP and the session the first time I call the
action which redirects to the page.
The action sets a variable in the session using the code :
final HttpSession session =
ServletActionContext.getRequest().getSession(false);
session.setAttribute(name, value);
Then, the action redirects to a page where there is a select tag like :
<s:select name="xxx" list="#session.sessionValue" />
If I start the application, the first time I call the page I have the
following error :
org.apache.jasper.JasperException: tag 'select', field 'list', name
'xxx': The requested list key '#session.sessionValue' could not be
resolved as a collection/array/map/enumeration/iterator type. Example:
people or people.{name} - [unknown location]
On the second call, it works. Note : I am using a specific
interceptors stack, so the problem could come from there, even if I
doubt.
Do you have any idea about where the problem can come from ?
Thanks,
Cimballi

Attachment:
user_204650.ezm (zipped)This way of obtaining a Session I think is not a good idiom.
May be there are things that happens behind the scene when obtaining a
session, that's probably why you are not getting a NPE the first time
you call getSession(false) in your code...because "something" already
created it.
S2 have a Map abstraction of session:
http://struts.apache.org/2.1.8.1/docs/how-do-we-get-access-to-the-session.html
HTH
2010/1/14 Cimballi <cimballi.cimballi@(protected)>:
> Hi,
>
> I have a problem with a JSP and the session the first time I call the
> action which redirects to the page.
> The action sets a variable in the session using the code :
> final HttpSession session =
> ServletActionContext.getRequest().getSession(false);
> session.setAttribute(name, value);
>
> Then, the action redirects to a page where there is a select tag like :
> <s:select name="xxx" list="#session.sessionValue" />
>
> If I start the application, the first time I call the page I have the
> following error :
>
org.apache.jasper.JasperException: tag 'select', field 'list', name
> 'xxx': The requested list key '#session.sessionValue' could not be
> resolved as a collection/array/map/enumeration/iterator type. Example:
> people or people.{name} - [unknown location]
>
> On the second call, it works. Note : I am using a specific
> interceptors stack, so the problem could come from there, even if I
> doubt.
>
> Do you have any idea about where the problem can come from ?
>
> Thanks,
>
> Cimballi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_204651.ezm (zipped)Hey Grabiel,
Thanks for the link, now it works, but I two questions :
1. About my problem, in the configuration, I am using
CreateSessionInterceptor to create a session. And in the logs, I can
see that the first time the JSP is looking for the variable, the
session exisits but is empty (while I set the value in the action, but
with HttpSession), the second time, the session contains the value. Do
you think this behaviour is normal ?
2. In which case should we use the "context" session and in which case
should we use the HttpSession ? For example, in
CreateSessionInterceptor it uses the HttpSession, but then in the
actions it seems to be recommended to use the "context" session.
Thanks !
Cimballi
On Thu, Jan 14, 2010 at 5:31 PM, Gabriel Belingueres
<belingueres@(protected):
> This way of obtaining a Session I think is not a good idiom.
>
> May be there are things that happens behind the scene when obtaining a
> session, that's probably why you are not getting a NPE the first time
> you call getSession(false) in your code...because "something" already
> created it.
>
> S2 have a Map abstraction of session:
> http://struts.apache.org/2.1.8.1/docs/how-do-we-get-access-to-the-session.html
>
> HTH
>
> 2010/1/14 Cimballi <cimballi.cimballi@(protected)>:
>> Hi,
>>
>> I have a problem with a JSP and the session the first time I call the
>> action which redirects to the page.
>> The action sets a variable in the session using the code :
>> final HttpSession session =
>> ServletActionContext.getRequest().getSession(false);
>> session.setAttribute(name, value);
>>
>> Then, the action redirects to a page where there is a select tag like :
>> <s:select name="xxx" list="#session.sessionValue" />
>>
>> If I start the application, the first time I call the page I have the
>> following error :
>>
org.apache.jasper.JasperException: tag 'select', field 'list', name
>> 'xxx': The requested list key '#session.sessionValue' could not be
>> resolved as a collection/array/map/enumeration/iterator type. Example:
>> people or people.{name} - [unknown location]
>>
>> On the second call, it works. Note : I am using a specific
>> interceptors stack, so the problem could come from there, even if I
>> doubt.
>>
>> Do you have any idea about where the problem can come from ?
>>
>> Thanks,
>>
>> Cimballi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>

Attachment:
user_204655.ezm (zipped)1. Not normal, but may be it is so because you are not using one of
the recommended ways of accessing the session object. IIRC, the
"#session" object is an object inside the ValueStack, not the *real*
HttpSession. If you talk directly with the real session object, those
sort of things may happen.
2. I think I never had the necessity of using directly the HttpSession
object. In my actions I implement the SessionAware interface, and in
my interceptors I get the session by calling
ActionContext.getContext().getSession().
BTW, I was certain somebody else had a similar problem before. You may
find this post useful too:
http://old.nabble.com/-S2--newly-created-Session-context-td18448642.html
2010/1/14 Cimballi <cimballi@(protected)>:
> Hey Grabiel,
>
> Thanks for the link, now it works, but I two questions :
> 1. About my problem, in the configuration, I am using
> CreateSessionInterceptor to create a session. And in the logs, I can
> see that the first time the JSP is looking for the variable, the
> session exisits but is empty (while I set the value in the action, but
> with HttpSession), the second time, the session contains the value. Do
> you think this behaviour is normal ?
> 2. In which case should we use the "context" session and in which case
> should we use the HttpSession ? For example, in
> CreateSessionInterceptor it uses the HttpSession, but then in the
> actions it seems to be recommended to use the "context" session.
>
> Thanks !
>
> Cimballi
>
>
> On Thu, Jan 14, 2010 at 5:31 PM, Gabriel Belingueres
> <belingueres@(protected):
>> This way of obtaining a Session I think is not a good idiom.
>>
>> May be there are things that happens behind the scene when obtaining a
>> session, that's probably why you are not getting a NPE the first time
>> you call getSession(false) in your code...because "something" already
>> created it.
>>
>> S2 have a Map abstraction of session:
>> http://struts.apache.org/2.1.8.1/docs/how-do-we-get-access-to-the-session.html
>>
>> HTH
>>
>> 2010/1/14 Cimballi <cimballi.cimballi@(protected)>:
>>> Hi,
>>>
>>> I have a problem with a JSP and the session the first time I call the
>>> action which redirects to the page.
>>> The action sets a variable in the session using the code :
>>> final HttpSession session =
>>> ServletActionContext.getRequest().getSession(false);
>>> session.setAttribute(name, value);
>>>
>>> Then, the action redirects to a page where there is a select tag like :
>>> <s:select name="xxx" list="#session.sessionValue" />
>>>
>>> If I start the application, the first time I call the page I have the
>>> following error :
>>>
org.apache.jasper.JasperException: tag 'select', field 'list', name
>>> 'xxx': The requested list key '#session.sessionValue' could not be
>>> resolved as a collection/array/map/enumeration/iterator type. Example:
>>> people or people.{name} - [unknown location]
>>>
>>> On the second call, it works. Note : I am using a specific
>>> interceptors stack, so the problem could come from there, even if I
>>> doubt.
>>>
>>> Do you have any idea about where the problem can come from ?
>>>
>>> Thanks,
>>>
>>> Cimballi
>>>
>>> ---------------------------------------------------------------------
>>> 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_204656.ezm (zipped)Thanks, I didn't found this post before sending mine.
It seems there is an inconsistant state when you use both way to
access the session, but only on the first call.
I tried to have a look to the root reason, but I miss Struts-Xwork
deep knowledge to really understand what's happen.
Don't you think it could be interesting to find a solution to have
both way working ?
Well, maybe it's not possible in fact... I've seen there is also kind
of hack to invalidate the session, because if you invalidate the
HttpSession it generates an error when recreating and accessgin it
again.
Cimballi
On Thu, Jan 14, 2010 at 8:03 PM, Gabriel Belingueres
<belingueres@(protected):
> 1. Not normal, but may be it is so because you are not using one of
> the recommended ways of accessing the session object. IIRC, the
> "#session" object is an object inside the ValueStack, not the *real*
> HttpSession. If you talk directly with the real session object, those
> sort of things may happen.
>
> 2. I think I never had the necessity of using directly the HttpSession
> object. In my actions I implement the SessionAware interface, and in
> my interceptors I get the session by calling
> ActionContext.getContext().getSession().
>
> BTW, I was certain somebody else had a similar problem before. You may
> find this post useful too:
> http://old.nabble.com/-S2--newly-created-Session-context-td18448642.html
>
> 2010/1/14 Cimballi <cimballi@(protected)>:
>> Hey Grabiel,
>>
>> Thanks for the link, now it works, but I two questions :
>> 1. About my problem, in the configuration, I am using
>> CreateSessionInterceptor to create a session. And in the logs, I can
>> see that the first time the JSP is looking for the variable, the
>> session exisits but is empty (while I set the value in the action, but
>> with HttpSession), the second time, the session contains the value. Do
>> you think this behaviour is normal ?
>> 2. In which case should we use the "context" session and in which case
>> should we use the HttpSession ? For example, in
>> CreateSessionInterceptor it uses the HttpSession, but then in the
>> actions it seems to be recommended to use the "context" session.
>>
>> Thanks !
>>
>> Cimballi
>>
>>
>> On Thu, Jan 14, 2010 at 5:31 PM, Gabriel Belingueres
>> <belingueres@(protected):
>>> This way of obtaining a Session I think is not a good idiom.
>>>
>>> May be there are things that happens behind the scene when obtaining a
>>> session, that's probably why you are not getting a NPE the first time
>>> you call getSession(false) in your code...because "something" already
>>> created it.
>>>
>>> S2 have a Map abstraction of session:
>>> http://struts.apache.org/2.1.8.1/docs/how-do-we-get-access-to-the-session.html
>>>
>>> HTH
>>>
>>> 2010/1/14 Cimballi <cimballi.cimballi@(protected)>:
>>>> Hi,
>>>>
>>>> I have a problem with a JSP and the session the first time I call the
>>>> action which redirects to the page.
>>>> The action sets a variable in the session using the code :
>>>> final HttpSession session =
>>>> ServletActionContext.getRequest().getSession(false);
>>>> session.setAttribute(name, value);
>>>>
>>>> Then, the action redirects to a page where there is a select tag like :
>>>> <s:select name="xxx" list="#session.sessionValue" />
>>>>
>>>> If I start the application, the first time I call the page I have the
>>>> following error :
>>>>
org.apache.jasper.JasperException: tag 'select', field 'list', name
>>>> 'xxx': The requested list key '#session.sessionValue' could not be
>>>> resolved as a collection/array/map/enumeration/iterator type. Example:
>>>> people or people.{name} - [unknown location]
>>>>
>>>> On the second call, it works. Note : I am using a specific
>>>> interceptors stack, so the problem could come from there, even if I
>>>> doubt.
>>>>
>>>> Do you have any idea about where the problem can come from ?
>>>>
>>>> Thanks,
>>>>
>>>> Cimballi
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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_204652.ezm (zipped)Hi list.
Using 2.1.8 with JSP on JBoss 5.1.0. <s:head /> generates
the links for style.css and utils.js which is not valid,
i.e. the files are not found at the specified position
(after reviewing the generated HTML). A quick look shows
that styles.css is located under "/template/xhtml/styles.css"
and not under the generated "struts/xhtml/styles.css" .
I'm not sure if this is a bug or just something I messed up
or just if it's just a lack of knowledge on my side.
Please tell me if further information is needed.
Regards,
Stephan

Attachment:
user_204659.ezm (zipped)Did you go to the generated URL in the browser? The struts filter
recognizes certain URL patterns and will find the resources if they
are in your web-app or pull them from the jar files. Requests headed
for URLs like /web-app/struts/* are handled by the filter.
-Wes
On Thu, Jan 14, 2010 at 7:38 PM, Stephan R. Mueller
<stephanr.mueller@(protected):
> Hi list.
>
> Using 2.1.8 with JSP on JBoss 5.1.0. <s:head /> generates
> the links for style.css and utils.js which is not valid,
> i.e. the files are not found at the specified position
> (after reviewing the generated HTML). A quick look shows
> that styles.css is located under "/template/xhtml/styles.css"
> and not under the generated "struts/xhtml/styles.css" .
> I'm not sure if this is a bug or just something I messed up
> or just if it's just a lack of knowledge on my side.
> Please tell me if further information is needed.
>
> Regards,
> Stephan
>
> ---------------------------------------------------------------------
> 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_204653.ezm (zipped)I've been evaluating struts 2.1.8.1 and have found some troubling
performance bottlenecks relating to the struts tag and freemarker. I have a
JSP that has 7 struts2 tags in it. (A simple signup form)
I noticed in my load testing that the throughput of this page was 4-5 times
slower under load (100 concurrent threads) than a JSP page with no struts2
tags on it. I cracked open my profiler and noticed the majority of the time
spent in a page request was within freemarker. I uploaded a screen shot from
my profiler here : http://tinypic.com/r/20johet/6 . I've seen a lot of
discussion on the mailing lists about performance related issues and the
recommendations that came along with them to address it. I believe I've done
everything I can to tune this simple page. I would appreciate any feedback
if there is something I am missing. Or is this a known issue?
struts.xml:
<struts>
<!-- Constants -->
<constant name="struts.devMode" value="false" />
<constant name="struts.i18n.encoding" value="UTF-8" />
<constant name="struts.multipart.maxSize" value="2000000" />
<constant name="struts.ui.theme" value="css_xhtml" />
<constant name="struts.freemarker.templatesCache" value="true" />
<constant name="struts.ui.templateDir" value="template"/>
<constant name="struts.enable.SlashesInActionNames" value="true" />
<constant name="struts.convention.action.disableScanning" value="true" />
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.url.includeParams" value="all" />
<!-- Configuration for the default package. -->
<package name="default" extends="struts-default">
<result-types>
<result-type name="tiles" class="
org.apache.struts2.views.tiles.TilesResult"
/>
</result-types>
<interceptors>
<!-- Copied from struts-default.xml and changed validation exclude methods
-->
<interceptor-stack name="defaultStack">
<interceptor-ref name="exception" />
<interceptor-ref name="alias" />
<interceptor-ref name="servletConfig" />
<interceptor-ref name="prepare" />
<interceptor-ref name="chain" />
<interceptor-ref name="debugging" />
<interceptor-ref name="profiling" />
<interceptor-ref name="scopedModelDriven" />
<interceptor-ref name="modelDriven" />
<interceptor-ref name="fileUpload" />
<interceptor-ref name="checkbox" />
<interceptor-ref name="staticParams" />
<interceptor-ref name="params">
<param name="excludeParams">dojo\..*</param>
</interceptor-ref>
<interceptor-ref name="conversionError" />
<interceptor-ref name="validation">
<param name="excludeMethods">cancel,delete,list</param>
</interceptor-ref>
<interceptor-ref name="workflow">
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
</interceptor-stack>
<interceptor-stack name="fileUploadStack">
<interceptor-ref name="fileUpload" />
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<action name="new" class="testapp.CreateAccount" method="show">
<result name="input" type="tiles">account.create</result>
</action>
</package>
</struts>
JSP Page (snippet):
<s:form action="create" >
<fieldset>
<p><label>Name</label>
<s:textfield name="user.name" cssClass="txt-input small" />
<p><label>Email</label>
<s:textfield name="user.email" cssClass="txt-input small" />
<p><label>Site Address</label>
<s:textfield name="account.subDomain" cssClass="txt-input small" />
<p><label>Password</label>
<s:password name="user.password" cssClass="txt-input small" />
<p><label>Confirm Password</label>
<s:password name="user.passwordConfirm" cssClass="txt-input small" />
</fieldset>
<s:submit cssClass="button"/>
</s:form>

Attachment:
user_204654.ezm (zipped)I would expect that, FreeMarker templates(+ struts code) will always
be slower than java code. If you are using the simple tags, give a try
to the Java Tags:
http://cwiki.apache.org/S2PLUGINS/java-templates-plugin.html
musachy
On Thu, Jan 14, 2010 at 4:48 PM, Mark Greene <greenemj@(protected):
> I've been evaluating struts 2.1.8.1 and have found some troubling
> performance bottlenecks relating to the struts tag and freemarker. I have a
> JSP that has 7 struts2 tags in it. (A simple signup form)
>
> I noticed in my load testing that the throughput of this page was 4-5 times
> slower under load (100 concurrent threads) than a JSP page with no struts2
> tags on it. I cracked open my profiler and noticed the majority of the time
> spent in a page request was within freemarker. I uploaded a screen shot from
> my profiler here : http://tinypic.com/r/20johet/6 . I've seen a lot of
> discussion on the mailing lists about performance related issues and the
> recommendations that came along with them to address it. I believe I've done
> everything I can to tune this simple page. I would appreciate any feedback
> if there is something I am missing. Or is this a known issue?
>
> struts.xml:
> <struts>
> <!-- Constants -->
> <constant name="struts.devMode" value="false" />
> <constant name="struts.i18n.encoding" value="UTF-8" />
> <constant name="struts.multipart.maxSize" value="2000000" />
> <constant name="struts.ui.theme" value="css_xhtml" />
> <constant name="struts.freemarker.templatesCache" value="true" />
> <constant name="struts.ui.templateDir" value="template"/>
> <constant name="struts.enable.SlashesInActionNames" value="true" />
> <constant name="struts.convention.action.disableScanning" value="true" />
> <constant name="struts.enable.DynamicMethodInvocation" value="false" />
> <constant name="struts.url.includeParams" value="all" />
>
> <!-- Configuration for the default package. -->
> <package name="default" extends="struts-default">
> <result-types>
> <result-type name="tiles" class="
org.apache.struts2.views.tiles.TilesResult"
> />
> </result-types>
>
> <interceptors>
> <!-- Copied from struts-default.xml and changed validation exclude methods
> -->
> <interceptor-stack name="defaultStack">
> <interceptor-ref name="exception" />
> <interceptor-ref name="alias" />
> <interceptor-ref name="servletConfig" />
> <interceptor-ref name="prepare" />
> <interceptor-ref name="chain" />
> <interceptor-ref name="debugging" />
> <interceptor-ref name="profiling" />
> <interceptor-ref name="scopedModelDriven" />
> <interceptor-ref name="modelDriven" />
> <interceptor-ref name="fileUpload" />
> <interceptor-ref name="checkbox" />
> <interceptor-ref name="staticParams" />
> <interceptor-ref name="params">
> <param name="excludeParams">dojo\..*</param>
> </interceptor-ref>
> <interceptor-ref name="conversionError" />
> <interceptor-ref name="validation">
> <param name="excludeMethods">cancel,delete,list</param>
> </interceptor-ref>
> <interceptor-ref name="workflow">
> <param name="excludeMethods">input,back,cancel,browse</param>
> </interceptor-ref>
> </interceptor-stack>
> <interceptor-stack name="fileUploadStack">
> <interceptor-ref name="fileUpload" />
> <interceptor-ref name="defaultStack" />
> </interceptor-stack>
> </interceptors>
> <action name="new" class="testapp.CreateAccount" method="show">
> <result name="input" type="tiles">account.create</result>
> </action>
> </package>
> </struts>
>
>
>
> JSP Page (snippet):
> <s:form action="create" >
> <fieldset>
> <p><label>Name</label>
> <s:textfield name="user.name" cssClass="txt-input small" />
>
> <p><label>Email</label>
> <s:textfield name="user.email" cssClass="txt-input small" />
>
> <p><label>Site Address</label>
> <s:textfield name="account.subDomain" cssClass="txt-input small" />
>
> <p><label>Password</label>
>
>
> <s:password name="user.password" cssClass="txt-input small" />
>
> <p><label>Confirm Password</label>
> <s:password name="user.passwordConfirm" cssClass="txt-input small" />
> </fieldset>
>
> <s:submit cssClass="button"/>
> </s:form>
>

Attachment:
user_204657.ezm (zipped)
Hi
I'm having a problem trying to get the correct syntax for an OR test.
<s:if test="%{typeAsString=='BOOL'} || %{typeAsString=='ENUM'}"> selects
nothing, whereas
<s:if test="%{typeAsString=='BOOL'}"> selects values as expected as does
<s:if test="%{typeAsString=='ENUM'}">
Regards
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204658.ezm (zipped)remove the first } and second %{
On Fri, Jan 15, 2010 at 1:01 PM, RogerV <roger.varley@(protected):
>
> Hi
>
> I'm having a problem trying to get the correct syntax for an OR test.
>
> <s:if test="%{typeAsString=='BOOL'} || %{typeAsString=='ENUM'}"> selects
> nothing, whereas
> <s:if test="%{typeAsString=='BOOL'}"> selects values as expected as does
> <s:if test="%{typeAsString=='ENUM'}">
>
> Regards
> --
> View this message in context:
> http://old.nabble.com/Struts-2-%3Cs%3Aif-test-syntax-tp27173346p27173346.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)
>
>
--
Saeed Iqbal
Independant Consultant
J2EE - Application Architect / Developer

Attachment:
user_204660.ezm (zipped)I have a Flex app that is sending data to the server and I would like to
validate the Objects being passed on the server side. The Flex app passes
the information over an AMF channel and so it does not go through the
Struts2 framework.
So far, I have found classes such as:
com.opensymphony.xwork2.validator.validators.StringLengthFieldValidatorbut I get lost on what happens when I should call:
stringLengthFieldValidator.validate(myObject);
as it doesn't return anything and needs a non-null ValidatorContext - which
I don't know how to setup correctly.
Can anyone provide a link or advice on how to do this please?
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204661.ezm (zipped)Don't worry about this. It looks like the commons-validator will be fine and
I think thats what the struts2 framework uses underneath anyway.
doahh wrote:
>
> I have a Flex app that is sending data to the server and I would like to
> validate the Objects being passed on the server side. The Flex app passes
> the information over an AMF channel and so it does not go through the
> Struts2 framework.
>
> So far, I have found classes such as:
>
>
com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator>
> but I get lost on what happens when I should call:
>
> stringLengthFieldValidator.validate(myObject);
>
> as it doesn't return anything and needs a non-null ValidatorContext -
> which I don't know how to setup correctly.
>
> Can anyone provide a link or advice on how to do this please?
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204664.ezm (zipped)Before you tie yourself to commons-validator, take a look at Oval. I
could be wrong, but I think there is a bean validation JSR and Oval is
the reference implementation (or at least it is JSR compatible).
-Wes
On Fri, Jan 15, 2010 at 11:21 AM, doahh <gavin@(protected):
>
> Don't worry about this. It looks like the commons-validator will be fine and
> I think thats what the struts2 framework uses underneath anyway.
>
>
>
>
> doahh wrote:
>>
>> I have a Flex app that is sending data to the server and I would like to
>> validate the Objects being passed on the server side. The Flex app passes
>> the information over an AMF channel and so it does not go through the
>> Struts2 framework.
>>
>> So far, I have found classes such as:
>>
>>
com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator>>
>> but I get lost on what happens when I should call:
>>
>> stringLengthFieldValidator.validate(myObject);
>>
>> as it doesn't return anything and needs a non-null ValidatorContext -
>> which I don't know how to setup correctly.
>>
>> Can anyone provide a link or advice on how to do this please?
>>
>>
>
> --
> View this message in context: http://old.nabble.com/How-to-do-programatic-validation--tp27179164p27179568.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)
>
>
--
Wes Wannemacher
Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

Attachment:
user_204662.ezm (zipped)Hi Wes, thank you for the quick answer.
I should have known - it's working now. The problem
seems to be my web.xml. I wasn't using wildcard filtering
(<url-pattern>/*</url-pattern> - this works now) - I've
been mixing action and servlet (ControllerServlet) mapping
which led to an explicit URL-Pattern mapping for the filter.
That's probably why the styles.css URLs could not correctly
be mapped. So the paths generated were correct, but the path
wasn't mapped correctly as you suggested.
Please correct me if I'm wrong.
My bad and thanks again.
Regards,
Stephan
Am 15.01.2010 um 16:50 schrieb Wes Wannemacher:
> Did you go to the generated URL in the browser? The struts filter
> recognizes certain URL patterns and will find the resources if they
> are in your web-app or pull them from the jar files. Requests headed
> for URLs like /web-app/struts/* are handled by the filter.
>
> -Wes
>
> On Thu, Jan 14, 2010 at 7:38 PM, Stephan R. Mueller
> <stephanr.mueller@(protected):
>> Hi list.
>>
>> Using 2.1.8 with JSP on JBoss 5.1.0. <s:head /> generates
>> the links for style.css and utils.js which is not valid,
>> i.e. the files are not found at the specified position
>> (after reviewing the generated HTML). A quick look shows
>> that styles.css is located under "/template/xhtml/styles.css"
>> and not under the generated "struts/xhtml/styles.css" .
>> I'm not sure if this is a bug or just something I messed up
>> or just if it's just a lack of knowledge on my side.
>> Please tell me if further information is needed.
>>
>> Regards,
>> Stephan
>>
>> ---------------------------------------------------------------------
>> 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!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment:
user_204663.ezm (zipped)No, you are right. This topic comes up from time-to-time and it is
pretty safe to map the struts filter _only_ to /struts/* and *.action
(if you are using .action as your default extension). There are no
other magic <gr> urls.
-Wes
On Fri, Jan 15, 2010 at 12:06 PM, Stephan R. Mueller
<stephanr.mueller@(protected):
> Hi Wes, thank you for the quick answer.
> I should have known - it's working now. The problem
> seems to be my web.xml. I wasn't using wildcard filtering
> (<url-pattern>/*</url-pattern> - this works now) - I've
> been mixing action and servlet (ControllerServlet) mapping
> which led to an explicit URL-Pattern mapping for the filter.
> That's probably why the styles.css URLs could not correctly
> be mapped. So the paths generated were correct, but the path
> wasn't mapped correctly as you suggested.
> Please correct me if I'm wrong.
>
> My bad and thanks again.
>
> Regards,
> Stephan
>
>
> Am 15.01.2010 um 16:50 schrieb Wes Wannemacher:
>
>> Did you go to the generated URL in the browser? The struts filter
>> recognizes certain URL patterns and will find the resources if they
>> are in your web-app or pull them from the jar files. Requests headed
>> for URLs like /web-app/struts/* are handled by the filter.
>>
>> -Wes
>>
>> On Thu, Jan 14, 2010 at 7:38 PM, Stephan R. Mueller
>> <stephanr.mueller@(protected):
>>> Hi list.
>>>
>>> Using 2.1.8 with JSP on JBoss 5.1.0. <s:head /> generates
>>> the links for style.css and utils.js which is not valid,
>>> i.e. the files are not found at the specified position
>>> (after reviewing the generated HTML). A quick look shows
>>> that styles.css is located under "/template/xhtml/styles.css"
>>> and not under the generated "struts/xhtml/styles.css" .
>>> I'm not sure if this is a bug or just something I messed up
>>> or just if it's just a lack of knowledge on my side.
>>> Please tell me if further information is needed.
>>>
>>> Regards,
>>> Stephan
>>>
>>> ---------------------------------------------------------------------
>>> 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!
>>
>> ---------------------------------------------------------------------
>> 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_204665.ezm (zipped)
I was using Struts 2.1.6 along with XWork2 2.1.2. After finding a bug
with XWork2, it was recommended that this package be upgraded. As a
result, XWork2's later release depends on 2.1.8.1 of Struts2 and thus I
had to upgrade all my jars. Now web application no longer works.
When I navigate to my http://localhost:8080/myapp/ URL it sends me to
the welcome page like it always has. But when I submit the login form
that was presented, it goes to http://localhost:8080/myapp/login.do and
I get a 404 error saying the resource is not available.
I have double checked both STRUTS.XML and WEB.XML against the blank and
show case web apps from 2.1.8.1 and nothing out of the ordinary jumps
out that explains why all of a sudden I have problems.
Can anyone shed any light?

Attachment:
user_204666.ezm (zipped)You mention that you get a 404, a few questions...
First, does this 404 come from the struts filter or the application
server? When I am working, I can usually tell the difference because
404s coming from the struts filter generally indicate "Action" or
"Action Mapping" not found. In the even that the Application Server
throws up the 404, it will indicate that the "Resource" is not found.
Also, you said that the form is trying to hit login.do, do you have
".do" mapped as an extension in your struts.xml? I don't think it's
one of the defaults, the struts filter defaults to processing
.action,, which is .action extension and no extension.
-Wes
On Fri, Jan 15, 2010 at 12:51 PM, CRANFORD, CHRIS
<Chris.Cranford@(protected):
>
> I was using Struts 2.1.6 along with XWork2 2.1.2. After finding a bug
> with XWork2, it was recommended that this package be upgraded. As a
> result, XWork2's later release depends on 2.1.8.1 of Struts2 and thus I
> had to upgrade all my jars. Now web application no longer works.
>
> When I navigate to my http://localhost:8080/myapp/ URL it sends me to
> the welcome page like it always has. But when I submit the login form
> that was presented, it goes to http://localhost:8080/myapp/login.do and
> I get a 404 error saying the resource is not available.
>
> I have double checked both STRUTS.XML and WEB.XML against the blank and
> show case web apps from 2.1.8.1 and nothing out of the ordinary jumps
> out that explains why all of a sudden I have problems.
>
> Can anyone shed any light?
>
>
>
> ---------------------------------------------------------------------
> 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!