Author Login
Post Reply
user Digest 12 Aug 2010 16:23:25 -0000 Issue 9143
Topics (messages 207164 through 207174):
WARS Architecture
207164 by: Frans Thamura
how to remove .action suffix in struts 2.1
207165 by: Supratim Bandyopadhyaya
207166 by: Rakeshkumar Parmar
207167 by: Dave Newton
How do we repopulate controls when validation fails?
207168 by: Franz Wong
207169 by: Alex Rodriguez Lopez
207173 by: Franz Wong
[S2] validation short-circuit
207170 by: mailtolouis2020-struts.yahoo.com
Re: Re : s:url tag - multiple params with same name
207171 by: Zoran Avtarovski
207172 by: Dave Newton
Including a Velocity page inside a FreeMarker template?
207174 by: java.rgm.spamgourmet.com
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_207164.ezm (zipped)any idea to make Struts2 work with WARS , a enhanced version of MVC
http://www.theserverside.com/news/thread.tss?thread_id=23625
--
Frans Thamura
Director
Meruvian.
The Most Complete Java Services Provider in Indonesia
Mobile: +6287885901958
Blog & Profile: http://frans.thamura.info
We grow because we share the same belief.

Attachment:
user_207165.ezm (zipped)Hi all,
I need to remove the .action suffix associated with the actions.
Please advise how to do this.
Thanks and regards,
Supratim

Attachment:
user_207166.ezm (zipped)Hi,
You can find it in struts-default.properties file.
struts.action.extension=action
create struts.properties file in /WEB-INF/class and provide no extension. That should work for you.
regards,
Rakesh
-----Original Message-----
From: Supratim Bandyopadhyaya [mailto:mail.supratim@(protected)]
Sent: Wednesday, August 11, 2010 2:58 PM
To: Struts Users Mailing List
Subject: how to remove .action suffix in struts 2.1
Hi all,
I need to remove the .action suffix associated with the actions.
Please advise how to do this.
Thanks and regards,
Supratim
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

Attachment:
user_207167.ezm (zipped)(Although XML configuration is really the preferred mechanism.)
Dave
On Wed, Aug 11, 2010 at 7:19 AM, Rakeshkumar Parmar <
rakeshkumar_parmar@(protected):
> Hi,
>
> You can find it in struts-default.properties file.
> struts.action.extension=action
>
> create struts.properties file in /WEB-INF/class and provide no extension.
> That should work for you.
>
> regards,
> Rakesh
>
> -----Original Message-----
> From: Supratim Bandyopadhyaya [mailto:mail.supratim@(protected)]
> Sent: Wednesday, August 11, 2010 2:58 PM
> To: Struts Users Mailing List
> Subject: how to remove .action suffix in struts 2.1
>
> Hi all,
> I need to remove the .action suffix associated with the actions.
> Please advise how to do this.
> Thanks and regards,
> Supratim
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is
> the property of Persistent Systems Ltd. It is intended only for the use of
> the individual or entity to which it is addressed. If you are not the
> intended recipient, you are not authorized to read, retain, copy, print,
> distribute or use this message. If you have received this communication in
> error, please notify the sender and delete all copies of this message.
> Persistent Systems Ltd. does not accept any liability for virus infected
> mails.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_207168.ezm (zipped)Hi,
I have read the documentation "How do we repopulate controls when validation
fails" [1]. I tried the action tag solution. However, when there is a
validation error, the execute method of the action in <s:action> is not
called.
I don't choose the Preparable solution because the parameter required is not
ready in the Prepare stage. (For the first time of visit, the parameter is
set to default.) And I don't want to call the preparation twice in both
execute and prepare. So what is the best way to repopulate controls for
normal case and revisit after validation error? Should I abandon to validate
the input in validate method?
Thanks.
Franz
[1]
http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html

Attachment:
user_207169.ezm (zipped)Don't know if this solves your problem, but maybe it helps to use the
params-prepare-params trick, calling params interceptor twice, so you
have your params ready before prepare().
You have an already configured stack, the paramsPrepareParamsStack
From struts-default.xml:
<!-- An example of the paramsPrepareParams trick. This stack
is exactly the same as the defaultStack, except that it
includes one extra interceptor before the prepare
interceptor:
the params interceptor.
This is useful for when you wish to apply parameters
directly
to an object that you wish to load externally (such as
a DAO
or database or service layer), but can't load that object
until at least the ID parameter has been loaded. By
loading
the parameters twice, you can retrieve the object in the
prepare() method, allowing the second params
interceptor to
apply the values on the object. -->
<interceptor-stack name="paramsPrepareParamsStack">
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="i18n"/>
<interceptor-ref name="checkbox"/>
<interceptor-ref name="multiselect"/>
<interceptor-ref name="params">
<param
name="excludeParams">dojo\..*,^struts\..*</param>
</interceptor-ref>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="chain"/>
<interceptor-ref name="modelDriven"/>
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="staticParams"/>
<interceptor-ref name="actionMappingParams"/>
<interceptor-ref name="params">
<param
name="excludeParams">dojo\..*,^struts\..*</param>
</interceptor-ref>
<interceptor-ref name="conversionError"/>
<interceptor-ref name="validation">
<param
name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
<interceptor-ref name="workflow">
<param
name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
</interceptor-stack>
> Hi,
>
> I have read the documentation "How do we repopulate controls when validation
> fails" [1]. I tried the action tag solution. However, when there is a
> validation error, the execute method of the action in<s:action> is not
> called.
>
> I don't choose the Preparable solution because the parameter required is not
> ready in the Prepare stage. (For the first time of visit, the parameter is
> set to default.) And I don't want to call the preparation twice in both
> execute and prepare. So what is the best way to repopulate controls for
> normal case and revisit after validation error? Should I abandon to validate
> the input in validate method?
>
> Thanks.
> Franz
>
> [1]
> http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html
>

