• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to call one servlet from other servlet

 
jaspal singh
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is one servlet runnin in the application which gets some data and
send to another servlet to process it and return that data back.

so how do i do this...


thanxz in advance





[BS: removed "urgent" from the subject]
[ January 17, 2006: Message edited by: Ben Souther ]
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can make use of ServletRequestDispatcher to forward request to the 2nd servlet.
http://home.earthlink.net/~alxdark/software/wcd-guide/ch01s06.html
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jaspal,

Please read the following page to find out why putting "urgent" in your subject heading will actually slow down responses to your question:
http://faq.javaranch.com/view?EaseUp
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A better design might be to refactor the other servlet so that you can instantiate it as a class, and then call the methods of that class, instead of trying to pass parameters and get results the HTTP way, when it is should be a local call.
 
jaspal singh
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read the following page to find out why putting "urgent" in your subject heading will actually slow down responses to your question:


oh! big sorry for that.

thanx for getting me aware of the fact.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic