Alen Mester wrote:First my servlet was in a default package so now is in a name package called "Servlet"
A poor choice. Firstly, package names should be all lowercase by convention. Secondly, "servlet" doesn't really say anything really. Try to use more descriptive package names (and which should follow the URI convention).
With regards to the action, is "SendRedirect" the context path of the application? If so, then the context path is "/SendRedirect" with a leading slash. Anything without a leading slash is page-relative and almost guaranteed to cause problems.
You should also obtain the context path programmatically from the request and not hard-code it anywhere.
The server looks through your <servlet-mapping> elements until it finds one with <url-pattern> matching "/search". This gives it a servlet name of "SendRedirect". It then looks through your <servlet> elements until it finds one with <servlet-name> matching "SendRedirect". This tells it what the class of the servlet is; this should be "Servlet.Search".
The URL in your form should be the name of the application followed by the url-pattern in that previous paragraph. You don't specify the servlet's class name here, you specify a url-pattern and let the server resolve that to the class's name as I described.
posted 9 years ago
Please dont kill me
I somehow undersand the tips but it still dont work the program
the package name in lowercase ready set and go called "servlet" with the servlet class inside name "Search.java". I know is poor name but it will change after the project is working.
the action name :
Option A) action="/SendRedirect/servlet.search">
Option B) action="/SendRedirect/servlet/search">
Option C) action="/servlet.search">
Option D) action="/servlet/search">
I am reading yours post one and one more time to get it
to say I'm sorry. In the program I'm on it, was an error on my own. two web.xml were created of nowhere that did the error. Also I will take the tips you give me and to be more careful the next time.
the extension ".do" help me as well. But I have a last question for this topic. this ".do" that works on jsp(web) and sruts projects is the easy way or the right way to develop web projets and any diferents??