• Post Reply Bookmark Topic Watch Topic
  • New Topic

request handler should be used in which situation?  RSS feed

 
kae ri
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in our program spec.,
we both use servlets and jsp
we control main servlet for all entry(all requests)
some requests need RequestHandler class, and some dont.
i cant decide how to decide to use this kind of hanlder classes.
where should i use handler classes?

thankz in advance..

with regards.
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a matter of your choice.

I would create a 'Request Handler' class for nearly all request processing.

This way you can have a single servlet handling many different types of requests by passing the request to appropriate handler, without making the servlet too complicated or hard to maintain.

HTH
 
kae ri
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sonny Gill

we use Jsp for interface,
and we aslo use RequestHandler class for some requests, but not all.
In our jsp pages, we also use custom tags for DB access.
So i cant decide where to use RequestHandler classes.
************************************************************
//sample
if ( currentRequestRequireHandlerClass==true)
{ //do Hanlding routines
}
//then
getServletContext().getRequestDispatcher("targetJSP.jsp").forward(request, response);//redirect
*******************************************************************
thankz Sonny Gill
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!