• 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---please help

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been beating my chest trying to fix this in vain. Please
help! Here is my problem.
In my jsp file, I have a jsp (under webdev\jsp) include:
<jsp:include page="http://localhost:8080/webdev/servlet/Counter"
flush="true" />
Here "Counter" is a servlet which will output a number.
But the above jsp:include doesn't seem to output anything,
not even an error message. I tried to use the absolute
path such as "C:\tomcat\webapps\webdev\web-inf\classes\Counter",
but it outputed nothing either. What did I do wrong?
BTW, I am running tomcat.
Thanks! Sam
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The answer is easy to find in the JSP specification. Look up the <jsp:include> syntax. It says that the value of the page attribute has to be a relative URL specification, either "/something", which is interpreted as starting at the root of the servlet context, or "somethingElse", which is relative to the current JSP page. URL's like "http://..." and "C:/..." don't work.
 
To get a wish, you need a genie. To get a genie, you need a lamp. To get a lamp, you need a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic