Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp:include

 
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

="\\\\pc-103\\xyz\\a.html"



I don't think it is a valid URL.
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sometime i have the thing problem,i dont know too
 
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic