Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing methods from one servlet to another servlet

 
Vishwanath C Kagawade
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i am a new comer to the servlet programming so please help me any one, in method passing between two servlets.
Actualy i am traying to pass parameters from servlet1 to servlet2 and after adding some more information to the servet2,i want to send entire content back to servlet1 and i want display entire thing in servelet1.

thanks for every one for helping me,in advance!!!
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can send values across as request parameters / request attributes.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought I had replied to the exact same post, but it's gone
The poster's name was different though....

Anyway, same as Lynette
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you replied to a similar post in the JSP forum.
 
Vishwanath C Kagawade
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,Lynette Dawson for your replay!!!

i got your idea, but i am not able to implement that concept,can you able to replay me with sample code. so that i can impliment that get and set attribuet() methods in my coding.
Regard,
vishwanath
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this good enough?
http://www.rgagnon.com/javadetails/java-0401.html
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you replied to a similar post in the JSP forum

That was it My post isn't there though... Nevermind.
 
Vishwanath C Kagawade
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, Satou kurinosuke

you are replayed to another user but problem is quite similer, but it is diffrent. according to your solution: i can only send data/parameters from servlet1 to servlet2.
my pbroblem is i have to send some information from servlet1( suppose that contain user name and user address) to servlet2(which will take user name and address from servlet1),and servlet2 will add more information say user phone number and it will send user name ,address and number to servlet1
where i can display user all details.

in simple i can drow my transaction as:servlet1-servlet2-servlet1
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishwanath,
I'm really sorry to have disturbed your thread.
Please refer to Lynette's posts.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The logic is still the same. To communicate between two servlets, use request parameters or request attributes.

Try google, you should find plenty of tutorials for the same. If you are still struck, come back and post your code here. We would be able to help you out.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishwanath C N
Welcome to JavaRanch!

We're pleased to have you here with us in the servlets forum, but there
are a few rules that need to be followed, and one is that proper names are
required. Please take a look at the
JavaRanch Naming Policy and
adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here
[ August 10, 2006: Message edited by: Ben Souther ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic