When I access a jsp page like this on the application development server:
local: 8888 / index.jsp /
it displays the source code of index.jsp in the browser. if you access without a trailing slash (i.e. index.jsp) then it displays jsp but with a trailing slash (i.e. index.jsp /) it displays the source code
Any idea why this is? and how to fix it?
It seems to only happen on the development server, not in production. Production gives a 404 Not Found error, which is good.
I am using SDK 1.6.4
web.xml:
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <servlet> <servlet-name>RegisterPage</servlet-name> <jsp-file>/register.jsp</jsp-file> </servlet> <servlet-mapping> <servlet-name>RegisterPage</servlet-name> <url-pattern>/signup</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
===========
So...
index.jsp -> displays the page
index.jsp / -> returns the source code
register.jsp / -> returns the source code
register.jsp → renders jsp
signup / -> renders register.jsp
signup → renders register.jsp
so it seems that urls with * .jsp / have a problem
xtrahelp.com
source share