aspose file tools*
The moose likes Servlets and the fly likes Resource not available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Resource not available" Watch "Resource not available" New topic
Author

Resource not available

ankur tyagi
Ranch Hand

Joined: Apr 01, 2009
Posts: 49
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

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Apr 01, 2009
Posts: 49
yes, that is how it was supposed to be...
i tried the way you said but the problem still exists
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575


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


ankur tyagi
Ranch Hand

Joined: Apr 01, 2009
Posts: 49
still not working....
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Apr 01, 2009
Posts: 49
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

Joined: Mar 22, 2000
Posts: 12823
    
    5
Chalk up another victory over those accursed MS "smart" punctuation characters.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resource not available