• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hidden Field in JSP and Java Bean

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am passing a hidden field from my JSP:

to my java bean. Is the property "parent" a String in the java bean even the value of that property is intended to be and assigned a primitive int?
 
Tim Baker
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If that is supposed to be a hidden FORM Input field then yes it will come through as a string, just as all parameters will do.
In your code that deals with the parameters you just use Integer.parseInt
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!