Attachment:
user_207173.ezm (zipped)Thanks. It solves my problem :)
Franz
On Wed, Aug 11, 2010 at 10:11 PM, Alex Rodriguez Lopez <
alopez@(protected):
> Don't know if this solves your problem, but maybe it helps to use the
> params-prepare-params trick, calling params interceptor twice, so you have
> your params ready before prepare().
>
> You have an already configured stack, the paramsPrepareParamsStack
>
> From struts-default.xml:
>
> <!-- An example of the paramsPrepareParams trick. This stack
> is exactly the same as the defaultStack, except that it
> includes one extra interceptor before the prepare
> interceptor:
> the params interceptor.
>
> This is useful for when you wish to apply parameters
> directly
> to an object that you wish to load externally (such as a
> DAO
> or database or service layer), but can't load that object
> until at least the ID parameter has been loaded. By loading
> the parameters twice, you can retrieve the object in the
> prepare() method, allowing the second params interceptor to
> apply the values on the object. -->
> <interceptor-stack name="paramsPrepareParamsStack">
> <interceptor-ref name="exception"/>
> <interceptor-ref name="alias"/>
> <interceptor-ref name="i18n"/>
> <interceptor-ref name="checkbox"/>
> <interceptor-ref name="multiselect"/>
> <interceptor-ref name="params">
> <param name="excludeParams">dojo\..*,^struts\..*</param>
> </interceptor-ref>
> <interceptor-ref name="servletConfig"/>
> <interceptor-ref name="prepare"/>
> <interceptor-ref name="chain"/>
> <interceptor-ref name="modelDriven"/>
> <interceptor-ref name="fileUpload"/>
> <interceptor-ref name="staticParams"/>
> <interceptor-ref name="actionMappingParams"/>
> <interceptor-ref name="params">
> <param name="excludeParams">dojo\..*,^struts\..*</param>
> </interceptor-ref>
> <interceptor-ref name="conversionError"/>
> <interceptor-ref name="validation">
> <param
> name="excludeMethods">input,back,cancel,browse</param>
> </interceptor-ref>
> <interceptor-ref name="workflow">
> <param
> name="excludeMethods">input,back,cancel,browse</param>
> </interceptor-ref>
> </interceptor-stack>
>
>
>
> Hi,
>>
>> I have read the documentation "How do we repopulate controls when
>> validation
>> fails" [1]. I tried the action tag solution. However, when there is a
>> validation error, the execute method of the action in<s:action> is not
>> called.
>>
>> I don't choose the Preparable solution because the parameter required is
>> not
>> ready in the Prepare stage. (For the first time of visit, the parameter is
>> set to default.) And I don't want to call the preparation twice in both
>> execute and prepare. So what is the best way to repopulate controls for
>> normal case and revisit after validation error? Should I abandon to
>> validate
>> the input in validate method?
>>
>> Thanks.
>> Franz
>>
>> [1]
>>
>> http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_207170.ezm (zipped)Hi,
In the validation, short-circuit is for when the validation failed, the
following not get rules not get evaluate.
Is there anything similar like this, but when one field validation pass, the
rest no need to get evaluate?
Regards
LV

Attachment:
user_207171.ezm (zipped)I haven¹t tried it but I suspect that if you use a list it should work.
Something like this:
<s:url id="xurl" value="a.b" includeParams="get" escapeAmp="false">
<s:param name="pn" value="'#{firstval¹,¹secondVal¹,¹thirdVal¹}'" />
</s:url>
Z.
>
> On Fri, 06 Aug 2010 17:12:10 -0400, François Rouxel <rouxelec@(protected)>
> wrote:
>
>> > should be working, did you put in s:url tag includeParameters='get' ?
>> >
>
> Yes, although I don't think that's what includeParams is used for - here's
> my actual code:
>
> <s:url id="xurl" value="a.b" includeParams="get" escapeAmp="false">
> <s:param name="pn" value="'firstval'" />
> <s:param name="pn" value="'secondval'" />
> <s:param name="pn" value="'thirdval'" />
> </s:url>
>
> URL 1: <s:property value="xurl"/>
>
>
> and here's the result:
>
> URL 1: a.b?pn=thirdval
>
> I'm using Struts 2.0.11
>
> Steve

Attachment:
user_207172.ezm (zipped)Well, the OP said it did in the post you replied to, so I bet you're right!
On Wed, Aug 11, 2010 at 8:11 PM, Zoran Avtarovski
<zoran@(protected):
> I haven¹t tried it but I suspect that if you use a list it should work.
>
> Something like this:
> <s:url id="xurl" value="a.b" includeParams="get" escapeAmp="false">
> <s:param name="pn" value="'#{Œfirstval¹,¹secondVal¹,¹thirdVal¹}'" />
> </s:url>
>
>
> Z.
>
> >
> > On Fri, 06 Aug 2010 17:12:10 -0400, François Rouxel <rouxelec@(protected)>
> > wrote:
> >
> >> > should be working, did you put in s:url tag includeParameters='get' ?
> >> >
> >
> > Yes, although I don't think that's what includeParams is used for -
> here's
> > my actual code:
> >
> > <s:url id="xurl" value="a.b" includeParams="get" escapeAmp="false">
> > <s:param name="pn" value="'firstval'" />
> > <s:param name="pn" value="'secondval'" />
> > <s:param name="pn" value="'thirdval'" />
> > </s:url>
> >
> > URL 1: <s:property value="xurl"/>
> >
> >
> > and here's the result:
> >
> > URL 1: a.b?pn=thirdval
> >
> > I'm using Struts 2.0.11
> >
> > Steve
>
>

Attachment:
user_207174.ezm (zipped)