Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Filter: Is it safe to always cast to HttpServletRequest?

843841Nov 16 2007 — edited Nov 16 2007
The doFilter method from the javax.servlet.Filter interface accepts a ServletRequest and a ServletResponse as seen below:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
My question is: Is it safe to assume that an instance of HttpServletRequest and HttpServletResponse will always be passed in as the request and response parameters? The Javadocs do not seem to mention anything of the kind. Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 14 2007
Added on Nov 16 2007
2 comments
1,294 views