users@glassfish.java.net

Re: Anyway to make glassfish open urls in a case insentive method?

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 27 Jun 2008 12:10:59 -0400

Salut,

glassfish_at_javadesktop.org wrote:
> I am running glassfish on window based machines so the files and folder can only have one name.
>
> Glassfish however seems to not be able to load the file or directory up if the case is different
>
> such as http://localhost:8080/WorkFlow/ and http://localhost:8080/workflow/ one will be not working.
>
> also for files names http://localhost:8080/workflow/doom.jpg and http://localhost:8080/workflow/doom.JPG will also be one is not working.
>
>
> Is there a way to make glassfish able to open the files and not caring about the case?

For security reason (on window specially), we aren't allowing such
feature. The WebContainer cannot map request to the JspContainer that
ends up with jSp or JSP or Jsp, hence allowing:

http://localhost:8080/workflow/doom.jSp (or .JSP)

the WebContainer will not map the extension to the JspContainer, and the
file will be returned as a html (or txt) file, giving an attacker the
JSP source code instead of the compiled JSP :-).

If you want to enable such mapping, just add it to your web.xml like:

> <servlet>
> <servlet-name>default</servlet-name>
> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
> <init-param>
> <param-name>debug</param-name>
> <param-value>0</param-value>
> </init-param>
> <init-param>
> <param-name>listings</param-name>
> <param-value>true</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>

and then add you own mapping:

> <servlet-mapping>
> <servlet-name>default</servlet-name>
> <url-pattern>*.JPG</url-pattern>
> </servlet-mapping>

Hope that help.

-- Jeanfrancois





> [Message sent by forum member 'flyingbuzz' (flyingbuzz)]
>
> http://forums.java.net/jive/thread.jspa?messageID=282992
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>