• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still no indentation?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Sheriff
Posts: 28372
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no i am not aware of what you mentioned?
where can i get help about those topics??
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please read
Head.First.Servlets.and.JSP.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this may also help
http://courses.coreservlets.com/Course-Materials/csajsp2.html
 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic