• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Request-dispatching in a POJO

 
Ranch Hand
Posts: 109
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ranchers,

I have a question about request-dispatching.

Within a servlet we can forward to a JSP-page:
RequestDispatcher disp =
request.getRequestDispatcher("result.jsp");
disp.forward(request, response);

Is it possible to do the same dispatching in a POJO? The servlet calls a POJO and the POJO dispatches to another JSP.

In real-world-projects, what is usually the approach to dispatch to JSPs? Within servlets or within POJOs?

Regards
Oliver
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you could pass the ServletRequest and ServletResponse objects to the
POJO, then it is alwyas possible for the POJO to forward to the JSP.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In real-world-projects, what is usually the approach to dispatch to JSPs? Within servlets or within POJOs?


Within servlets. With a Front Controller and Commands (also named Action in the Struts world)
There's an article about this in the Journal : http://www.javaranch.com/journal/200603/Journal200603.jsp#a5
[ May 27, 2007: Message edited by: Satou kurinosuke ]
 
Oliver Rensen
Ranch Hand
Posts: 109
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Satou and Pravin, thanks a lot for clarifying my doubts.
 
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic