I don't have any experience with oc4j nor embedding wicket in JSPs,
but I know two things that can cause trouble:
- make sure you use ONE_PASS_RENDER as a render strategy
- don't use oc4j, or at least look at the threads on this list, as
there have been more problems with oc4j and Wicket.
Martijn
On 9/20/07, hillj2 <[EMAIL PROTECTED]> wrote:
>
> I know this has been discussed before, but none of the previous posts have
> helped me solve my problem. I'm trying to embed a wicket page into a jsp
> page (until I have time go back and convert all our jsp's to wicket) using
> the <jsp:include> tag. oc4j throws a ServletException: Error in Servlet,
> with no further information specifying the problem, nor any indication from
> wicket that it's having a problem. To isolate the problem I tried to
> recreate it in a very small app, so I could rule out any issue with other
> app code/configurations. This time, I get a more informative (but not
> necessarily more helpful) error message:
>
> java.lang.IllegalStateException: Response has already been committed, be
> sure not to write to the OutputStream or to trigger a commit due to any
> other action before calling this method.
>
> I'm hoping it's the same error in both cases, and the former case just has a
> more generic error message for some reason; but I was hoping someone might
> have a clue why I can't get the embedding to work. I'm using oc4j 10.1.3.3,
> and wicket beta2. I tried it on Tomcat also. It didn't throw an error, but
> the place where the wicket content should be was just empty.
>
> I'd prefer not to have to do this with embedded IFRAME's as I've seen
> suggested. That's the setup I have now, but when a page loads there's a
> delay loading the IFRAME content, which doesn't look very nice, especially
> since the embedded content is my app's navigation menu. Any thoughts,
> suggestions, alternate solutions to the embedding issue?
>
> Here's the code from my small test app:
>
> embed.jsp
> ========
> <html>
> <head>
> <title>Embed test</title>
> </head>
> <body>
> <jsp:include page="/wicket/" flush="true">
> </jsp:include>
> <p>Here is my JSP content</p>
> </body>
> </html>
>
> EmbedServlet.java
> ==============
> public class EmbedServlet extends HttpServlet {
>
> public void doGet(HttpServletRequest request, HttpServletResponse
> response)
> throws ServletException, IOException {
> doPost(request, response);
> }
>
> public void doPost(HttpServletRequest request, HttpServletResponse
> response)
> throws ServletException, IOException {
>
> RequestDispatcher rd =
> request.getRequestDispatcher("/WEB-INF/jsp/embed.jsp");
> rd.forward(request, response);
>
> }
>
> }
>
> EmbedApplication.java
> =================
> public class EmbedApplication extends WebApplication {
>
> public EmbedApplication() {
> super();
> }
>
> public Class getHomePage() {
> return EmbedPage.class;
> }
>
> protected void init() {
> System.out.println("***** Wicket App initialized *****");
> }
>
> }
>
> EmbedPage.java
> ============
> public class EmbedPage extends WebPage {
> public EmbedPage() {
> super();
> }
> }
>
> EmbedPage.html
> ============
> <html>
> <head>
> <title>Embeded Wicket</title>
> </head>
> <body>
> <p>Here is my wicket content.</p>
> </body>
> </html>
>
> web.xml
> ======
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
> 2.2//EN"
> "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"
> xmlns="http://java.sun.com/xml/ns/javaee">
> <servlet>
> <servlet-name>EmbedServlet</servlet-name>
> <servlet-class>EmbedServlet</servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>EmbedServlet</servlet-name>
> <url-pattern>/main</url-pattern>
> </servlet-mapping>
> <servlet>
> <servlet-name>EmbedApplication</servlet-name>
>
> <servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-class>
> <init-param>
> <param-name>applicationClassName</param-name>
> <param-value>EmbedApplication</param-value>
> </init-param>
> </servlet>
> <servlet-mapping>
> <servlet-name>EmbedApplication</servlet-name>
> <url-pattern>/wicket/*</url-pattern>
> </servlet-mapping>
> <session-config>
> <session-timeout>35</session-timeout>
> </session-config>
> <mime-mapping>
> <extension>html</extension>
> <mime-type>text/html</mime-type>
> </mime-mapping>
> <mime-mapping>
> <extension>txt</extension>
> <mime-type>text/plain</mime-type>
> </mime-mapping>
> </web-app>
>
>
>
> Thanks,
> Joel
> --
> View this message in context:
> http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12801646
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]