aspose file tools*
The moose likes JSP and the fly likes jsp:include Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp:include" Watch "jsp:include" New topic
Author

jsp:include

Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
I am not able to include even a single file in my jsp using <jsp:include>
Following is my code:

<%@ page language="java" contentType="text/html" %>
<html>
<head>
</head>
<body>
<jsp:include page="test1.html" flush="true"/>
</body>
</html>

can anybody suggest something.
Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
I am able to use <jsp:include> to display files from my system.But, i am not able to use <jsp:include> to include files from a remote system.Is that the limitation of <jsp:include>
Srikanth Nutigattu
Ranch Hand

Joined: Oct 30, 2007
Posts: 114
I am able to use <jsp:include> to display files from my system.But, i am not able to use <jsp:include> to include files from a remote system.Is that the limitation of <jsp:include>


Yes! <jsp:include> standard action and include directive <%@include..> can include resources only from same context alone. If you want to include external pages then you can use JSTL's <c:import> tag.

<c:import url=""/>
Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
i used <c:import url="\\\\pc-103\\xyz\\a.html"/>

but still nothing is included in my jsp page. please let me know if i need to add something else in jsp page or somewhere in web.xml
Srikanth Nutigattu
Ranch Hand

Joined: Oct 30, 2007
Posts: 114
="\\\\pc-103\\xyz\\a.html"


I don't think it is a valid URL.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

Originally posted by Srikanth Nutigattu:
I don't think it is a valid URL.

It's not. It's a Windows file path. Won't work.

It needs to be a URL to a resource that is served by a web server.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mike Yan
Greenhorn

Joined: Dec 13, 2008
Posts: 1
sometime i have the thing problem,i dont know too
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsp:include