This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes HttpServletRequest Class methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpServletRequest Class methods" Watch "HttpServletRequest Class methods" New topic
Author

HttpServletRequest Class methods

Sumi Festus
Greenhorn

Joined: Feb 04, 2005
Posts: 14
Hi!! I was just reading through some servlet class and came across this code: Principal principal=req.getUserPrincipal();

Here req is an object of the HttpServletRequest class. principal is an object of the java.security.Principal.

Is the getUserPrincipal() method implemented in the HttpServletRequest class? I read the sun techdocs and couldnt find the method listed in the HttpServletRequest class.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

It is defined in the HttpSerlvetRequest interface :
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html


[My Blog]
All roads lead to JavaRanch
Sumi Festus
Greenhorn

Joined: Feb 04, 2005
Posts: 14
Thanks a lot.....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HttpServletRequest Class methods