This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSP and the fly likes jsp:include problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "jsp:include problem" Watch "jsp:include problem" New topic
Author

jsp:include problem

Rudolf Schmidt
Greenhorn

Joined: Sep 05, 2001
Posts: 10
I want to use the jsp:include action to call a servlet within a jsp (the servlet dispatches to another jsp)
<jsp:include page="login.jsp" /> works fine as this jsp is in the same directory as the original jsp.
<jsp:include page="/webapp/Admin" /> does not work. ("Admin" is a servlet ), i always get a "File not found" Exception
Thanks for help
Rudolf
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
try:
<jsp:include page="servlet/Admin" />maybe it will help.
Rudolf Schmidt
Greenhorn

Joined: Sep 05, 2001
Posts: 10
it seems that the include "finds" the servlet, but then an error occures saying, the response was not http
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
in the servlet did u set the contenttype to text/html???
if not type this in the servlet before u output anything.
response.setContectType("text/html");
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
oops a typo.
here is the correct form:
response.setContentType("text/html");
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsp:include problem