Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlets/jsp

 
sri chinta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The user enters some values on a JSP .There are some radio buttons on the JSP to be selected by the user. Then i want the Servlet to perform the calculation according to the option selected for example: say i gave ADD button in my JSP then servlet should perform it and send the results back to the same JSP and display the result.Thank u for seeing and any help will be highly appreciated.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, there are your requirements.
What have you got so far?
What part are you stuck on?
 
sri chinta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok....my i built my jsp page witht the following code.After values of A &B are given i wanted to know how should the operation for a particular selection of radio button (selected in jsp)be performed in servlet so that result is sent back to jsp.


[Code tags added]
[ August 30, 2005: Message edited by: David O'Meara ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your servlet's doPost method:
 
sri chinta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u...i do really appreciate your help
 
Anoop Kavalloor
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly u need to put your questions in the right format.
Alright try this out. Instead of keeping all the fields hidden (which wont help your cause anyways), you should keep just one field hidden. On the click of the respective button, say add button, use javascipt to populate the hidden field. Also use javascript to submit your form. This way your servlet will get the parameter and can take further course of action according to the action.
Hope this helps you.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Unqualified Genius",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender

P.S. You would think that an "unqualified genius" would know how to spell "you".
[ August 31, 2005: Message edited by: Bear Bibeault ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic