<s:iterator value="categoryList">
<s:url id="category" action="/editProduct.action"/>
<s:a href="%{category}">
<s:property value="name"/>
</s:a>
<s:hidden name = "categoryId" id = "categoryId" value = "<s:property value='name'/" />
</s:iterator
Problem:
I have a list of categories which are click able. Every category has a unique ID. Problem is that when user click on the category from list then categoryId will pass in editProduct action class
I am searching its solution from two days please help me and define the complete solution
You can’t nest JSP tags like that.
This, however, makes no sense–if it’s not a form, why would you put the
categoryIdinto a hidden form field? You’re not submitting a form, you’re clicking a link.Put the
categoryIdinto the URL as a parameter.Note that unless “name” is actually something very ID-like, it’s probably a bad idea to use it as a primary key.
You may want to go over some HTML and web app basics before proceeding too much further; it will save you time in the long run.