I have an index.jsp that will forward to different JSP pages
based on different conditions:
<%
if (cond1)
{
%>
<jsp:forward page="address/page1.jsp"/>
<% }
else if (cond2)
{
%>
<jsp:forward page="address/page2.jsp"/>
<% }
else
{
%>
<jsp:forward page="address/page3.jsp"/>
<% }
%>
The problem is in different pageX.jsp, when user submit form data, it will go to
other pages. Before, the index.jsp is in the same directory as pageX.jsp.
But now I moved out ofthe address folder, and it has broken links.
In my case, should I specify the abosolute path, rather than relative path?
so that in whatever situation, it will work.
please help. thanks!!
-
absolute path versus relative path in JSP (2 messages)
- Posted by: Matt Louden
- Posted on: July 07 2004 20:50 EDT
Threaded Messages (2)
- absolute path versus relative path in JSP by Senthil Chinnaiyan on July 07 2004 21:15 EDT
- absolute path versus relative path in JSP by Race Condition on July 08 2004 11:18 EDT
-
absolute path versus relative path in JSP[ Go to top ]
- Posted by: Senthil Chinnaiyan
- Posted on: July 07 2004 21:15 EDT
- in response to Matt Louden
I think absolute path should work for you. Implementing the controller logic in JSP may not be a good idea. If possible use some MVC framework like struts. Struts is very flexible to implement controlling logic.
Hope this helps,
Senthil. -
absolute path versus relative path in JSP[ Go to top ]
- Posted by: Race Condition
- Posted on: July 08 2004 11:18 EDT
- in response to Matt Louden
I have an index.jsp that will forward to different JSP pagesbased on different conditions:<% if (cond1) {%> <jsp:forward page="address/page1.jsp"/><% } else if (cond2) {%> <jsp:forward page="address/page2.jsp"/><% } else {%> <jsp:forward page="address/page3.jsp"/><% } %>The problem is in different pageX.jsp, when user submit form data, it will go toother pages. Before, the index.jsp is in the same directory as pageX.jsp. But now I moved out ofthe address folder, and it has broken links.In my case, should I specify the abosolute path, rather than relative path?so that in whatever situation, it will work.please help. thanks!!
I think you answered your own question 'should I specify the abosolute path... so that in whatever situation, it will work.'
Absolutely!