This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How does a ServletRequest get created

 
Barry Gold
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I started looking at the class definitions for ServletRequest and I'm mystified about where you get one from. The list of "All Known Implementing Classes" for ServletRequest is ServletRequestWrapper, and similarly the only implementing class for HttpServletRequest is HttpServletRequestWrapper.

The two wrapper classes have only one constructor. That constructor requires a ServletRequest, which cannot be null.

So I downloaded the Tomcat sources and started grepping for classes that implemented ServletRequest or HttpServletRequest. *Every* single class I could find that implements the ServletRequest interface (or a subinterface) uses the same paradigm and either is or "extends" one of the above wrapper classes.

So you need to have a ServletRequest in order to create a ServletRequest.

Where does the ServletRequest come from?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look in the connector packages.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic