The
pageContext.flush() that goes on in the struts templates really precludes
effective use of a jsp error page. Flushing prevents the buffer from being
cleared before forwarding to an error page. I know some servlet containers don't
support including without flushing but I think it should be a parameter of some
sort. I commented out the two cases of flushing below and it
seems to work in weblogic 6.0. If I recall, doing a jsp include in weblogic 5.1
didn't work correctly but I may be mistaken.
What is the
appropriate way to pass in parameters specific to the temlate tag? Would it need
to be an attribute of the insert or get tag or would it be a global parameter
passed to the ActionServlet?
InsertTag.java:
public int doEndTag() throws
JspException {
try
{
//pageContext.getOut().flush();
pageContext.include(template);
}
catch(Exception ex) { // IOException or ServletException
pageContext.setAttribute(Action.EXCEPTION_KEY, ex,
PageContext.REQUEST_SCOPE);
throw new JspException(ex.getMessage());
}
ContentMapStack.pop(pageContext);
return EVAL_PAGE;
//pageContext.getOut().flush();
pageContext.include(template);
}
catch(Exception ex) { // IOException or ServletException
pageContext.setAttribute(Action.EXCEPTION_KEY, ex,
PageContext.REQUEST_SCOPE);
throw new JspException(ex.getMessage());
}
ContentMapStack.pop(pageContext);
return EVAL_PAGE;
}
GetTag.java
public
int doStartTag() throws JspException {
.....
.....
else
{
try {
//pageContext.getOut().flush();
pageContext.include(content.toString());
}
catch(Exception ex) {
pageContext.setAttribute(Action.EXCEPTION_KEY, ex,
PageContext.REQUEST_SCOPE);
throw new JspException(ex.getMessage());
}
}
try {
//pageContext.getOut().flush();
pageContext.include(content.toString());
}
catch(Exception ex) {
pageContext.setAttribute(Action.EXCEPTION_KEY, ex,
PageContext.REQUEST_SCOPE);
throw new JspException(ex.getMessage());
}
}