You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Stanley, Eric" <Er...@qwest.com> on 2008/06/06 00:01:42 UTC

Parameter question

All,
    In my app, I have this package/action defined:
 
<package name="data" extends="struts-default" namespace="/data">

<default-interceptor-ref name="paramsPrepareParamsStack" />

<action name="displayData" class="fm.gui.action.DataAction">

<result name="success">/pages/data/viewData.jsp</result>

<result name="error">/pages/error.jsp</result>

</action>

</package>

 

The problem is that as soon as its called, every subsequent action has a
bunch of parameters appended to it. This causes any other action to
fail. They fail because there is no object for the parameters to be
applied to, and rightfully so. I still dont completely grasp this
interceptor, and I think fixing this will help a lot as far as that
goes. Please let me know.

 
E. Ryan Stanley
Phone: 720.578.3703
Pager: 801.482.0172
<ma...@qwest.com>  
 


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.

Re: Parameter question

Posted by Lukasz Lenart <lu...@googlemail.com>.
Hi,

2008/6/9 Stanley, Eric <Er...@qwest.com>:

> Dave,
>        Thanks. So if I understand you, I can set all my url's that
> don't use params to excludeParams, but leave the ones that use params
> alone? Also, where do I set the constant? Im sure its just me, but this
> doesn't seem like a wise usage of params in S2. Why would it be
> beneficial to append any parameters that are not explicitly coded?
>

in struts.properties
struts.url.includeParams = none

in struts.xml
<constant name="struts.url.includeParams" value="none"/>

in web.xml
    <filter>
        <filter-name>struts</filter-name>

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
        <init-param>
            <param-name>struts.url.includeParams</param-name>
            <param-value>none</param-value>
        </init-param>
    </filter>


http://struts.apache.org/2.1.2/docs/constant-configuration.html


Regards
-- 
Lukasz
http://www.lenart.org.pl/

RE: Parameter question

Posted by "Stanley, Eric" <Er...@qwest.com>.
Dave,
	Thanks. So if I understand you, I can set all my url's that
don't use params to excludeParams, but leave the ones that use params
alone? Also, where do I set the constant? Im sure its just me, but this
doesn't seem like a wise usage of params in S2. Why would it be
beneficial to append any parameters that are not explicitly coded?

-Ryan 

-----Original Message-----
From: Dave Newton [mailto:newton.dave@yahoo.com] 
Sent: Monday, June 09, 2008 9:18 AM
To: Stanley, Eric
Subject: RE: Parameter question

Okay, then the rest of my reply is probably helpful :)

It can be configured as a constant or per-<s:url...> tag.

Dave


--- On Mon, 6/9/08, Stanley, Eric <Er...@qwest.com> wrote:

> From: Stanley, Eric <Er...@qwest.com>
> Subject: RE: Parameter question
> To: "Struts Users Mailing List" <us...@struts.apache.org>, 
> newton.dave@yahoo.com
> Date: Monday, June 9, 2008, 10:45 AM
> Dave,
> 	Thanks for the reply, and that is what I am talking about.
> I do
> append params to the action pointed to by a link. Its just that after 
> I have clicked that link with params, every subsequent request has 
> that same exact parameter appended. I need to stop this from 
> happening. That parameter should only apply to that action/link.
> 
> -Ryan
> 
> -----Original Message-----
> From: Dave Newton [mailto:newton.dave@yahoo.com]
> Sent: Thursday, June 05, 2008 7:15 PM
> To: Struts Users Mailing List
> Subject: Re: Parameter question
> 
> Are you talking about links to actions having parameters appended?
> 
> If so, are you either excluding parameters at each <s:url...> or, 
> alternatively, setting a default excludeParams via config?
> 
> Dave
> 
> --- On Thu, 6/5/08, Stanley, Eric
> <Er...@qwest.com> wrote:
> >     In my app, I have this package/action defined:
> >  
> > <package name="data"
> > extends="struts-default"
> > namespace="/data">
> > 
> > <default-interceptor-ref
> > name="paramsPrepareParamsStack" />
> > 
> > <action name="displayData"
> > class="fm.gui.action.DataAction">
> > 
> > <result
> >
> name="success">/pages/data/viewData.jsp</result>
> > 
> > <result
> >
> name="error">/pages/error.jsp</result>
> > 
> > </action>
> > 
> > </package>
> > 
> >  
> > 
> > The problem is that as soon as its called, every
> subsequent action has
> 
> > a bunch of parameters appended to it. This causes any
> other action to
> > fail. They fail because there is no object for the
> parameters to be
> > applied to, and rightfully so. I still dont completely
> grasp this
> > interceptor, and I think fixing this will help a lot
> as far as that
> > goes. Please let me know.
> > 
> >  
> > E. Ryan Stanley
> > Phone: 720.578.3703
> > Pager: 801.482.0172
> > <ma...@qwest.com>
> >  
> > 
> > 
> > This communication is the property of Qwest and may
> contain
> > confidential or privileged information. Unauthorized
> use of this
> > communication is strictly prohibited and may be
> unlawful.  If you have
> 
> > received this communication in error, please
> immediately notify the
> > sender by reply e-mail and destroy all copies of the
> communication and
> 
> > any attachments.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Parameter question

