March 14th, 2003, 08:20 PM
How To Access a JSP file from other JSP
The following is my webapplication directory structure.
I can access the search.jsp
http://localhost:8080/IS_Project/jsp/search.jsp like this
My home.jsp contains simple form data , in the form action i am calling search.jsp
I tried all these
<form action="search.jsp">,<form action="/jsp/search.jsp">, <form action="IS_Project/jsp/search.jsp">
For all these I am getting(depending on what I gave in the action)
HTTP Status 404 - /IS_Project/jsp/search.jsp
type Status report
description The requested resource (/IS_Project/jsp/search.jsp) is not available.
I know I am missing some thing here ,please somebody help me in how to call the JSP file.Do I need to add anything in the web.xml?
I really appreciate anykind of help.
March 15th, 2003, 06:05 PM
March 15th, 2003, 07:08 PM
If you want to get the web app name without hard coding it in (in case you ever monve thi to a web app that has a different name) you can use
That way if you hav a hundred files and you change the name of the web app to IT_Project, then you don't have to touch each page.
<form action="<%= request.getContextPath() %>/jsp/search.jsp">
March 17th, 2003, 08:25 AM
Thank You , i will try those two.