"Esposito, Francis (Exchange)" wrote:

> We are in the process of designing a servlet framework to deal with common
> issues of our business servlets, like authentication, authorization,
> logging, etc.  In the design of the framework, we are considering a class
> hierarchy which provides these capabilities and also provides hook functions
> where subclasses can concentrate on the business logic.  In designing this
> it seems that be able to replace the HttpRequest and HttpResponse objects
> with our own subclassed version would allow us to create a more intuitive
> design.
>
> Does the Servlet API provide the ability to supply factory classes for the
> creation of these objects?
>

The servlet API does not include factory methods for the creation of request and
response objects.  The reason is that the internals of the implementation
classes (remember, HttpServletRequest and HttpServletResponse are interfaces,
not classes themselves) depend very much on other internals of the servlet
engine you are using.  You would need to modify the servlet engine to accomplish
this (not impossible, if you started from an open source implementation, but not
a good idea because it makes you non-portable).

IMHO you should rethink your design.  Plenty of useful and elegant frameworks
have been built on top of the servlet API as it stands, without needing this
sort of modification.  You might also see if storing user objects as request
attributes (ServletRequest.setAttribute()) does what you need for providing
application-specific information.

Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to