Re: jsp include/RequestDispatcher incompatible?

2005-06-29 Thread George Finklang
Feh.  Easier to just translate the whole jsp into a servlet by hand
which is what I already did.

--George

On 6/29/05, Tim Funk <[EMAIL PROTECTED]> wrote:
> Try flush first, otherwise you might need to pass a
> HttpServletResponseWrapper() to include() where the wrapper oversrides
> getOutputStream() (or getWriter()
> 
> -Tim
> 
> George Finklang wrote:
> > So before each request dispatcher call I need to call a flush on the
> > out in the JspPage?  How do I get access to it?
> >
> > Do I also need to call flush at the end of each request dispatcher call?
> >
> > --George
> >
> > On 6/28/05, Tim Funk <[EMAIL PROTECTED]> wrote:
> >
> >>The out from the jspwriter is NOT the same out as receieved by
> >>response.getWriter();
> >>
> >>The out in the JspPage is  buffered.
> >>
> >>-Tim
> >>
> >>George Finklang wrote:
> >>
> >>
> >>>have the following code in my jsp, which is called by a forward from my
> >>>Controller servlet. The various Dispatchers are either servlets or jsps 
> >>>declared
> >>>in my web.xml.
> >>>
> >>>All the servlets and jsps get run correctly. The problem is the output. The
> >>>output of the root jsp and the 3-4 included jsps are arbitrarily 
> >>>rearranged, see
> >>>below. Bizarre shuffling, not reverse order, but a different order and not
> >>>interleaved with the text from the jsp.
> >>>
> >>>If I translate the jsp into servlet code, and use RequestDispatchers
> >>>for all the components,
> >>>the page works.  The documentation says something about flushing buffers, 
> >>>but I
> >>>can't see how to do this with RequestDispatchers.
> >>>
> >>>
> >>>Code:
> >>>
> >>>
> >>>
> >>><% if(option1) {
> >>>
> >>> application.getNamedDispatcher("Option1Servlet").include(request,response);
> >>>} else { %>
> >>>
> >>><% if(option2) { %>
> >>><%
> >>>
> >>>application.getNamedDispatcher("Option2Servlet").include(request,response);
> >>>%>
> >>><%  } %>
> >>><%
> >>>   application.getNamedDispatcher(page).include(request,response); 
> >>> %>
> >>><%
> >>>   
> >>> application.getNamedDispatcher("InfoServlet").include(request,response);
> >>>%>
> >>>
> >>><%  } %>
> >>>
> >>>
> >>>
> >>>
> >>>generated html:
> >>>
> >>>
> >>>
> >>>
> >>>Page text  // from the page dispatcher
> >>>
> >>>Info servlet text   // from the infoservlet dispatcher
> >>>
> >>>Header form text // from the header.jsp dispatcher
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>-
> >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>
> >>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jsp include/RequestDispatcher incompatible?

2005-06-29 Thread Tim Funk
Try flush first, otherwise you might need to pass a 
HttpServletResponseWrapper() to include() where the wrapper oversrides 
getOutputStream() (or getWriter()


-Tim

George Finklang wrote:

So before each request dispatcher call I need to call a flush on the
out in the JspPage?  How do I get access to it?

Do I also need to call flush at the end of each request dispatcher call?

--George

On 6/28/05, Tim Funk <[EMAIL PROTECTED]> wrote:


The out from the jspwriter is NOT the same out as receieved by
response.getWriter();

The out in the JspPage is  buffered.

-Tim

George Finklang wrote:



have the following code in my jsp, which is called by a forward from my
Controller servlet. The various Dispatchers are either servlets or jsps declared
in my web.xml.

All the servlets and jsps get run correctly. The problem is the output. The
output of the root jsp and the 3-4 included jsps are arbitrarily rearranged, see
below. Bizarre shuffling, not reverse order, but a different order and not
interleaved with the text from the jsp.

If I translate the jsp into servlet code, and use RequestDispatchers
for all the components,
the page works.  The documentation says something about flushing buffers, but I
can't see how to do this with RequestDispatchers.


Code:



<% if(option1) {
   application.getNamedDispatcher("Option1Servlet").include(request,response);
   } else { %>

<% if(option2) { %>
<%

application.getNamedDispatcher("Option2Servlet").include(request,response);
%>
<%  } %>
<%
  application.getNamedDispatcher(page).include(request,response); %>
<%
  application.getNamedDispatcher("InfoServlet").include(request,response);
%>

<%  } %>




generated html:




Page text  // from the page dispatcher

Info servlet text   // from the infoservlet dispatcher

Header form text // from the header.jsp dispatcher










-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jsp include/RequestDispatcher incompatible?

2005-06-29 Thread George Finklang
So before each request dispatcher call I need to call a flush on the
out in the JspPage?  How do I get access to it?

Do I also need to call flush at the end of each request dispatcher call?

--George

On 6/28/05, Tim Funk <[EMAIL PROTECTED]> wrote:
> The out from the jspwriter is NOT the same out as receieved by
> response.getWriter();
> 
> The out in the JspPage is  buffered.
> 
> -Tim
> 
> George Finklang wrote:
> 
> > have the following code in my jsp, which is called by a forward from my
> > Controller servlet. The various Dispatchers are either servlets or jsps 
> > declared
> > in my web.xml.
> >
> > All the servlets and jsps get run correctly. The problem is the output. The
> > output of the root jsp and the 3-4 included jsps are arbitrarily 
> > rearranged, see
> > below. Bizarre shuffling, not reverse order, but a different order and not
> > interleaved with the text from the jsp.
> >
> > If I translate the jsp into servlet code, and use RequestDispatchers
> > for all the components,
> > the page works.  The documentation says something about flushing buffers, 
> > but I
> > can't see how to do this with RequestDispatchers.
> >
> >
> > Code:
> >
> > 
> > 
> > <% if(option1) {
> > 
> > application.getNamedDispatcher("Option1Servlet").include(request,response);
> > } else { %>
> > 
> > <% if(option2) { %>
> > <%
> >
> > application.getNamedDispatcher("Option2Servlet").include(request,response);
> > %>
> > <%  } %>
> > <%
> >application.getNamedDispatcher(page).include(request,response); 
> > %>
> > <%
> >
> > application.getNamedDispatcher("InfoServlet").include(request,response);
> > %>
> > 
> > <%  } %>
> > 
> >
> >
> >
> > generated html:
> >
> > 
> >
> >
> > Page text  // from the page dispatcher
> >
> > Info servlet text   // from the infoservlet dispatcher
> >
> > Header form text // from the header.jsp dispatcher
> >
> >
> > 
> >
> > 
> > 
> > 
> >
> > 
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jsp include/RequestDispatcher incompatible?

2005-06-28 Thread Tim Funk
The out from the jspwriter is NOT the same out as receieved by 
response.getWriter();


The out in the JspPage is  buffered.

-Tim

George Finklang wrote:


have the following code in my jsp, which is called by a forward from my
Controller servlet. The various Dispatchers are either servlets or jsps declared
in my web.xml.

All the servlets and jsps get run correctly. The problem is the output. The
output of the root jsp and the 3-4 included jsps are arbitrarily rearranged, see
below. Bizarre shuffling, not reverse order, but a different order and not
interleaved with the text from the jsp. 


If I translate the jsp into servlet code, and use RequestDispatchers
for all the components,
the page works.  The documentation says something about flushing buffers, but I
can't see how to do this with RequestDispatchers.


Code:



<% if(option1) {
application.getNamedDispatcher("Option1Servlet").include(request,response);
} else { %>

<% if(option2) { %>
<% 
  
application.getNamedDispatcher("Option2Servlet").include(request,response);

%>
<%  } %>
<% 
   application.getNamedDispatcher(page).include(request,response); %>
<% 
   application.getNamedDispatcher("InfoServlet").include(request,response);

%>

<%  } %>




generated html:


 
 
Page text  // from the page dispatcher
 
Info servlet text   // from the infoservlet dispatcher
 
Header form text // from the header.jsp dispatcher
 
 

 




 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



jsp include/RequestDispatcher incompatible?

2005-06-28 Thread George Finklang
have the following code in my jsp, which is called by a forward from my
Controller servlet. The various Dispatchers are either servlets or jsps declared
in my web.xml.

All the servlets and jsps get run correctly. The problem is the output. The
output of the root jsp and the 3-4 included jsps are arbitrarily rearranged, see
below. Bizarre shuffling, not reverse order, but a different order and not
interleaved with the text from the jsp. 

If I translate the jsp into servlet code, and use RequestDispatchers
for all the components,
the page works.  The documentation says something about flushing buffers, but I
can't see how to do this with RequestDispatchers.


Code:



<% if(option1) {
application.getNamedDispatcher("Option1Servlet").include(request,response);
} else { %>

<% if(option2) { %>
<% 
  
application.getNamedDispatcher("Option2Servlet").include(request,response);
%>
<%  } %>
<% 
   application.getNamedDispatcher(page).include(request,response); %>
<% 
   application.getNamedDispatcher("InfoServlet").include(request,response);
%>

<%  } %>




generated html:


 
 
Page text  // from the page dispatcher
 
Info servlet text   // from the infoservlet dispatcher
 
Header form text // from the header.jsp dispatcher
 
 

 



 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]