Forums Register Login

jsp:include---please help

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 972 times.
Similar Threads
HF: JSP & Servlets, compiling on Windows
HF: JSP & Servlets (Can't compile my first class on Windows)
Help with directory tree in JSP/Servlet
problem using bean in jsp file
Error: Invalid jsp:include Tag
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:13:52.