Forums Register Login

MVC tutorial Head First

+Pie Number of slices to send: Send
Hi everybody,
i am trying to make MVC tutorial of Head Firts Ch 3.
I am at the step of checking the servlet whether it works or now.
but i what i see is page not found.SelectBeer.do is the url pattern.
Could you please help to to sove problem with web.xml mapping.
because i eveything what i need according to tutorial.
Thanks in advance
+Pie Number of slices to send: Send
No one here is clairvoyant. Please show us your setup and mappings.
+Pie Number of slices to send: Send
It will be better for us if you provide the code
+Pie Number of slices to send: Send
ok
the path :
http://localhost:8080/Beer-V1/form.html works well.
When i try to submit : here you are the web.xml detail



i am getting the error like this :

HTTP Status 404 - /Beer-V1/%E2%80%9DSelectBeer%E2%80%9D
type Status report

message /Beer-V1/%E2%80%9DSelectBeer%E2%80%9D

description The requested resource (/Beer-V1/%E2%80%9DSelectBeer%E2%80%9D) is not available.


When i try to directly use the link:
http://localhost:8080/Beer-V1/SelectBeer

i got this :
HTTP Status 405 - HTTP method GET is not supported by this URL

here you are the web diractory structure:
form.html is in C:\Tomcat 5.5\webapps\Beer-V1

web.xml is in
C:\Tomcat 5.5\webapps\Beer-V1\WEB-INF

What can be the problem.


+Pie Number of slices to send: Send
<url-pattern>/SelectBeer</url-pattern>

it will be

<url-pattern>/SelectBeer.do</url-pattern>
+Pie Number of slices to send: Send
The 'action' value of your <form> is wrong. It should cover the exact url-pattern of the servlet.
+Pie Number of slices to send: Send
thanks for quick reply
my html is

and i ahve changed the web xml to


and i am gettin the same error

type Status report

message /Beer-V1/%E2%80%9DSelectBeer.do%E2%80%9D

description The requested resource (/Beer-V1/%E2%80%9DSelectBeer.do%E2%80%9D) is not available.
+Pie Number of slices to send: Send
web xml also SelectBeer.do

i am sorry for old file.
+Pie Number of slices to send: Send

Change your XML from



TO

+Pie Number of slices to send: Send
please see my las message i
I have already changed
+Pie Number of slices to send: Send
You're using curly quotes instead of straight quotes. See, even the syntax highlighter borks on it, it doesn't color the values blue.

Use those quotes ".
+Pie Number of slices to send: Send
Coulr you please expla'n me why the error 's wr'tten
type Status report with characters

%E2%80%9D



message /Beer-V1/%E2%80%9DSelectBeer.do%E2%80%9D

description The requested resource (/Beer-V1/%E2%80%9DSelectBeer.do%E2%80%9D) is not available.

+Pie Number of slices to send: Send
please show your servlet class
+Pie Number of slices to send: Send
Bauke you have done great.
it was beacues of qoutos.
now it works.
urrraaaaa

But why then browser didnot give any error about this quotos
+Pie Number of slices to send: Send
You're welcome.

You won't get an error because the straight quotes are fully optional. Those curly quotes are just seen as actual part of the value. As those curly quotes aren't part of the basic ASCII charset, they got URL encoded before sending to the server side. More about URL encoding: http://www.w3schools.com/TAGS/ref_urlencode.asp
+Pie Number of slices to send: Send
Thanks a lot
+Pie Number of slices to send: Send
Oh, when I said optional, I do not necessarily mean that you should omit them. Always use them. Not only for readability, but also to avoid problems if you have spaces in the value. E.g. would only pick the value "foo" while would pick the full value "foo bar".
+Pie Number of slices to send: Send
ok
i got it
thanks again
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2681 times.
Similar Threads
Servlet, JSP, MySQL webb app
Error The requested resource is not available
MVC implementation?
Need Spring Tag lib example
Getting problem with post method
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:58:32.