This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes HTTP Status 404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP Status 404" Watch "HTTP Status 404" New topic
Author

HTTP Status 404

Mohamed aboelnour
Greenhorn

Joined: Dec 20, 2009
Posts: 2
Peace be upon you:

hi all,

I'm new in the Java web programing so I installed Netbeans 6.7.1 to work with Java EE and Tomcat.
I Wirte A simple Code in index.jsp

and I Write A Servlet class:


When I Run the index.jsp appear and I entered a String in the text Field and press the Button
It Supposed to print "hi,"+ the String
But this appear:

Any help is appreciated.
Thanks in advance.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Where's your web.xml file and the servlet mapping?

It's also unusual to use .java as the servlet extension.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61103
    
  66

Are you running this within the IDE?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vinoth Thirunavukarasu
Ranch Hand

Joined: Dec 18, 2008
Posts: 164

See the servlet examples, webapps folder use the same thing to configure your servlet.
Good Luck


Java Best Practices
Linux Best Practices
Amortization Calculator

Sandeep Swaminathan
Ranch Hand

Joined: Apr 23, 2008
Posts: 52
In the ACTION attribute of FORM TAG you are supposed to use only the name mentioned in the <URL-MAPPING> of the WEB.XML file
That is


Also make sure in the ACTION attribute you give something like this



Music is all around us. All you have to do is just LISTEN to it,
Sandeep Swaminathan
Mohamed aboelnour
Greenhorn

Joined: Dec 20, 2009
Posts: 2
Sandeep Swaminathan wrote:In the ACTION attribute of FORM TAG you are supposed to use only the name mentioned in the <URL-MAPPING> of the WEB.XML file
That is


Also make sure in the ACTION attribute you give something like this




thanks it works

thanks to every one Reply to my problem.

Can Any one advice to me a good reference to Servlet and JSP?
thanks in advance.
Man Kin Lo
Greenhorn

Joined: Dec 21, 2009
Posts: 1
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
This should provide you the basic understanding to JSP and Servlets. Good luck.
jyeshta dochi
Greenhorn

Joined: Oct 14, 2008
Posts: 1
you have specified url in form->action "web-inf/newfile.java". note that you have specified url and not servlet.Please avoid that and jus give some name: "/newfile".this url shud be mapped in web.xml


<servlet>
<servlet-name>/newfile</servlet-name>
<servlet-class>NewFile</servlet-class> :NewFile is Servlet here
</servlet>

<servlet-mapping>
<servlet-name>Display</servlet-name>
<url-pattern>/newfile</url-pattern> :newfile is url here. Shud be specified in form action
</servlet-mapping>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 404