| Author |
convert struts form value to an integer value
|
Kim Kantola
Ranch Hand
Joined: May 17, 2001
Posts: 274
|
|
Hi Gang, I am trying to do the following within a jsp page: 1. get a String value from a struts form 2. convert the String to an int value 3. Use the int to construct a new object within a scriptlet. Here is my code, can anyone tell me a way to make this work? Thanks so much in advance.
|
 |
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4725
|
|
|
|
A good workman is known by his tools.
|
 |
Kim Kantola
Ranch Hand
Joined: May 17, 2001
Posts: 274
|
|
Thank you so much Marc. If you reference the Struts form with a <jsp:useBean> tag, can you use the form name directly without getting it from the session like this? <jsp:useBean id="ResourceEditForm" class="com.bitpipe.bpES.struts.form.ResourceEditForm" /> User user = new User(Integer.parseInt(ResourceEditForm.getUserId()));
|
 |
 |
|
|
subject: convert struts form value to an integer value
|
|
|