• Post Reply Bookmark Topic Watch Topic
  • New Topic

extra path attempts yield 404s  RSS feed

 
Mark Schwartz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to access a servlet at /myApp/frontdoor. When I append information as a query string like: /myApp/frontdoor?appID=123, I have no problems. When I try to append path information like /myApp/frontdoor/123, I am getting a 404. Is there some configuration I should be doing to my web.xml file so that it recognizes extra path info?
Thanks,
Mark Schwartz
 
Trevor Dunn
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you mapped frontdoor to a url in your web.xml file. In an application I wrote I had a servlet called main, mapped it to a url called entry. All I had to to was call "<%=request.getContextPath()%>/entry/extra_path_info" and I received my extra path information
Trevor
 
Mark Schwartz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, frontdoor is mapped to a servlet in my web.xml file. Tomcat and / or WebLogic are just not stopping the lookup when /myApp/frontdoor is hit. They are looking for a file at the full path location (like: /myApp/frontdoor/x/y/z). It won't find "z" since there isn't anything there, but it doesn't stop at /myApp/frontdoor.
Here is a snippet from my web.xml file:
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>myApp</display-name>
<description>
frontdoor test
</description>
<servlet>
<servlet-name>EntryServlet</servlet-name>
<description>
</description>
<servlet-class>test.EntryServlet</servlet-class>
<!-- Load this servlet at server startup time -->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>EntryServlet</servlet-name>
<url-pattern>/frontdoor</url-pattern>
</servlet-mapping>
</web-app>
 
Trevor Dunn
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well that looks fine to me. The only differences between what I did and yourself is that I sent every url request through myservlet therefore I had the url mapped like this
<url-pattern>/entry/*</url-pattern>
And also I am using JRun.
Hopefully someone else will have the answer
Trevor
 
Mark Schwartz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was the "/*" I was missing on the <url-pattern> which was causing the problem.
It should have been:
"<url-pattern>/frontdoor/*</url-pattern>"
It works now.
Thanks,
Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!