File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes can we use jsp include in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "can we use jsp include in javascript" Watch "can we use jsp include in javascript" New topic
Author

can we use jsp include in javascript

hari vemulapalli
Greenhorn

Joined: Mar 17, 2008
Posts: 18
Hi

I want to include a jsp page in the current JSP upon clicking of a button.Can we use jsp include directive in javascript to do that.
<%@include file="two.jsp" %>
can we write this directive inside js file..
Anyone please help me....
thnx in advance.
Jair Rillo Junior
Ranch Hand

Joined: Aug 27, 2008
Posts: 114
I don't think so, because JS is a client-side as long as JSP is a server-side.

If you want to add some part of page into another page dynamically, I advice you to use AJAX (or simply a hidden DIV).


Regards, Jair Rillo Junior
http://www.jairrillo.com/blog, SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 5.0, IBM SOA Associate (Test 664).
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
vems,

You already have been warned about your display name once here.

Please change you display name here to match the naming policy that you agreed to when signing up or your account will be disabled in the near future.

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Ajax, iframe, or post back are you options.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Please read this article to understand why that is not possible.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can we use jsp include in javascript