The sample jsp file like this: ... <%@ include file="spacer.html" %> <%@ include file="menu.html" %> <%@ include file="spacer.html %> <%@ include file="content.html" %> ... When running this code, I got an error saying following: "org.apache.jasper.compiler.ParseException: Seen file /spacer.html already, maybe this is a recursive include?!" When I remove one of <%@ include file="spacer.html" %>, it runs successfully. Does it means I can not include two or more same included files? How should I do if I want to include more than one same file? Thanks.
Paul, Use the other type include. Use <jsp:include ... as many times as you like.
regds maha anna [This message has been edited by maha anna (edited April 01, 2001).]
Joined: Dec 22, 2000
Amit, thank you, When using the jsp file with the repeated <%@include ...%>, it works with my computer; however, when moving the same file to webappcabaret.com, I got the above error. Both run on the Tomcat. I don't know why. Now I remove all the repeated <%@include ...%> in my jsp files to make the codes adaptive to any host. Maha, thank you, When I use <jsp:include page="something" flush="true" /> (not repeated) many times in a jsp file, sometimes I get an error "response already committed!". After removing some, better only one left, it runs happy. I read servlet and jsp specs, both say the RequestDispatcher's include and <jsp:include.../> have restriction to be used. . How can we avoid the "IllegalStateException" when dealing with <jsp:include .../>? Thanks again.
[This message has been edited by paul sun (edited April 01, 2001).]
Joined: Jan 31, 2000
Paul, Try to make autoflush="false" for your <@ page ... directive and check. regds maha anna