You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Aruna Ponaka <ar...@gmail.com> on 2010/01/11 21:26:55 UTC

How to use tag

I need to pass a parameter from JSP to Action class in a struts 2 project.

In the JSp , I have
id=1;
<s:url action= <s:param name="id" value="%{id}" /></s:url>

The ImageAction class has getId and setId method. The id value is set when I
pass the integer directly in JSP, i.e.  <s:url action= <s:param name="id"
value="1" /></s:url>

but when I provide value=%{id}, it is not set, what is the correct syntax to
provide in the VALUE?


-- 
View this message in context: http://old.nabble.com/How-to-use-%3Cs%3Aparam%3E-tag-tp27117122p27117122.html
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: How to use tag

Posted by Aruna Ponaka <ar...@gmail.com>.
I am retrieving images from Action class onto jsp using
img src="<s:url action="imgAction">></img>

I have to pass imageid, which should be used in the Action class to return a
particular book. I am able to retrieve images but not able to pass this
value to Action class. How can I achieve this?I do not have any forms in my
JSP.
-- 
View this message in context: http://old.nabble.com/How-to-use-%3Cs%3Aparam%3E-tag-tp27117122p27131980.html
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: How to use tag

Posted by Aruna Ponaka <ar...@gmail.com>.

I have seen this syntax, I am not sure how to use it for my purpose. I get
id's from an sql query. I am retrieving them in a list and need to pass them
one by one to the action class. How to set them so that I can pass them as
params to the Action class? Also my code is like
<s:url action= <s:param name="id" value="16"></s:param></s:url>"
style="margin-right:20px;"  />..
If i provide 
<s:url id="img" action="imgAction">, it is not going to the Action class.


-- 
View this message in context: http://old.nabble.com/How-to-use-%3Cs%3Aparam%3E-tag-tp27117122p27127855.html
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: How to use tag

Posted by wild_oscar <mi...@almeida.at>.
        <s:url id="url" action="HelloWorld">
            <s:param name="request_locale">en</s:param>
        </s:url>
        <s:a href="%{url}">English</s:a>

Aruna Ponaka wrote:
> 
> what is the correct syntax to provide in the VALUE?
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-use-%3Cs%3Aparam%3E-tag-tp27117122p27125733.html
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