Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 12 Aug 2010 16:23:25 -0000 Issue 9143

user-digest-help

2010-08-12


Author LoginPost 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)
I'm migrating a system from Velocity to Freemarker. I'd like to be able to include the result of a velocity template into the outer freemarker template while migrating, but cannot seem to use the <@(protected)

Is there any way that I can do something like

<h1>This is a FreeMarker template.</h1>
<@(protected)" />

Where the included page is processed by the appropriate servlet (ideally with access to the same ValueStack)?
Attached below is the stack trace when trying to use the directive from within a freemarker result.

Sincerely,

Roland

-----

freemarker.core.InvalidReferenceException: on line 29, column 1 in decorators/index.ftl include_page not found.
 freemarker.core.UnifiedCall.accept (UnifiedCall.java:134)
 freemarker.core.Environment.visit (Environment.java:210)
 freemarker.core.MixedContent.accept (MixedContent.java:92)
 freemarker.core.Environment.visit (Environment.java:210)
 freemarker.core.Environment.process (Environment.java:190)
 freemarker.template.Template.process (Template.java:237)
 org.apache.struts2.views.freemarker.FreemarkerResult.doExecute (FreemarkerResult.java:202)
 org.apache.struts2.dispatcher.StrutsResultSupport.execute (StrutsResultSupport.java:186)
 com.opensymphony.xwork2.DefaultActionInvocation.executeResult (DefaultActionInvocation.java:373)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:277)
 com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept (DefaultWorkflowInterceptor.java:176)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept (ValidationInterceptor.java:263)
 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept (AnnotationValidationInterceptor.java:68)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept (ConversionErrorInterceptor.java:133)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:207)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:207)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept (StaticParametersInterceptor.java:190)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 org.apache.struts2.interceptor.MultiselectInterceptor.intercept (MultiselectInterceptor.java:75)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 org.apache.struts2.interceptor.CheckboxInterceptor.intercept (CheckboxInterceptor.java:94)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 org.apache.struts2.interceptor.FileUploadInterceptor.intercept (FileUploadInterceptor.java:243)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept (ModelDrivenInterceptor.java:100)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept (ScopedModelDrivenInterceptor.java:141)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept (DebuggingInterceptor.java:267)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept (ChainingInterceptor.java:142)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept (PrepareInterceptor.java:166)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept (I18nInterceptor.java:176)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 org.apache.struts2.interceptor.ServletConfigInterceptor.intercept (ServletConfigInterceptor.java:164)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept (AliasInterceptor.java:190)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept (ExceptionMappingInterceptor.java:187)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:248)
 org.apache.struts2.impl.StrutsActionProxy.execute (StrutsActionProxy.java:52)
 org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:485)
 org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction (ExecuteOperations.java:77)
 org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter (StrutsExecuteFilter.java:88)
 com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent (SiteMeshFilter.java:129)
 com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter (SiteMeshFilter.java:77)
 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter (StrutsPrepareFilter.java:82)
 rss.web.filter.SignOnFilter.doFilter(SignOnFilter.java:280)
 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter (ReplyHeaderFilter.java:96)



©2008 gg3721.com - Jax Systems, LLC, U.S.A.