Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

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

 
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??
 
Marshal
Posts: 67366
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still no indentation?
 
Author
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....
 
Marshal
Posts: 25220
65
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??
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • 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??
 
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...
 
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.
 
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!