aspose file tools*
The moose likes JSP and the fly likes Redirect jsp to a private IP 192.168.1.44 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Redirect jsp to a private IP 192.168.1.44" Watch "Redirect jsp to a private IP 192.168.1.44" New topic
Author

Redirect jsp to a private IP 192.168.1.44

Vince Hon
Ranch Hand

Joined: Feb 11, 2003
Posts: 117
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


Vince Hon<br /> <br />SCJP 1.4 | SCWCD | SCBCD <br /><a href="http://vincehon.homeip.net:8000/VJW" target="_blank" rel="nofollow">http://vincehon.homeip.net:8000/VJW</a>
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirect jsp to a private IP 192.168.1.44