Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Headfirst ch3 Beerselect submit button not working

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Sheriff
Posts: 67619
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67619
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
reply
    Bookmark Topic Watch Topic
  • New Topic