Is that right? I didn't realize that.

I was about to ask if you had any reference "/" before any of the welcome 
files. Although I'm not sure the XML file would even allow that would it?
I don't think I've tried it. Maybe it would. 

-----Original Message-----
From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] 
Sent: Tuesday, April 23, 2013 4:46 PM
To: 'Tomcat Users List'
Subject: RE: Question on servlet determination

> -----Original Message-----
> From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
> Sent: Tuesday, April 23, 2013 4:34 PM
> To: 'Tomcat Users List'
> Subject: RE: Question on servlet determination
> 
> I'm tempted to say no.
> 
> Because you might be adding a "/" in front of your servlet mapping.
> 
> In other words, changing the path of the folder slightly, with a 
> different relative path.
> 

I went back and read the servlet spec for 2.5, and according to it, Tomcat 
should be redirecting the URI ending "/Servlet2" to "/Servlet2/" and then 
applying welcome files (I do have some defined, just didn't include it below).  
Amazingly, this appears to be what happens.  However, if the ending "/" already 
exists, it doesn't just go looking for welcome files.
Jeff

> ________________________________
> From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
> Sent: Tuesday, April 23, 2013 2:29 PM
> To: 'Tomcat Users List'
> Subject: Question on servlet determination
> 
> Running Tomcat 6.0.36, JDK 1.6.0_43
> 
> I've an application defined with the following web.xml:
> 
> <web-app>
>   <security-constraint>
>     <web-resource-collection>
>       <web-resource-name>Everything</web-resource-name>
>       <url-pattern>*.jsp</url-pattern>
>       <url-pattern>*.html</url-pattern>
>       <url-pattern>*.js</url-pattern>
>       <url-pattern>/Servlet1</url-pattern>
>       <url-pattern>/Servlet2</url-pattern>
>     </web-resource-collection>
>     <user-data-constraint>
>       <transport-guarantee>CONFIDENTIAL</transport-guarantee>
>     </user-data-constraint>
>   </security-constraint>
>   <resource-ref>
>     <description>Oracle Universal Connection Pool</description>
>     <res-ref-name>jdbc/oracleUCPPool</res-ref-name>
>     <res-type>javax.sql.DataSource</res-type>
>     <res-auth>Container</res-auth>
>   </resource-ref>
>   <servlet>
>     <servlet-name>Servlet1</servlet-name>
>     <display-name>Servlet1</display-name>
>     <description>Controlling servlet for Servlet1</description>
>     <servlet-class>com.polydyne.servlet1</servlet-class>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
>   <servlet>
>     <servlet-name>Servlet2</servlet-name>
>     <display-name>Servlet2</display-name>
>     <description>Controlling servlet for Servlet2</description>
>     <servlet-class>com.polydyne.servlet2</servlet-class>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>Servlet1</servlet-name>
>     <url-pattern>/Servlet1</url-pattern>
>   </servlet-mapping>
>   <servlet-mapping>
>     <servlet-name>Servlet2</servlet-name>
>     <url-pattern>/Servlet2</url-pattern>
>   </servlet-mapping>
>   <error-page>
>      <error-code>404</error-code>
>      <location>/Unavailable.jsp</location>
>   </error-page>
> </webapp>
> 
> The issue:  If I connect with the URL: http://myhost/Servlet1 (or 
> Servlet2), I get what I expect.  However, if I connect 
> http://myhost/Servlet1/ then I get a 404.  Actually, I get my 404 page 
> but not all the graphics come over.
> 
> Shouldn't the final / be stripped and I get the same behavior either 
> way?
> 
> Also willing to entertain critiques on my security-constraint section, 
> but not that we don't use Tomcat authentication, so I want any 
> requests for top-level files in the Web directory to also force https.
> 
> Jeffrey Janner
> Sr. Network Administrator
> jeffrey.jan...@polydyne.com<mailto:first.l...@polydyne.com>
> PolyDyne Software Inc.
> Main:   512.343.9100
> Direct:  512.583.8930
> 
>  [cid:image002.png@01CC0FB7.4FF43CE0]
> 
> Speed, Intelligence & Savings in Sourcing



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to