Im trying to write a JspPortlet.
My approach is flawed, and Im wondering if anyone else has discovered a way
for this to work.
Im using a RequestDispatcher, and the problem is that the JSP writes its
output directly to the Response
So the JSP output cannot be incorporated into ECS since (i believe) ECS must
render its entire element tree before setting it into the response
Has anyone ever 'redirected' the output of another servlet (.i.e. JSP) and
found a way to take this output
and put it into ECS, which is not flushed to the Response until the complete
ECS elements are rendered.
Here's the code from my JspPortlet implementation:
public ConcreteElement getContent() {
RunData rundata = this.getPortletConfig().getRunData();
PortletConfig pc = this.getPortletConfig();
String url = "/jsp/dates/date.jsp";
String myContent = null;
try {
String jspOutput = null;
ServletContext ctx = rundata.getServletContext();
RequestDispatcher dispatcher = ctx.getRequestDispatcher(url);
try
{
//rundata.getOut().flush();
// include the JSP
dispatcher.include( rundata.getRequest(),
rundata.getResponse() );
} catch (Exception e) {
String message = "JSPPortlet: Could not include the following
URL: " + url + " : " + e.getMessage();
Log.error( message, e );
return new StringElement( message );
}
ElementContainer content = new ElementContainer();
// there is nothing to add to ecs since dispatcher.include() has
already
written into the response
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]