Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can anyone tell me how do we update the values in servlet?

 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have made a jsp....

this will make a dropdown box containing all my option values..
now i have to enter the date value whose option value has to be updated??
what code should i write in servlet so that it recognises that a particular option value has been passed??
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still no indentation?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get the option's request parameter and do something with it.

But as Bear said--if you insist on not indenting your code you'll find fewer and fewer people willing to help you. Please ShowSomeEffort, and take some time to make your posts as understandable as possible.
 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

in servlets i am writing...

request.getParameter("parameter");
but how do i retain the actual option value???

and how do i pass the selected value from jsp to servlets....how will it determine from the drop down box which value is selected?thanks in advance....
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maggie joseph wrote:in servlets i am writing...

request.getParameter("parameter");
but how do i retain the actual option value???


Assign it to a variable:

Or am I not understanding your question?
 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see i am doing this in my servlet...i am using request.get parameter("parameter");
but when i am selecting a particular option in jsp how do i write a code for that???and how do i send that in servlet??
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maggie joseph wrote: when i am selecting a particular option in jsp how do i write a code for that???and how do i send that in servlet??


you already post *the code*. by submitting you can send the selected value to a servlet. I am afraid, whether you aware about server and web deployment process ?
 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i am not aware of what you mentioned?
where can i get help about those topics??
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please read
Head.First.Servlets.and.JSP.
 
Samanthi perera
Ranch Hand
Posts: 510
 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this is my jsp code which is sending date ,option value and value to be updated..

in servlet i write....
is this the right way of getting the selected option value and the entered value to be updated?
thanks.......
thanks for the link..but I am running short of time...
 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey i am getting the parameter values and value passed in servlet....
but how do i write a logic to update the database values..
in my servlet i have written..
but i a not getting anything in the output....
 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i made changes in the code..i used .equals instead of == operator.....actually i have the book...i have not read much from it...well thanks for the link..now it seems that i need to really start reading...
 
Ketul Parikh
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Maggie,

You are Directly asking for logic for your simple code... Please Make Some Effort for your self..

Read the complete book suggested above..and I am sure you will not have any problems..


atleast for simple jsp and servlets for sure.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic