wood burning stoves 2.0*
The moose likes Servlets and the fly likes Servlet tricks me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet tricks me" Watch "Servlet tricks me" New topic
Author

Servlet tricks me

Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

I have a servlet file in which i get the values from JSP page and insert them to DB. My problem is the data's in textfield of JSP seems to be tricks me accordingly the Servlet code i put..

: EDITED :


Never try to be a hard-worker. Be a smart-worker.
My Blog
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Originally posted by Rajkumar balakrishnan:
If i write my code like this...




ofcourse.. you are forwarding request to vendorcp.jsp then you set the value in request.. so , how you will get the value in next page?
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

Friend.. then what should i do in order to refresh the page after the DB function finished... Please let me know...
Matteo Di Furia
Ranch Hand

Joined: Jun 20, 2008
Posts: 102
What do you want to be displayed after the DB has been updated ?
A new blank form ? Then



should work (assuming vendorcp.jsp is the form jsp which displays blank if no params are set in request).
Else, forward to a message JSP in which you inform of the successfull DB update.
[ September 24, 2008: Message edited by: Matteo Di Furia ]
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

Originally posted by Matteo Di Furia:
What do you want to be displayed after the DB has been updated ?
A new blank form ? Then



should work (assuming vendorcp.jsp is the form jsp which displays blank if no params are set in request).
Else, forward to a message JSP in which you inform of the successfull DB update.

[ September 24, 2008: Message edited by: Matteo Di Furia ]


But i need the request Attribute to set the object name to display a message like Data added to the vendorcp.jsp, along with blank jsp page...
I currently use ${n.result} to display that. So i need req.setAttribute("n",n/*This n is used to call result method where i have a string with value as Data added*/);

Is there other ways to accomplish that?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Servlet tricks me
 
Similar Threads
JSP/Servlet against other framework (Wicket, Struts2, SpringMVC/Webflow, Click, JSF)
byte[] Image in jsp
Serverlet/JSP
how to connect Jsp to servlet to process parameters
JSP & Servlet