Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Refrence to all JSP files in web.xml

0

39 views

I have all the jsp files used by a webapp in a separate folder named jsp. I tried reference all the jsp files in the web.xml by the following way. But doesn't work. Wat could be the problem??

**

<servlet>
<servlet-name>Jsps</servlet-name>
<jsp-file>/jsp/path/</jsp-file>
</servlet>

<servlet-mapping>
<servlet-name>Jsps</servlet-name>
<url-pattern>/*.jsp<url-pattern>
</servlet-mapping>

**

asked June 2, 2011 4:15 am CDT
posted via StackOverflow

1 Answers

0
 

You cannot group jsps together under one servlet. If jsp is to be declared as a servlet, Each jsp should be defined as one servlet. For ex:

<servlet>
<servlet-name>Jsp1</servlet-name>
<jsp-file>/jsp/path/myjsp.jsp</jsp-file>
</servlet>

<servlet-mapping>
<servlet-name>Jsp1</servlet-name>
<url-pattern>/myjsp.jsp<url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>Jsp2</servlet-name>
<jsp-file>/jsp/path/myjsp2.jsp</jsp-file>
</servlet>

<servlet-mapping>
<servlet-name>Jsp2</servlet-name>
<url-pattern>/myjsp2.jsp<url-pattern>
</servlet-mapping>

If your requirement if just to access jsps , you do not need any servlet definitions or servlet mappings. Access it directly using /jsp/path/myjsp.jsp path

answered June 7, 2011 10:36 am CDT

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions
FTP Ignoring Git Files
February 24, 2011
Upload big files?
April 6, 2011
Two db connect files
February 21, 2011
Php including files
January 2, 2011
View .apk files
January 7, 2011
Postgresql log files
January 16, 2011
Uploading files
April 13, 2011
Generating swf files
March 16, 2011