• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Forward and include methods with WebSphere?

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I have two servlets,the first one is just simple forwad the request to the second one or include the response from the second one.
The problem is I'm getting this error:"Recursive error was detected".I run those servlets with Tomcat and they run fine.
also it seems to me i need to configure or set something with WebShpere to be able to do forward or include.
please any idea?
 
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Have u registered those servlets that u are using with the application in websphere ?? If not u need to go to the was console and register them with the app server.If u want i can give u the details.Regards,
Daman
 
Tom Barns
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Daman for your reply.
actually we did register them,and we run each of them by itself and they run,but we forward the request to the second servlet
we get that error(Recursion error) if we have PrintWriter out = res.getWriter(); statement,but if we comment that statement just we get to the point of forwarding statement adn it doesn't forward the request.
is there anything we need to set up to do forwarding with WebSphere?
thanks again.
 
daman sidhu
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tom,
I have used the forwarding of requests in websphere in the last project i did and this was how i did it, both of my servlets were registered in the same servlet engine,
RequestDispatcher rd=getServletContext().getRequestDispatcher("/MyServlet");
rd.forward(request,response);
Thats enough for forwarding it, if u have written the same then i dont think there should be any problem in forwarding requets, and yes i think u should not use the printwriter in the first servlet if u are forwarding the request to the second one, as the control gets trasferred, if u need to display some processing from the first one then attach it to the request using request.setAttribute("key",value) ;
and show that in the second servlet( or jsp) to which u are forwarding the control and get it there from request.getAttribute("key");
Hope this might be of help to solve ur problem.
Cheers,
Daman
 
Tom Barns
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks alot for your time.
I'm doing the same thing,but for some reason the forwarding neither including is working.i will keep working on it and see
what is going to happen.
thanks again.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tom,
In April 27th Post you mentioned that, "I run those servlets with Tomcat and they run fine.also it seems to me i need to configure or set something with WebShpere to be able to do forward or include. "

What is that Tomcat? Just i want to know about that.Can you help me?

 
I love a good mentalist. And so does this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic