• Post Reply Bookmark Topic Watch Topic
  • New Topic

HFSJ Question  RSS feed

 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 3015
236
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't make your Servlet class with a default modifier!

change

into


Regards,
Frits
 
Roel De Nijs
Sheriff
Posts: 11338
177
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And as a side remark: class names should start (according to the code conventions) with a capital case.
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 3015
236
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 3015
236
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 611
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 3015
236
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys, I will keep that in mind!

Frits , I am enjoying your notes
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 3015
236
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!