0

hi
i have a problem in running javascript code between jsp page..
lets below is my jsp body .

<body>
   <script language="javascript" >
	alert("hi");
   </script>
   <h1>hello</hello>
   <% System.out.println("hello"); %>
</body>

in the above code there is no problem in running javascipt .. it gives hi alert easily but.. for below

<body>
   <script language="javascript" >
	alert("hi");
   </script>
   <h1>hello</hello>
   <% System.out.println("hello"); %>
[B]   <jsp:forward page="page1.jsp" />[/B]
</body>

but if above i include any jsp forward page tag or sendRedirect function then this javascript does'nt run..
please help me
i m stuck with this problem..

thnx in advance

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

2
Contributors
2
Replies
4
Views
8 Years
Discussion Span
Last Post by rattcod
0

Do not use forward action. As we know the action forward sends the dynamic content of html of the page1.jsp to web-browser.

Use include action.

<body>
   <script language="javascript" >
	alert("hi");
   </script>
   <h1>hello</hello>
   <% System.out.println("hello"); %>
   <jsp:include page="page1.jsp" />
</body>

Edited by __avd: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.