aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ Question" Watch "HFSJ Question" New topic
Author

HFSJ Question

Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
Hi !

This is one of the questions from HFSJ ,which i was trying out.
I am getting error "

error instantiating servlet class com.attTester '
root cause
java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class com.attTester with modifiers "

I am not sure what's wrong with the coding or if i a m missing something...

attTester.java


attListener.java

And finally my web.xml

Can some one please have a look and help me out.. Thanks!


The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1716
    
  25

You can't make your Servlet class with a default modifier!

change

into


Regards,
Frits
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5536
    
  13

And as a side remark: class names should start (according to the code conventions) with a capital case.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
Thanks ! that worked.

I am getting a little confused. So after making the necessary changes and some extra ones to remove confusion , when i type


I get a blank page and get the out put in my log .

However , when i type
( with out the .do extension)

I get requested resource not available.

What exactly is the significance of the .do extension , and why is it making a big difference?
And more importantly which one is correct?
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1716
    
  25

probably you mean
as attTest.do is in the <servlet-mapping> element of your web.xml

The ".do" is not important, it can also be ".ti" or without an extension. You specify what is needed for mapping in the <url-pattern>

Have you read the URL mapping rules in the book?

Regards,
Frits
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
I am getting different results with and with out the extension.....

So far URL Mapping has been mentioned , but there's nothing about it in great details. May be it will be mentioned in details further ahead or may be i ll just google it !

Thanks!
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1716
    
  25

Be careful: sometimes the web-browser caches the result. Just close your browser everytime you change something.

Regardsing the URL mapping: have a look at my notes chapter 2.3

Regards,
Frits
Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

Frits Walraven wrote:Be careful: sometimes the web-browser caches the result. Just close your browser everytime you change something.


Hard-refresh (ctrl + F5 in FF) works for me in this case :-)

Cheers!


OCP Java SE 6 Programmer, OCM Java SE 6 Developer, OCE Java EE 6 JSPSD, OCE Java EE 6 EJBD, OCE Java EE 6 JPAD, Spring 3.0 Core Professional.
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1716
    
  25

Hard-refresh (ctrl + F5 in FF) works for me in this case :-)

Yes, I also use that and sometime multiple times....
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
Thanks guys, I will keep that in mind!

Frits , I am enjoying your notes
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1716
    
  25

Frits , I am enjoying your notes

You are welcome

If you find any mistakes or if you have some remarks, please feel free to write them.

Regards,
Frits
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HFSJ Question