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

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>

very much thnx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.