PDA

View Full Version : forwarding to a document in different directory problem


j8by7
06-30-2009, 09:48 AM
Hey guys, i've looked around but haven't had success in finding how to forward to a document in a different directory and be in that directory. Using the jsp:forward command i'm able to view the document but i'm not in the actual directory so when i click a link on the document that i forward to I get an error saying the requested resource is not available.

the following is my code is layout:

//check.jsp

<%!
boolean zomg = true;%>
<%
if (zomg == false){
%>
<jsp:forward page="login.jsp"/>
<%
}else{
%>
<jsp:forward page="data/hi.jsp"/>
<%
}
%>


//hi.jsp

<html>
<body>
Hi!<br>
<a href="omg.jsp">CLICK ME</a>
</body>
</html>


//omg.jsp

<html>
<body>
I'm in Omg!<br>
</body>
</html>


So after check.jsp is executed I can see the content of hi.jsp but clicking the link gives me an error because i'm not in the directory. I'm sure there is a simple command that can link me to the directory and hi.jsp but I can't figure it out :( Any suggestions?!?

Thanks for any tips :)

j8by7
06-30-2009, 12:06 PM
Ah, i'm just confused, my design to my login system can be better implemented without automatically linking somewhere, although if anyone could tell me a jsp or html command that auto links somewhere i'd be happy