Actually, the exception goes away on the client side only (No stack
trace dumped to the web page) if I use writer.close(). writer.flush()
dumps the trace to both the console and the web page.
Bill
On 5/22/07, Bill Holloway <[EMAIL PROTECTED]> wrote:
I'm using an in-place-editor under script.aculo.us to edit some text
printed to the browser. In my page class I have
public String getActionURL ()
{
Link inPlaceLink = _resources.createActionLink
("inPlaceEditorSubmit", false, (Object[]) null);
return inPlaceLink.toURI();
}
void onInPlaceEditorSubmit () throws IOException
{
String val = _request.getParameter ("value");
System.out.println ("text is:" + val);
PrintWriter writer = _response.getPrintWriter ("text/plain");
writer.print (val);
writer.flush();
}
My page template is
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<body>
<form t:type="form" t:id="inPlaceForm">
<p id="editme2">Click me to edit this nice long text.</p>
<script type="text/javascript">
new Ajax.InPlaceEditor('editme2', '${actionURL}',
{rows:15,cols:40});
</script>
</form>
</body>
</html>
This all works just fine except that there is an
"IllegalStateException" thrown when I submit the changed field. It
complains about that the printwriter (I guess) is "Committed". A
partial stack trace starting at the top is shown below. I notice that
if I omit the call to writer.flush(), there is no exception, but the
text on the web page does not reflect the changed value -- it reverts
to the initial value before the change -- doubtlessly because without
the flush, the stream never gets back to the client-side response
handler.
#
org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
#
org.mortbay.jetty.servlet.ServletHttpResponse.sendRedirect(ServletHttpResponse.java:458)
#
org.apache.tapestry.internal.services.ResponseImpl.sendRedirect(ResponseImpl.java:63)
#
org.apache.tapestry.internal.services.LinkActionResponseGenerator.sendClientResponse(LinkActionResponseGenerator.java:39)
#
org.apache.tapestry.internal.services.ComponentActionDispatcher.dispatch(ComponentActionDispatcher.java:122)
Thoughts?
Bill
--
"The future is here. It's just not evenly distributed yet."
-- Traditional
--
"The future is here. It's just not evenly distributed yet."
-- Traditional
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]