You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by GEDA <ge...@romtelecom.ro> on 2007/06/07 09:12:45 UTC

Newbie: How can I get the param values from an url ?

Hi. I am a struts newbie and I would really like to know how can I get the
parameters values from an action url sent to a div tag. To be more explicit
here is the jsp code:

        <s:url id="lu" action="lista.do">
            <s:param name="cauta" value="geo" />
        </s:url>
        
        <s:div id="listauseri" theme="ajax" href="%{lu}"
listenTopics="/refreshlista" loadingText="Loading list of the users ..." />

I want to get the value of the param "cauta" from the action class that's
being loaded by the div tag.

Thanks in advance.
-- 
View this message in context: http://www.nabble.com/Newbie%3A-How-can-I-get-the-param-values-from-an-url---tf3882218.html#a11003073
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Newbie: How can I get the param values from an url ?

Posted by RobinCamus <rc...@docsea.com>.
You can just make getters and setters with parameters names in the action
class.


GEDA wrote:
> 
> Actually I am quite sorry for not digging the answer in the forum archive.
> Anyway here is a quote of the correct answer:
> 
> So I've finally found out how it can be done. Through action context I can
> get
> value stack and find any possible value being already there.
> 
> ActionContext.getContext().getValueStack().findValue("valuename");
> 
> Not exactly nice as the parameter is not pushed to the action by the
> caller
> but the action must dig on the value stack for it, but at least it
> works... 
> 

-- 
View this message in context: http://www.nabble.com/Newbie%3A-How-can-I-get-the-param-values-from-an-url---tf3882218.html#a11005996
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Newbie: How can I get the param values from an url ?

Posted by GEDA <ge...@romtelecom.ro>.
Actually I am quite sorry for not digging the answer in the forum archive.
Anyway here is a quote of the correct answer:

So I've finally found out how it can be done. Through action context I can
get
value stack and find any possible value being already there.

ActionContext.getContext().getValueStack().findValue("valuename");

Not exactly nice as the parameter is not pushed to the action by the caller
but the action must dig on the value stack for it, but at least it works... 
-- 
View this message in context: http://www.nabble.com/Newbie%3A-How-can-I-get-the-param-values-from-an-url---tf3882218.html#a11004562
Sent from the Struts - User mailing list archive at Nabble.com.


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