Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resource not available

 
ankur tyagi
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying the example given in head first servlets & jsp book in the ch 3(mini mvc tutorial).
the form .html is working fine but when i click the submit button the following error is returned...

type Status report

message /beerv1/%E2%80%9DSelectBeer.do%E2%80%9D

description The requested resource (/beerv1/%E2%80%9DSelectBeer.do%E2%80%9D) is not available.
files are as follows..
form.html


web.xml


BeerSelect.java

I have the following directory structure under webapps/beerv1
form.html
WEB-INF
|_ web.xml
classes
|_ com
|_ example
|_web
|_ BeerSelect.class
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ankur tyagi wrote:

classes
|_ com
|_ example
|_web
|_ BeerSelect.class



you mean the class file is in web folder which under com/example ?

try this : <form method=”POST” action=”${pageContext.request.contextPath}SelectBeer.do”>

 
ankur tyagi
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, that is how it was supposed to be...
i tried the way you said but the problem still exists
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

sorry!in my previous post, action=”${pageContext.request.contextPath}SelectBeer.do”> it is missing "/" before the SelectBeer.do


 
ankur tyagi
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
still not working....
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm suspicious of the quotes in the HTML page--what did you use to create the file?

My suspicions are even *more* aroused by the nature of the error message--see all those special, URL-encoded characters? See in your post how the quotes in the JSP code are different than in the Java code?

Boo ya!
 
ankur tyagi
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent catch man..
i created that file in notepad...
i don't know why that was a problem (different quotes in different editors.)
it works now...after i changed quotes in textpad.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chalk up another victory over those accursed MS "smart" punctuation characters.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic