Lalitha Mouli

Greenhorn
+ Follow
since Oct 31, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lalitha Mouli

a. Can the listener class have a non default constructor and an unaccessible default constructor (say provat etc.). In this case how would the listener code get fired?



Hi,
The listener class cannot have an unaccessible default constructor, I think it is because the container uses Reflection to instantiate the class, In case of tomcat , the application intialization itself fails , with the following message.

java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardContext can not access a member of class com.example.ReqAttrListener with modifiers "private"

Cheers
mouli
SCJP1.4 SCWCD1.4(preparing)
It can be either way, if you specify <load-on-startup> in your DD(web.xml) with a a value greater than zero, then the container will instantiate and make the servlet ready to service requests. Whereas if you don't specify the above mentioned tag, the first request intiates the process.

Cheers
mouli.
Hi ,

The container always looks for a class either under WEB-INF/classes or under WEB-INF/lib/<*.jar> files. If you look at the DDin web.xml, it is a fully qualified class name, say for example if your servlet class name foo.bar.Happy.class
the dir structure will look like WEB-INF/classes/foo/bar/Happy.class

Cheers
SCJP1.4 SCWCD1.4 (preparing)
Hi Sharanya,

As we know the implicit object "initparam" references to the context init param. I was curious to know how do we get config(mapped to JSP in the DD) init params through EL implicit objects.


Do you mean to ask, how would you retrive initparams that are mapped to a particular servlet (instead of context param which is for the entire web app), I mean a servet name mapped to a JSP which contains init param ?

For Question 2, I think "no arg constructor " means, a constructor without any parameters/arguments, I do see one in line 4. The compiler provides one, only if you have no constructors at all. Makes sense ?


Please correct me if i am wrong....

Cheers
mouli
SCJP1.4 SCWCD1.4 (preparing...)
In general JAVA_HOME should point to the root directory of the Java installation, in your case it would be "C:\Program Files\Java\j2sdk1.4.2_03"

And with respect to Tomcat, it should be "C:\Program Files\Canto\Tomcat\"

Cheers
mouli.