You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Gordon <ad...@readytalk.com> on 2006/08/09 22:26:00 UTC

How to retrieve parameters off URL in JSP via Struts

Quick question:  Is there a way to retrieve a parameter off a URL via 
struts in a JSP?  I.e. if I have http://server.name/path/foo?mood=happy, 
is there a struts tag that I can use to get the value of "mood"?

Thanks,

-Adam

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


Re: How to retrieve parameters off URL in JSP via Struts

Posted by David Durham <dd...@vailsys.com>.
Adam Gordon wrote:
> Ahhhh, if only the taglib docs were documented in a more thorough 
> manner....
> 
> Since I wanted to render some Struts tags based on the presence of a 
> parameter, I discovered the "logic:present" element and used the 
> "parameter" attribute.  Hooray for me!

It's possible to use EL:

	${param.paramName}

So,

	<c:if test="${param.paramName != null}" />

But, that's not Struts.


-Dave

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


Re: How to retrieve parameters off URL in JSP via Struts

Posted by Adam Gordon <ad...@readytalk.com>.
Ahhhh, if only the taglib docs were documented in a more thorough manner....

Since I wanted to render some Struts tags based on the presence of a 
parameter, I discovered the "logic:present" element and used the 
"parameter" attribute.  Hooray for me!

-adam

Adam Gordon wrote:
> Quick question:  Is there a way to retrieve a parameter off a URL via 
> struts in a JSP?  I.e. if I have 
> http://server.name/path/foo?mood=happy, is there a struts tag that I 
> can use to get the value of "mood"?
>
> Thanks,
>
> -Adam
>
> ---------------------------------------------------------------------
> 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