Posted by "Stanley, Eric" <Er...@qwest.com>.
Dave,
	Thanks for the reply, and that is what I am talking about. I do
append params to the action pointed to by a link. Its just that after I
have clicked that link with params, every subsequent request has that
same exact parameter appended. I need to stop this from happening. That
parameter should only apply to that action/link.

-Ryan 

-----Original Message-----
From: Dave Newton [mailto:newton.dave@yahoo.com] 
Sent: Thursday, June 05, 2008 7:15 PM
To: Struts Users Mailing List
Subject: Re: Parameter question

Are you talking about links to actions having parameters appended?

If so, are you either excluding parameters at each <s:url...> or,
alternatively, setting a default excludeParams via config?

Dave

--- On Thu, 6/5/08, Stanley, Eric <Er...@qwest.com> wrote:
>     In my app, I have this package/action defined:
>  
> <package name="data"
> extends="struts-default"
> namespace="/data">
> 
> <default-interceptor-ref
> name="paramsPrepareParamsStack" />
> 
> <action name="displayData"
> class="fm.gui.action.DataAction">
> 
> <result
> name="success">/pages/data/viewData.jsp</result>
> 
> <result
> name="error">/pages/error.jsp</result>
> 
> </action>
> 
> </package>
> 
>  
> 
> The problem is that as soon as its called, every subsequent action has

> a bunch of parameters appended to it. This causes any other action to 
> fail. They fail because there is no object for the parameters to be 
> applied to, and rightfully so. I still dont completely grasp this 
> interceptor, and I think fixing this will help a lot as far as that 
> goes. Please let me know.
> 
>  
> E. Ryan Stanley
> Phone: 720.578.3703
> Pager: 801.482.0172
> <ma...@qwest.com>
>  
> 
> 
> This communication is the property of Qwest and may contain 
> confidential or privileged information. Unauthorized use of this 
> communication is strictly prohibited and may be unlawful.  If you have

> received this communication in error, please immediately notify the 
> sender by reply e-mail and destroy all copies of the communication and

> any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Parameter question

Posted by Dave Newton <ne...@yahoo.com>.
Are you talking about links to actions having parameters appended?

If so, are you either excluding parameters at each <s:url...> or, alternatively, setting a default excludeParams via config?

Dave

--- On Thu, 6/5/08, Stanley, Eric <Er...@qwest.com> wrote:
>     In my app, I have this package/action defined:
>  
> <package name="data"
> extends="struts-default"
> namespace="/data">
> 
> <default-interceptor-ref
> name="paramsPrepareParamsStack" />
> 
> <action name="displayData"
> class="fm.gui.action.DataAction">
> 
> <result
> name="success">/pages/data/viewData.jsp</result>
> 
> <result
> name="error">/pages/error.jsp</result>
> 
> </action>
> 
> </package>
> 
>  
> 
> The problem is that as soon as its called, every subsequent
> action has a
> bunch of parameters appended to it. This causes any other
> action to
> fail. They fail because there is no object for the
> parameters to be
> applied to, and rightfully so. I still dont completely
> grasp this
> interceptor, and I think fixing this will help a lot as far
> as that
> goes. Please let me know.
> 
>  
> E. Ryan Stanley
> Phone: 720.578.3703
> Pager: 801.482.0172
> <ma...@qwest.com>  
>  
> 
> 
> This communication is the property of Qwest and may contain
> confidential or
> privileged information. Unauthorized use of this
> communication is strictly 
> prohibited and may be unlawful.  If you have received this
> communication 
> in error, please immediately notify the sender by reply
> e-mail and destroy 
> all copies of the communication and any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org