This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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.
Amit Roy
Ranch Hand
Joined: Oct 10, 2000
Posts: 132
posted
0
hi Paul ya u cannot include the same file more then once. Alos the name of all the variables will clash Amit
<I>Chance Favours the Prepared minds"</I>
maha anna
Ranch Hand
Joined: Jan 31, 2000
Posts: 1467
posted
0
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).]
paul sun
Greenhorn
Joined: Dec 22, 2000
Posts: 28
posted
0
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).]
maha anna
Ranch Hand
Joined: Jan 31, 2000
Posts: 1467
posted
0
Paul, Try to make autoflush="false" for your <@ page ... directive and check. regds maha anna