File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Problem Invoking Servlet thru Proxy Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem Invoking Servlet thru Proxy Server" Watch "Problem Invoking Servlet thru Proxy Server" New topic

Problem Invoking Servlet thru Proxy Server

Kelly Dolan
Ranch Hand

Joined: Jan 08, 2002
Posts: 109
Hi! I have a problem invoking a servlet with a URL in a proxy server environment.
I have a MyApp.war file that has the following structure:
My web.xml file contains the following:
<servlet-class>some class also in the .war file</servlet-class>
Note that there is no servlet mapping to /dir2.
Finally, index.jsp contains:
Under normal circumstances, the following occurs if I enter the specific URLs in a web browser:
1. http://<server>/MyApp/dir1 --> redirects the request to servlet ToolA
2. http://<server>/MyApp/dir2/some.jsp --> directs the request to dir2/some.jsp
3. http://<server>/MyApp --> (a shortcut URL for /MyApp/dir1) the web container by default directs the request to index.jsp which redirects the request to /MyApp/dir1 which redirects the request to servlet ToolA
This works as intended. My problem arises when I try and invoke my application and a proxy server is in the middle. The first two URL requests work fine. The third presents me with a blank screen. If I click the refresh button on my web browser, my screen appears. The only other bit of information that I know of is when the third URL is entered, the proxy log shows two URLs...(a) http://<server>/MyApp and (b) http://<server>/MyApp/index.jsp.
I have tried adding the following servlet mapping to my web.xml file:
Unfortunately, this causes the second URL to break (.../dir2/some.jsp). Any request for a jsp in dir2 fails because I guess, it matches the request against the servlet mapping for "/" and redirects the request to the ToolA servlet.
I do not know if there is a way around this or not. Any help is greatly appreciated.
Have a great day!
- Kelly
I agree. Here's the link:
subject: Problem Invoking Servlet thru Proxy Server
It's not a secret anymore!