Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirect jsp to a private IP 192.168.1.44

 
Vince Hon
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I have 2 tomcat engines on 2 separate computers, A, and B.
A and B are on the same network.
"A" is published to the Internet, it has public IP.
"B" is not published,, it has a private IP 192.168.1.44.
Machine "A" , getInput.jsp will get user input from the internet and then
pass the parameters to machine "B", process.jsp to process the data.
I would like to know how "A" can send the parameter to "B" ?
Since <jsp:forward> can only be used under the same Context, I cannot use
<jsp:forward page="http://192.168.1.44/process.jsp"> in getInput.jsp.
Also, if I use response.sendRedirect("http://192.168.1.44/process.jsp") in getInput.jsp, since the user on the internet cannot access 192.168.1.44, this method also failed.
Are there any solution to do the internal redirect ?
Thanks
Vince
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to get machine A to perform its own HTTP connection to machine B and then react depending on the response from B. the problem with sendRedirect is it asks the client to reissue a request to the specified machine. Since the client can't see machine B this won't work.
Machine A is the only one that can see machine B, it will have to make the request.
A Http request may not be the best option though. You could try something like running an EJB container on B and making a remote EJB call instead. It would be harder to configure, but much easier to code.
Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic