This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet tricks me