|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How To Access a JSP file from other JSP
The following is my webapplication directory structure.
C:\Tomcat4.1\webapps\IS_Project -WEB-INF -JSP home.jsp,search.jsp.... WEB-INF 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 message /IS_Project/jsp/search.jsp description The requested resource (/IS_Project/jsp/search.jsp) is not available. Apache Tomcat/4.1.18 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. Archana |
|
#2
|
|||
|
|||
|
try this:
Code:
<form action="/IS_Project/jsp/search.jsp"> should work ![]() |
|
#3
|
|||
|
|||
|
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
Code:
<form action="<%= request.getContextPath() %>/jsp/search.jsp"> 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. |
|
#4
|
|||
|
|||
|
Thank You , i will try those two.
Archana |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > How To Access a JSP file from other JSP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|