Bug 36150 - Redirects requred when transitioning between RDC pages using Websphere 6.0.2
Summary: Redirects requred when transitioning between RDC pages using Websphere 6.0.2
Alias: None
Product: Taglibs
Classification: Unclassified
Component: RDC Taglib (show other bugs)
Version: 1.0
Hardware: All All
: P1 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2005-08-11 21:47 UTC by stu robertson
Modified: 2005-08-18 01:07 UTC (History)
2 users (show)

RAD 6 projects demonstrating this issue. To be run in WAS 6.0.2 test environment (39.28 KB, application/zip)
2005-08-11 22:48 UTC, stu robertson
Corrected version of first.jsp from earlier attachment (706 bytes, application/octet-stream)
2005-08-18 08:57 UTC, Rahul Akolkar

Note You need to log in before you can comment on or make changes to this bug.
Description stu robertson 2005-08-11 21:47:03 UTC
Here are the steps to reproduce the error, using Struts (though the issue is not

* Voice browser submits back to JSP 1 when input matches the grammar in the RDC.
 The RDC now has correct input, and an rdc:struts tag forwards to Struts action 1.

* Struts action 1 does whatever it needs to in response to the input, then
forwards to Struts action 2 for the next page/step.

* Struts action 2 forwards to the JSP for step 2.

Expected behavior:

The second JSP renders and the voice browser correctly interprets the second
page and its RDC.  (Note, if the voice browser is pointed directly to page 2,
this page functions correctly).

Actual behavior:

The voice interpreter (one provided in IBM Voice Toolkit 6.0) complains that
"Msg   : The markup in the document following the root element must be well-formed."

Additional details (current workaround we are using):

Using redirects to transition between JSP pages fixes the symptoms.  In the
above example, if Struts action 1 redirects to Struts action 2 (so the voice
interpreter issues a new request for the next page) the symptoms disappear and
the application works properly.

I believe this is due to JspWriter buffer flushing issues, where content from
the partial rendering of Jsp 1 is not properly cleared before the rendering of
Jsp 2.  Looking over the JSP 2.0 specification, section 5.5 (page 1-111) states
that when using jsp:forward, any buffered content must be flushed by the
container prior to forwarding the request.  I was not able to find a similar
requirement for the use of RequestDispatcher.forward, which is what
rdc:struts-submit uses.

I don't know if this is a bug in WebSphere 6.0, and error I am making, or if
this basic usage pattern in RDCs is not compatible with the specification.  I've
created a simple example case to demonstrate the problem, and will try to attach
it to this report.  It's 3.6 Megs, so if that's too big, I'll have to find some
other way to submit it.
Comment 1 stu robertson 2005-08-11 22:02:58 UTC
I tried attaching a test case (RAD 6 project) but it is too large.  So I emailed
this to Rahul instead.  If we need it here, I could take out all of the jars,
and it should be small enough at that point.
Comment 2 stu robertson 2005-08-11 22:48:57 UTC
Created attachment 16015 [details]
RAD 6 projects demonstrating this issue.  To be run in WAS 6.0.2 test environment

Inside this zip there are two RAD 6 projects containing a simple test case
showing these symptoms.  1 Web project, and the EAR project required by
WebSphere.  You should be able to load them into your workspace using File ->
Import -> Existing Project into Workspace.  I've removed the jars from
WEB-INF/lib to make the attachment small enough to submit.  There's an image in
WEB-INF/lib showing what jars must be in the directory for the application to
work properly.

There are 2 simple Struts actions, FirstAction and SecondAction, and their JSPs
are first.jsp and second.jsp.  If you point the voice interpreter to
/first-action.do, you will be prompted for a single digit.  Upon entering 1
digit, the RDC will forward to first-action.do.  FirstAction will then forward
to second-action.do, which forwards to second.jsp.

It is the rendering of second.jsp that fails for us.

To see how redirection changes the symptom, there is a flag in FirstAction
called USE_REDIRECTS.  Setting this to true uses redirection to transition to
the next page.	This works for us, and is the way we transition between all of
our pages as a workaround to this issue.
Comment 3 Rahul Akolkar 2005-08-18 08:57:05 UTC
Created attachment 16087 [details]
Corrected version of first.jsp from earlier attachment
Comment 4 Rahul Akolkar 2005-08-18 09:07:20 UTC
Thanks for taking time to put together the simple test case.

The <rdc:struts-submit> tag should be used after the last bit of template text 
in the JSP (i.e. in this case, after </vxml> in first.jsp - I've attached a 
corrected first.jsp to this ticket few minutes ago - and tried your test case 
successfully on Tomcat 5.0.28 and WAS 6.0.2).

I'll take responsibility for the lack of documentation, and add a note to the 
StrutsInterface tutorial on the wiki in a day or two, unless you beat me to it.