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]
# 1
so how are you redirecting from the login page?Also, check your browser status area at the bottom if you see a javascript error or in the Java Console.could you give us more details... - madhav
mlakkapr at 2007-6-29 9:14:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

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".

des_xu at 2007-6-29 9:14:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
try to use <JSP:include>otherwise use thisi think the problem is with the path of the JS file.the server can't able to find the JS fileu should use the relative path(relative to the server) for the JS file
ynroy at 2007-6-29 9:14:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

> 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

bryanwclark at 2007-6-29 9:14:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
oh..ok, thanks alot
des_xu at 2007-6-29 9:14:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...