Can anybody help me out? I'm getting a 404 error and 'requested resource (/Beer-v1/SelectBeer.do) is not available.' when I run the following servlet:
Here's the html:
and the servlet code:
Here is the deployment structure:
I'm using tomcat7, here's what I've tried so far:
*Altering the code at the start of the xml file to a more recent version than mentioned in the book. (no effect)
*Moving the entire Beer-v1 folder and all it's contents to /var/lib/tomcat7/webapps/ (html not found)
*Trying to install tomcat 5.5 (couldn't get it to work)
Does anyone have any ideas?
Billy Sclater wrote:@Bear
Ok, I moved the whole thing to under 'webapps' and out of 'ROOT'.
The 'form.html' is in:
I get this error message:
The requested resource (/Beer-v1/form.html) is not available.
Try clearing out the tomcat cache and restart Tomcat.
I now get this:
javax.servlet.ServletException: Error instantiating servlet class com.example.web.BeerSelect
java.lang.UnsupportedClassVersionError: com/example/web/BeerSelect : Unsupported major.minor version 51.0 (unable to load class com.example.web.BeerSelect)
when I click on the submit button on my html page!
I forgot to mention that I also changed the web.xml file. The book uses tomcat 5, and the 'bit of code at the top of the file' reflects that. Here is the original web.xml:
I used the xml code from the web.xml file that came with tomcat7. I took the 'few lines at the top of the file', and replaced the first version. Here is the new (working) web.xml:
Anyway, thanks for your help!
I can go and get some sleep now!!