File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes can anyone tell me how do we update the values in servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "can anyone tell me how do we update the values in servlet?" Watch "can anyone tell me how do we update the values in servlet?" New topic
Author

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

maggie karve
Ranch Hand

Joined: Dec 29, 2009
Posts: 186
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

Joined: Jan 10, 2002
Posts: 61437
    
  67

Still no indentation?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Dec 29, 2009
Posts: 186

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
Bartender

Joined: Oct 14, 2005
Posts: 18672
    
    8

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

Joined: Dec 29, 2009
Posts: 186
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

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Dec 29, 2009
Posts: 186
no i am not aware of what you mentioned?
where can i get help about those topics??
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
please read
Head.First.Servlets.and.JSP.
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
this may also help
http://courses.coreservlets.com/Course-Materials/csajsp2.html
maggie karve
Ranch Hand

Joined: Dec 29, 2009
Posts: 186


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

Joined: Dec 29, 2009
Posts: 186
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

Joined: Dec 29, 2009
Posts: 186
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

Joined: Jul 17, 2009
Posts: 14
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.


KETUL
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can anyone tell me how do we update the values in servlet?