Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem Invoking Servlet thru Proxy Server

Kelly Dolan
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic