This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
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

Accessing servlet

 
Rajaguru Ramalingam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i access a servlet which is in different servletcontext or webapplication? can anyone explain me the process?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Access it from where?
A browser?
If so, a simple hyperlink (with a fully qualified URL) will do it.
 
Rajaguru Ramalingam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i access a servlet from another servlet which is part of another web application or servlet context....?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rajaguru Ramalingam:
How can i access a servlet from another servlet which is part of another web application or servlet context....?


You can do it with JSTL in your JSP. Couldn't think of anyother.

Neither httpServletResponse.sendRedirect() works, nor these requestDispatcher.include()
requestDispatcher.forward()
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rajaguru Ramalingam:
How can i access a servlet from another servlet which is part of another web application or servlet context....?


You're still not asking a clear question.
Maybe if you tell us what you're trying to do it would help.

-Ben
 
Craig Jackson
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if this is the answer to the question
How can i access a servlet which is in different servletcontext or webapplication? can anyone explain me the process?


But the method from the ServletContext interface will allow you to return the servletcontext from another web application.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic