aspose file tools*
The moose likes Servlets and the fly likes Headfirst ch3 Beerselect submit button not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Headfirst ch3 Beerselect submit button not working" Watch "Headfirst ch3 Beerselect submit button not working" New topic
Author

Headfirst ch3 Beerselect submit button not working

Albert Park
Greenhorn

Joined: Feb 01, 2012
Posts: 28
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: 89
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: 28
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

Joined: Jan 10, 2002
Posts: 61426
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

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: 28
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: 28
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: 89
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: 28
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: 89
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....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Headfirst ch3 Beerselect submit button not working