• Post Reply Bookmark Topic Watch Topic
  • New Topic

Head first servlets & JSP example doesn't work  RSS feed

 
zhang zhiwei
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I’m reading the book "Head first servlets & JSP" and using tomcat 9, jdk8,eclipse neon.

when i submit the form,The servlet is not working.I am getting an error:"HTTP Status 500 - Error instantiating servlet class com.example.web.BeerSelect".i found that the BeerSelect.class was not compiled.

when i compile the BeerSelect.java manually, it can work fine.

what's the problem?

this is my HTML code(form.html)


this is my web.xml



This is my servlet(BeerSelect.java)



the attachment is my workspace
-6XA5-KJ-52-9-)8)3R9DTP.png
[Thumbnail for -6XA5-KJ-52-9-)8)3R9DTP.png]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
144
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The servlet container isn't going to compile the class automatically. You need to do that before deploying.

Or is this an IDE problem you are asking about?
 
zhang zhiwei
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it worked.it's an IDE problem.The classpath is not set correctly and the "javac" is not working.now it can compile automatically.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!