944,164 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 3419
  • JSP RSS
Oct 22nd, 2009
0

javascript inserting between jsp

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

jsp Syntax (Toggle Plain Text)
  1. <body>
  2. <script language="javascript" >
  3. alert("hi");
  4. </script>
  5. <h1>hello</hello>
  6. <% System.out.println("hello"); %>
  7. </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"); %>
   <jsp:forward page="page1.jsp" />
</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
Last edited by peter_budo; Oct 22nd, 2009 at 1:02 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rattcod is offline Offline
2 posts
since Oct 2009
Oct 24th, 2009
0
Re: javascript inserting between jsp
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.
JSP Syntax (Toggle Plain Text)
  1. <body>
  2. <script language="javascript" >
  3. alert("hi");
  4. </script>
  5. <h1>hello</hello>
  6. <% System.out.println("hello"); %>
  7. <jsp:include page="page1.jsp" />
  8. </body>
Last edited by adatapost; Oct 24th, 2009 at 12:55 am.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008
Oct 25th, 2009
0
Re: javascript inserting between jsp
very much thnx
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rattcod is offline Offline
2 posts
since Oct 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: JSP: search string for bad characters.
Next Thread in JSP Forum Timeline: java servlets help???





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC