GeeCON Prague 2014*
The moose likes Servlets and the fly likes wrapper class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "wrapper class" Watch "wrapper class" New topic
Author

wrapper class

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026

When you subclass a wrapper class, you must override at least one of the wrapper class's methods.


I think this statement is false. Kindly correct me if I am wrong.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Sravan Kumar
Ranch Hand

Joined: Sep 11, 2005
Posts: 121
if you mean the wrapper classes in J2SE like Integer, Long et al, yes, the statement is wrong! They are final. Subclassing them is not possible.


keep smilin :: sravan<br /><a href="http://sravanpens.blogspot.com" target="_blank" rel="nofollow">I scribble here</a>
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
this one is regarding javax.servlet package wrapper classes.
Not the wrapper classes in Java SE ==>
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Maybe you could be a little more clear with your question. I'm not sure which wrapper classes you're referring to.

There is this though:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServlet.html
A subclass of HttpServlet must override at least one method, usually one of these... etc.
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Is the below statement true about servlet Wrapper Classes?

is the question. And this


When you subclass a wrapper class, you must override at least one of the wrapper class's methods.


is the given answer.

Now kindly tell me whether this option is correct.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by vishnu prakash:
Is the below statement true about servlet Wrapper Classes?

is the question. And this



is the given answer.

Now kindly tell me whether this option is correct.


Are you talking wrapper class like HttpServletRequestWrapper ?

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequestWrapper.html

The class is not abstract so there is no need to implement/overide any methods.


Groovy
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Thanks.
SunilRee Gupta
Greenhorn

Joined: Mar 03, 2005
Posts: 12
Yes You are right if you are talking with respect to javax.servlet.* Package. WE are having 4 Wrappers class.Generally used when you want to give your own implemetation for HttpServletRequest or HttpServletResponse methods.
 
GeeCON Prague 2014
 
subject: wrapper class