hello paul,
i investigated your problems by imitating your use case. i wrote a
simple servlet that forwards any post request to a jsp (see attached
code). i works perfectly ok, just as expected.
i guess your servlet code is broken somehow. maybe you provide some code
snippets of our servlet and the jsp you are using.
just a hint: the output of httpclient.wire shows a somewhat strange
html. see tagging below.
hope that helps, uli.
Paul Sterk wrote:
Hi,
I have written a simple XForm with the following xforms:submission element:
<xforms:submission id="debug" xforms:replace="all"
xforms:action="/chiba/MessageServlet" xforms:method="post"/
>
The XForm sends its content to a servlet. The servlet uses the content
to get additional data. It then forwards the data to a JSP for viewing.
This follows a J2EE best practice of separating the data from the view.
The code in my servlet that does the forwarding is:
RequestDispatcher rd =
getServletContext().getRequestDispatcher("/jsp/display.jsp");
However, when I do this, no HTML from the JSP is displayed back to my
browser. I see the HTML version of the XForm (I think this is the
default behavior).
HTML output is being printed to the web server log, however. The
display.jsp is functioning ok (it just prints a short test message in
HTML). When I comment out the line above and add out.println(...) to the
servlet, the HTML displays in my browser. If I set the
xforms:action="/jsp/display.jsp", I receive HTML.
I checked the Chiba Cookbook, but could not find anything related to
this issue. There are logging details below.
Paul
Logging output for JSP:
DEBUG org.chiba.xml.xforms.Container : dispatch: xforms-submit-done to
[xforms:submission: null]
DEBUG org.chiba.xml.xforms.Container : dispatch: cancelable: false
DEBUG org.chiba.xml.xforms.Container : dispatch: bubbles: true
DEBUG org.chiba.xml.xforms.Container : dispatch: target: null
<strange-html>
DEBUG httpclient.wire : << "7"
DEBUG httpclient.wire : << "1"
DEBUG httpclient.wire : << "[\r]"
DEBUG httpclient.wire : << "[\n]"
</strange-html>
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "h"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "m"
DEBUG httpclient.wire : << "l"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "[\n]"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "b"
DEBUG httpclient.wire : << "o"
DEBUG httpclient.wire : << "d"
DEBUG httpclient.wire : << "y"
DEBUG httpclient.wire : << " "
DEBUG httpclient.wire : << "b"
DEBUG httpclient.wire : << "a"
DEBUG httpclient.wire : << "c"
DEBUG httpclient.wire : << "k"
DEBUG httpclient.wire : << "g"
DEBUG httpclient.wire : << "r"
DEBUG httpclient.wire : << "o"
DEBUG httpclient.wire : << "u"
DEBUG httpclient.wire : << "n"
DEBUG httpclient.wire : << "d"
DEBUG httpclient.wire : << "="
DEBUG httpclient.wire : << """
DEBUG httpclient.wire : << "#"
DEBUG httpclient.wire : << "8"
DEBUG httpclient.wire : << "0"
DEBUG httpclient.wire : << "8"
DEBUG httpclient.wire : << "0"
DEBUG httpclient.wire : << "8"
DEBUG httpclient.wire : << "0"
DEBUG httpclient.wire : << """
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "[\n]"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "a"
DEBUG httpclient.wire : << "b"
DEBUG httpclient.wire : << "l"
DEBUG httpclient.wire : << "e"
DEBUG httpclient.wire : << " "
DEBUG httpclient.wire : << "b"
DEBUG httpclient.wire : << "o"
DEBUG httpclient.wire : << "r"
DEBUG httpclient.wire : << "d"
DEBUG httpclient.wire : << "e"
DEBUG httpclient.wire : << "r"
DEBUG httpclient.wire : << "="
DEBUG httpclient.wire : << """
DEBUG httpclient.wire : << "1"
DEBUG httpclient.wire : << """
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "[\n]"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "c"
DEBUG httpclient.wire : << "a"
DEBUG httpclient.wire : << "p"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "i"
DEBUG httpclient.wire : << "o"
DEBUG httpclient.wire : << "n"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "S"
DEBUG httpclient.wire : << "e"
DEBUG httpclient.wire : << "a"
DEBUG httpclient.wire : << "r"
DEBUG httpclient.wire : << "c"
DEBUG httpclient.wire : << "h"
DEBUG httpclient.wire : << " "
DEBUG httpclient.wire : << "R"
DEBUG httpclient.wire : << "e"
DEBUG httpclient.wire : << "s"
DEBUG httpclient.wire : << "u"
DEBUG httpclient.wire : << "l"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "s"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "/"
DEBUG httpclient.wire : << "c"
DEBUG httpclient.wire : << "a"
DEBUG httpclient.wire : << "p"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "i"
DEBUG httpclient.wire : << "o"
DEBUG httpclient.wire : << "n"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "[\n]"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "/"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "a"
DEBUG httpclient.wire : << "b"
DEBUG httpclient.wire : << "l"
DEBUG httpclient.wire : << "e"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "[\n]"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "/"
DEBUG httpclient.wire : << "b"
DEBUG httpclient.wire : << "o"
DEBUG httpclient.wire : << "d"
DEBUG httpclient.wire : << "y"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "[\n]"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "/"
DEBUG httpclient.wire : << "h"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "m"
DEBUG httpclient.wire : << "l"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "[\n]"
<strange-html>
DEBUG httpclient.wire : << "[\r]"
DEBUG httpclient.wire : << "[\n]"
DEBUG httpclient.wire : << "0"
DEBUG httpclient.wire : << "[\r]"
DEBUG httpclient.wire : << "[\n]"
DEBUG org.apache.commons.httpclient.HttpParser : enter
HeaderParser.parseHeaders(HttpConnection, HeaderGroup)
DEBUG org.apache.commons.httpclient.HttpParser : enter
HttpParser.readLine()
DEBUG org.apache.commons.httpclient.HttpParser : enter
HttpParser.readRawLine()
DEBUG httpclient.wire : << "[\r]"
DEBUG httpclient.wire : << "[\n]"
</strange-html>
DEBUG org.apache.commons.httpclient.HttpMethodBase : Resorting to
protocol version default close connection policy
DEBUG org.apache.commons.httpclient.HttpMethodBase : Should NOT close
connection, using HTTP/1.1.
DEBUG org.apache.commons.httpclient.HttpConnection : enter
HttpConnection.releaseConnection()
Logging output from the servlet:
DEBUG org.chiba.xml.xforms.Container : dispatch: xforms-submit-done to
[xforms:submission: null]
DEBUG org.chiba.xml.xforms.Container : dispatch: cancelable: false
DEBUG org.chiba.xml.xforms.Container : dispatch: bubbles: true
DEBUG org.chiba.xml.xforms.Container : dispatch: target: null
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "h"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "m"
DEBUG httpclient.wire : << "l"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "[\n]"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "b"
DEBUG httpclient.wire : << "o"
DEBUG httpclient.wire : << "d"
DEBUG httpclient.wire : << "y"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "[\n]"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "b"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "e"
DEBUG httpclient.wire : << "s"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "/"
DEBUG httpclient.wire : << "b"
DEBUG httpclient.wire : << "o"
DEBUG httpclient.wire : << "d"
DEBUG httpclient.wire : << "y"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "<"
DEBUG httpclient.wire : << "/"
DEBUG httpclient.wire : << "h"
DEBUG httpclient.wire : << "t"
DEBUG httpclient.wire : << "m"
DEBUG httpclient.wire : << "l"
DEBUG httpclient.wire : << ">"
DEBUG httpclient.wire : << "[\r]"
DEBUG httpclient.wire : << "[\n]"
DEBUG org.apache.commons.httpclient.HttpMethodBase : Resorting to
protocol version default close connection policy
DEBUG org.apache.commons.httpclient.HttpMethodBase : Should NOT close
connection, using HTTP/1.1.
DEBUG org.apache.commons.httpclient.HttpConnection : enter
HttpConnection.releaseConnection()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy
all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------------------------------
____
/ __/____ __ Paul Sterk
_\_ \/ / // \ IT Software Systems Engineer
\___/\__//_/_/ Sun Microsystems, Inc.
MICROSYSTEMS 7788 Gateway Blvd. x42072 (internal)
MS UNWK18-206
paul.sterk-xsfywfwIY+M@xxxxxxxxxxxxxxxx
Newark, CA 94560 (925) 264-4468
--------------------------------------------------------------
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Chiba-developer mailing list
Chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/chiba-developer
--
Ulrich Nicolas Lissé
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Category;
public class MessageServlet extends HttpServlet {
private static final Category LOGGER =
Category.getInstance(MessageServlet.class);
protected void doPost (HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
LOGGER.debug("doPost: forwarding to '/jsp/debug-instance.jsp'");
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher("/jsp/debug-instance.jsp");
dispatcher.forward(request, response);
}
}
|