Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

servlet calling another servlet (SSL)  RSS feed

 
Neil Goldsmith
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a servlet that invokes another servlet that runs within Tomcat on the same system:


In short, the call to invoke the other servlet would look like this:
http://myserver:8080/anotherServlet/theMethod

We are now allowing our apps to run under SSL control. However, the calling servlet and the called servlet may or may not be under SSL control. If for instance, the called servlet is under SSL control, the call to invoke it would look like this:
https://myserver:8443/anotherServlet/theMethod

Both the text "https" and the port have to change to properly invoke it.

My question, is there a way to programmatically query to find out if another servlet is under SSL control and to find what port to use? 8443 is the default port in TC, but it can be changed. How would the caller know that?

thanks
[ October 21, 2005: Message edited by: Neil Goldsmith ]
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From your code, it looks like you are trying to include the content generated from another servlet resides in the same system.

Use RequestDispatcher.include instead.
 
Neil Goldsmith
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first servlet needs to get the data back from the called servlet in the reqID variable as shown in the code. If I use the include call, can the first servlet parse the response from the called servlet? How does it do that?

thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!