This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:include Error in Websphere 4.0

 
Madhu Menon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was using the <jsp:include page="<%=header%>"/> statement in my jsp running on Websphere 5.0 and Tomcat 4.1.18/4.1.24 . Due to certain resons I had to port my Web Application backward to Websphere 4.0 from J2EE 1.3 to J2EE 1.2.
When I do this i get this following error.
org.apache.jasper.JasperException: K:\Project\WS4\Web Content\jsp\welcome.jsp(33,33) JSPG0081E: jsp:include needs to have "flush=true"
So I changed my intial statement to
<jsp:include page="<%=header%>" flush="true"/>
Now when i try to view the page, the page specified by the header variable is displayed in the webbrowser after that i get this Exception.
Error 500: ERROR: Cannot forward. The response has already been committed.

If I try to make the the statement as
<jsp:include page="<%=header%>" flush="false"/>
I get the Following Exception.
org.apache.jasper.JasperException: K:\Project\WS4\Web Content\jsp\welcome.jsp(33,47) JSPG0082E: jsp:include page="..." flush="true" is the only valid combination in JSP 1.1

Now My issue is how can i have this set right on Websphere 4.0 / J2EE 1.2. I see it intresting that such an error has come becuse JSP:include tag is designed for such a purpose and that it is working fine with Websphere 5.0 and Tomcat.
Some say it could be an Error on Websphere 4.0 . If so is there any way out / alternative and is there a patch for websphere for this ?
It would be really great if somebody can suggest me a solution.
Thanks & Regards,
@M
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this is a Webshpere-specific problem, I'm going to shuffle this off to the Websphere forum where the IBM-savvy hang out.
bear
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not really WebSphere specific, but we can handle it here anyway.
By the looks of it, your JSP is running 'correctly', except that for some reason its design has it trying to forward after the buffer has been commited.
The reason the response is commited is easy, the jsp:include forces the buffer to flush and this commits the response. There are generally two reasons why you'd have a forward after this point:
a) you have one in your code - in this case you need to remove it and do your forward before outputting data or
b) an exception is being thrown after this point. If an exception is being thrown (80% of the time its a NullPointerException), the server tries to forward to error page, but this fails if the response is commited. You need to remove the exception, obviously!
Dave.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic