On Tue, 25 Mar 2003, Randy Curnutt wrote:
> Date: Tue, 25 Mar 2003 21:14:47 -0500 > From: Randy Curnutt <[EMAIL PROTECTED]> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]>, > Randy Curnutt <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: url-pattern problem? Deployed servlet works in Tomcat 4.0.4 but > fails in Tomcat 4.1.18 > > I have a Servlet (with JSP's) which was created using NetBeans, and I did use the > appropriate hierarchy. > When I run the servlet using the NetBeans Internal Tomcat version 4.0.4 > the Servlet and JSP pages work fine. However, when I create a WAR file and let > Tomcat do the Auto Deploy and > try to run under Tomcat 4.1.18 the servlet fails. The first page is just a JSP > and it is displayed okay but it then posts to my Servlet and it immediately returns > to the initial page. My error page is not displayed. I can't find anything in the > log files. > It appears the problem might be related to the url-pattern. > In my web.xml file I have the following: > <servlet-mapping> > <servlet-name>SAWSServlet</servlet-name> > <url-pattern>/SAWSServlet</url-pattern> > </servlet-mapping> > > Running Tomcat 4.0.4 from within netbeans the URL which it successfully posts to > after the logon > screen looks as follows: > http://localhost:8081/SAWSServlet?action=logon&UserId=test&Password=test > > Under Tomcat 4.1.18 the URL which it tries to post to after logon has an extra "/" > after the servlet name and > before the query string parameters: > http://localhost:8080/SAWSServlet/?action=logon&UserId=test&Password=test > > Can anyone explain why I'm getting the extra "/" after the sevlet name? I'm > wondering if there is a setting in the server.xml or web.xml for the whole Tomcat > install that is different in 4.1.18 than the Netbeans Internal version of Tomcat > 4.0.4. > TIA for any help! Without seeing the code in your JSP page that generates the URL you are posting to, there is no way to know what's really going on. However, a workaround that will make Tomcat forward the "extra slash" URL to your servlet anyway would be to change the URL pattern to "/SAWSServlet/*" instead. > Randy > Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]