| Author |
Headfirst ch3 Beerselect submit button not working
|
Albert Park
Greenhorn
Joined: Feb 01, 2012
Posts: 5
|
|
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
Joined: Jun 20, 2011
Posts: 85
|
|
|
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
Joined: Feb 01, 2012
Posts: 5
|
|
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 opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50693
|
|
|
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.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50693
|
|
Ah, I see you have ninja-edited to add that in.
And, it's WEB-INF, not WEB_INF.
|
 |
Albert Park
Greenhorn
Joined: Feb 01, 2012
Posts: 5
|
|
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
Joined: Feb 01, 2012
Posts: 5
|
|
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
Joined: Jun 20, 2011
Posts: 85
|
|
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
Joined: Feb 01, 2012
Posts: 5
|
|
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
Joined: Jun 20, 2011
Posts: 85
|
|
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....
|
 |
 |
|
|
subject: Headfirst ch3 Beerselect submit button not working
|
|
|