prob with redirect
Hi, I will need some help with this qns =)
I have a menu.jsp page that contains a javascript menu.
Whenever a user log in from login.jsp, the page will redirect the user to menu.jsp, however, I cannot see the javascript menu when i reach the menu.jsp from login.jsp.
But when i run the menu.jsp alone, i am able to see the javascript menu, why is that so?
[388 byte] By [
des_xu] at [2007-9-26 2:16:24]

i am using two method response.sendRedirect and <jsp:forward page=""/> but both method cannot work.
When i run the menu.jsp alone, the javascript will build the menu, and it will show in the status bar - "Menu is ready for use" . but when i redirect, the menu will not appear but the status bar will still have the "Menu is ready for use".
> i am using two method response.sendRedirect and
> <jsp:forward page=""/> but both method cannot work.
>
> When i run the menu.jsp alone, the javascript will
> build the menu, and it will show in the status bar -
> "Menu is ready for use" . but when i redirect, the
> menu will not appear but the status bar will still
> have the "Menu is ready for use".
If you are using the <jsp:forward page=""/> method your javascript links have to be relative especially if your forwarded pages are in a sub-directory such as:
-- x.jsp -
<jsp:forward page="./includes/y.jsp"/>
y.jsp --
<javascript src="/js/x.js"></script>
--
if you use src="../js/x.js" like it should look from the includes directory you will not be including it to the client because the forward method does not inform the client that it is being redirected.
Hope that helps some
Bryan