File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Jsp with multiple user attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp with multiple user attributes" Watch "Jsp with multiple user attributes" New topic

Jsp with multiple user attributes

Deepak Naithani

Joined: Aug 30, 2012
Posts: 25
i'm doing simple JSP program for taking user input and producing output the same way data was entered.

I'm creating method for taking the input but it is not working properly (set and get method in JSP). I've read that we have to make method name such that it should match the name property of input type like

In JSP file<br>
<input type="text" name="userName" />

In java file

for one input i can do it but but for multiple input like name , number , age, etc i am not getting it done correctly help me for this.

Kathleen Angeles
Ranch Hand

Joined: Aug 06, 2012
Posts: 123

Can you show us the entire class?

By the way, if the field is userName, the method should be setUserName, not setuserName.
Deepak Naithani

Joined: Aug 30, 2012
Posts: 25
I have solved the problem.

I was only asking for this thing and also for multiple attribute there should be a getter and setter method.
Ashwini Kashyap
Ranch Hand

Joined: Aug 30, 2012
Posts: 90
For this, you can make use of JSP tags like :

Also, make use of camel casing
public void setuserName(String name){}

It should be like:
public void setUserName(String name){}

See some examples of JSP, Servlet and Java Beans.

Ashwini Kashyap |

I agree. Here's the link:
subject: Jsp with multiple user attributes
jQuery in Action, 3rd edition