Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Creating Web application
Creating Web application [message #859060] Fri, 27 April 2012 08:41 Go to next message
uma raman is currently offline uma raman
Messages: 2
Registered: April 2012
Junior Member
Hi all, I am new to eclipse.

I am creating web application using jsp , servlet, tomcat V7 in ecplise. Now i have an error report HTTP Status 404 - /SampleWebApp/AddUser. while trying to submit my jsp form to addUser servlet.

project name: SampleWebApp.
servlet name: AddUser.(Java Resources/src/com/Adduser.java)
Jsp: Addjsp1.jsp(webContent/Addjssp1.jsp)

Please help me to fix my error
Re: Creating Web application [message #859484 is a reply to message #859060] Fri, 27 April 2012 13:02 Go to previous messageGo to next message
Nitin Dahyabhai is currently online Nitin Dahyabhai
Messages: 1850
Registered: July 2009
Senior Member
Needs more details. What steps have you taken that have you expecting it to work? How was the Servlet created? Are you trying to use a mapping that doesn't exist in the web.xml file or as an annotation?

---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Creating Web application [message #861003 is a reply to message #859484] Sat, 28 April 2012 06:10 Go to previous message
uma raman is currently offline uma raman
Messages: 2
Registered: April 2012
Junior Member
Hi Nitin thank you for ur response. Here are the details.

Currently I am creating a web application with servlet,jsp, technologies and tomcat v7 server using Eclipse IDE on linuxmint OS.
While submit my form i got this error.



http//localhost:8080/SampleWebApp/AddUser

HTTP Status 404 - /SampleWebApp/AddUser

type Status report
message /SampleWebApp/Add
description The requested resource (/SampleWebApp/Add) is not available.
Apache Tomcat/7.0.12

web.xml

<?xml version="1.0" encoding="UTF-8"?>

<display-name>SampleWebApp</display-name>
<servlet>
<servlet-name>AddUser</servlet-name>
</servlet>
<servlet-mapping>
<servlet-name> AddUser</servlet-name>
<url-pattern>/SampleWebApp/Add</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app


Addjsp1.jsp (Stored in: SampleWebApp/WebContent)

<%@page import="com.*;"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>

<html>

<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head><body>
<form name="userform" method="post" action="Add">
<table>
<tr><td> <td align= "center">AddUser</td></tr>
<tr><td>FirstName</td><td><input type="text" name="first_name" value=""></td></tr>
<tr><td>LastName</td> <td> <input type="text" name="last_name" value=""></td></tr>
<tr><td>UserName</td><td> <input type="text" name="user_name" value=""></td></tr>

<tr><td>Country</td><td> <input type="text" name="country" value=""> </td></tr>
<tr><td>Password</td><td> <input type="text" name="password" value=""> </td></tr>
<tr><td></td>
<td input type="button" name="save" ></td><td><input type="submit" name="Submit" value="Save" style="background-color:#49743D;font-weight:bold;color:#ffffff;"></td></tr>
</table></form></body></html>

Servlet: AddUser.java (located in: SampleWebApp/JavaResources/src/com)

tomcat Located in: home/apache-tomcat-7.0.27-src

umaraman
Previous Topic:Adding multiple native libraries
Next Topic:eclipse-jee-indigo-SR2-win32.zip unopenable
Goto Forum:
  


Current Time: Thu May 23 03:58:56 EDT 2013

Powered by FUDForum. Page generated in 0.02562 seconds