0

Hi all , I am trying to map a user to a jsp page when he tries to enter to a directory of my application using URL. let say my web directory is called school and it has a directory called pages . now I need to map a user to error page when he tries to access to pages directory using URL
something like this:
http;//ip_address/school/pages
I have done this in web.xml but it is not working why!!!:

<servlet>
<servlet-name>myjsp</servlet-name>
<jsp-file>/school/errorPage.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>myjsp</servlet-name>
<url-pattern>/school/pages</url-pattern>
</servlet-mapping>

but it is not working ,
please tell me if I am wrong and how I correct it , please if you have another idea please tell me
I need it to apply it in my application
thanks

Edited by __avd: Add [code] tags. Encase your code in: [code] and [/code] tags.

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by ~s.o.s~
0

File errorPage.jsp must be placed inside school folder in the root of your website.

root\
         |
         \school\
                  |
                  | errorPage.jsp

Edited by __avd: n/a

0

I have done what you have said but still doesn't work although I save configuration after modification of web.xml

I would tell that my server is running on Centons , is it the problem ?
pleasse I need help with this

0

What is the name of your web application? If it's school, then trying removing /school from the URL pattern. It should work. Also, specify the location of all your resources wrt the web app root i.e. exclude the `school' directory.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.