Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 - Set Action Attribute From Jsp

 
Ceku Camli
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm new to struts.
I want to complete information in a few steps. In the first step, i create a person with an id. In the second step, i have text fields and a submit button. In my action class I have an "id" attribute but can't set it.

Here is the jsp code:





How i can fix it?

Thanks!
 
Ankit Garg
Sheriff
Posts: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my action class I have an "id" attribute but can't set it.

I don't understand this statement. When you submit the form, is the id property of your action not set to the value you you give in s:param tag?? I'm not really sure if you can use s:param tag in s:form tag. If you don't want the id value to be visible to the user, then you can use s:hidden tag...
 
Ceku Camli
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Garg wrote:
In my action class I have an "id" attribute but can't set it.

I don't understand this statement. When you submit the form, is the id property of your action not set to the value you you give in s:param tag?? I'm not really sure if you can use s:param tag in s:form tag. If you don't want the id value to be visible to the user, then you can use s:hidden tag...



In the s:form, the s:param tag does not work (unlike the s:url tag ). I was unaware of the s:hidden tag. I'll just try it.
 
Ceku Camli
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ankit

Unfortunately, the property tag can not be nested in the hidden tag:

 
Ceku Camli
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ceku Camli wrote:@Ankit

Unfortunately, the property tag can not be nested in the hidden tag:



@myself,
try the OGNL!

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic