Gaël Oberson wrote:

>
>
>      [Gaël Oberson] > I think HttpServletRequest inherits
>      getRequestDispatcher(..) from ServletRequest class and does
>      implement it. [Gaël Oberson] > You can also get the
>      RequestDispatcher object from ServletContext
>
>      Yes, you're right, but it's not what I want to do. the
>      forward method sends the request and response objects to
>      another servlet or jsp, and the response is entierely
>      created by the second servlet.
>
>      The incude method "concatenates" the ouput from servlet 1 &
>      servlet 2 in the same response object.
>
>      But, in my case, the servlet 1 generates dynamic XML from a
>      database, and the servlet 2 (Cocoon) generates HTML FROM
>      servlet1's XML data...
>
>      Do you see what I mean? The data is processed twice!
>
>      Ok. And now how to do that????
>
>      The first that can provide me a working solution wins a
>      beer...
>
>
>
>      Thx.
>
[...]


Hi :-)  first, the most important, we must make the following clear:
:-)
 - if I have n ideas, can I have n beers?   if(not), return;     :-)
 - if my ideas are all not right, but because they are more than one,
   and I type a lot of words with keyboard, so can  I also have 1 beer?
   if(not), return;     :-)

I am not sure, I have some suggestions:
* use
   - ServletContext.getAttribute(...)/setAttribute(...)
     and
  - RequestDispatcher/sendRedirect
  to pass the XML data from MyServlet0 to MyServlet1

* use
 - HttpSession.getAttribute(...)/setAttribute(...)
     and
  - RequestDispatcher/sendRedirect
  to pass the XML data from MyServlet0 to MyServlet1

* use
  - (Http)ServletRequest.getAttribute(...)/setAttribute(...)
     and
  - RequestDispatcher/sendRedirect
  to pass the XML data from MyServlet0 to MyServlet1

* use
 - MyHelper which is loaded by Shared classloader to save data
     and
  - RequestDispatcher/sendRedirect
  to pass the XML data from MyServlet0 to MyServlet1

* and from several emails, perhaps it is better to make the object which
"wrap" the XML
   data Serializable.

* another "non-OO" way is : if it is possible to "put" the XML
   data in a String which is not very long, we also can use:
   RequestDispatcher
rd=request.getRequestDispatcher("/servlet/MyServlet1?tailPxml=...");
   rd.forward(request, response);

my most favorate bear brand is ... //hahahahaha :-)

Bo
Apr.05, 2001


Reply via email to