File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to assign these 3 values to form bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to assign these 3 values to form bean" Watch "How to assign these 3 values to form bean" New topic
Author

How to assign these 3 values to form bean

S Venkatesh
Ranch Hand

Joined: Jun 27, 2005
Posts: 464

I have a HTML page with 3 text boxes with same name.
Now i want to know how struts Framework handles this case and how i can retrive all the 3 values?

Code snippet of the JSP with the text boxes is as follows.

<html:form action=�someURL�>
<html:text property=�myTextBox� value=�1�>
<html:text property=�myTextBox� value=�2�>
<html:text property=�myTextBox� value=�3�>
<html:submit name=�submit� value=�submit�>
</html:form>

In the normal case we will use following stmt to get above 3 values(in case we are reading values in a servlet).
String myTextBox[]=request.getParameterValues(�myTextBox�);

How form bean maintains these 3 values automatically?

Thanks
Venkatesh S
[ March 09, 2006: Message edited by: Venkatesh Sai ]
Mishra Anshu
Ranch Hand

Joined: Sep 16, 2003
Posts: 224
Here is a way out :-
this


"Ignorance is bliss"
 
wood burning stoves
 
subject: How to assign these 3 values to form bean
 
Similar Threads
Problem Passing Parameter values to action
problem while seting properties of beans in collections in formulat
Can we send multiple textfield of same type in struts
Wanting to Displaying Empty Data on Initial Search Page
Wanting to Displaying Empty Data on Initial Search Page