File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Headfirst ch3 Beerselect submit button not working

 
Albert Park
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone! I just started learning servlets and I am very new to this field.
I have been stuck on ch3 at Beerselection page for past 3 days. I know there were a lot of threads that cover this topic, and i tried everything that I could find but for some reason, the submit button still throws error.

Here are my codes and I set up development and deployment environment exactly like the book says.

Please help me.

here is the web.xml



here is form.html



Here is BeerSelect.java


error that shows

HTTP Status 404 - /Beer-v1/SelectBeer.do

type Status report

message /Beer-v1/SelectBeer.do

description The requested resource (/Beer-v1/SelectBeer.do) is not available.
Apache Tomcat/5.5.34



 
Tarun Bolla
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see no problem ... It should work. Are you using an IDE? In case if you are not, are you following the package structure correctly?
 
Albert Park
Greenhorn
Posts: 28
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.
I am just running this on Ubuntu terminal.

my DD structures are like this.

--tomcat
-----webapps
---------Beer-v1
------------form.html
------------WEB_INF---web.xml
---------------------------classes---com---example---model---web---BeerSelect.class
---------------------------lib



--MyProjects
----beerV1
------classes--come---example---model
------------------------------------- ---web----BeerSelect.class
------etc---web.xml
------lib
------src---com---example---model
------------------------------- ---web---BeerSelect.java
------web---form.html


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to be missing the classes folder in WEB-INF. The com root of your package hierarchy belongs there, not directly under WEB-INF.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, I see you have ninja-edited to add that in.

And, it's WEB-INF, not WEB_INF.
 
Albert Park
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Ah, I see you have ninja-edited to add that in.


ahhh yes, i edited it. anything else you see that is wrong here?
 
Albert Park
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Ah, I see you have ninja-edited to add that in.

And, it's WEB-INF, not WEB_INF.


OMG! I would've never found that.
YES! now it's working.

Thanks for the help!!

 
Tarun Bolla
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Typical Web App Structure would be
App
  +WEB-INF
    +lib
       -JAR1 et.,
    +classes
       +com
        +example
           +model
              -BeerSelect.class
    -web.xml
  -JSP1
  -JSP2
  -form.html et.,
Those preceding '+' are folders.. '-' are files
 
Albert Park
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tarun Bolla wrote:Typical Web App Structure would be
App
+WEB-INF
+lib
-JAR1 et.,
+classes
+com
+example
+model
-BeerSelect.class
-web.xml
-JSP1
-JSP2
-form.html et.,
Those preceding '+' are folders.. '-' are files


I just found a thread w/ '-' sign to write their structures, so I thought I'd use that.
I will take your advice next time.
Thank you.
 
Tarun Bolla
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Albert Park wrote:I just found a thread w/ '-' sign to write their structures, so I thought I'd use that

Its your call... I've just provided a legend for my structure....
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic