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.
web.xml
[code]<?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”>
WebDev
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
Teste
Teste
Teste
Teste
/Teste
[/code]
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!!!");
}
}
}