This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request-dispatching in a POJO

 
Oliver Rensen
Ranch Hand
Posts: 109
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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
 
Pravin Jain
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • 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.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Satou and Pravin, thanks a lot for clarifying my doubts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic