You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jose Luis Martinez Avial <jl...@pb-santander.com> on 2010/01/12 04:54:35 UTC

Distinguish between request parameters and struts.xml parameters in Struts2

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.


Re: Distinguish between request parameters and struts.xml parameters in Struts2

Posted by Musachy Barroso <mu...@gmail.com>.
well, I meant built in :)

On Wed, Jan 13, 2010 at 2:17 PM, Dale Newfield <da...@newfield.org> wrote:
> 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@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: Distinguish between request parameters and struts.xml parameters in Struts2

Posted by Dale Newfield <da...@newfield.org>.
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@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Distinguish between request parameters and struts.xml parameters in Struts2

Posted by Musachy Barroso <mu...@gmail.com>.
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
<jl...@pb-santander.com> wrote:
> 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.
>
>

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