Pessoal,
já pesquisei bastante aqui no GUJ, mas não consigo entender o motivo deste erro.
Se alguem puder dar uma ajuda, eu agradeço.
Já tentei colocar o arquivo user.html na raiz do projeto WebDev e também no diretório WEB-INF, mas não funciona.
Disconfio do web.xml.
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>WebDev</display-name>
<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>
<servlet>
<description></description>
<display-name>Teste</display-name>
<servlet-name>Teste</servlet-name>
<servlet-class>Teste</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Teste</servlet-name>
<url-pattern>/Teste</url-pattern>
</servlet-mapping>
</web-app>
Classe Servlet
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.sun.org.apache.xml.internal.serialize.Printer;
public class Teste extends HttpServlet {
private static final long serialVersionUID = 1L;
public Teste() {
super();
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
RequestDispatcher rd = request.getRequestDispatcher("/user.html");
rd.include(request,response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String[] values = request.getParameterValues("INTERESSES");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
if (values != null){
int length = values.length;
out.println("VOCÊ SELECIONOU: ");
for (int i = 0; i < length; i++){
out.println("<BR>" + values[i]);
}
}
else{
out.println("VOCÊ NÃO SELCIONOU NADA!!!");
}
}
}