Segui em frente no aplicativo, mas ocorreu outro erro. :cry:
1- O form já foi testado e está tudo ok;
2- O xml tb funcionando;
3- O Servlet ok;
4- (ERRO)JSP sem abrir;
vou colocar os dois e o erro:
Servlet:
package com.example.web;
import com.example.model.BeerExpert;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class BeerSelect extends HttpServlet{
public void doPost(HttpServletRequest request,HttpServletResponse response)throws IOException,ServletException{
String c=request.getParameter("color");
BeerExpert be=new BeerExpert();
List<String> result=be.getBrands(c);
//response.setContentType("text/html");
//PrintWriter out=response.getWriter();
//out.println("Beer Selection Advice<br>");
request.setAttribute("styles",result);
RequestDispatcher view=request.getRequestDispatcher("result.jsp");
view.forward(request,response);
}
}
JSP:
<%@page import="java.util.*" %>
<html>
<body>
<h1 align="center">Beer Recommendations JSP</h1>
<p>
<%
List<String> styles=(List)request.getAttribute("styles");
Iterator it=styles.iterator();
while(it.hasNext())
out.print("Try: "+it.next());
%>
</body>
</html>
Erro:
exception
org.apache.jasper.JasperException: java.lang.IllegalStateException: No output folder
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:538)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.example.web.BeerSelect.doPost(BeerSelect.java:21)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.IllegalStateException: No output folder
org.apache.jasper.JspCompilationContext.createOutputDir(JspCompilationContext.java:678)
org.apache.jasper.JspCompilationContext.getOutputDir(JspCompilationContext.java:197)
org.apache.jasper.JspCompilationContext.getClassFileName(JspCompilationContext.java:514)
org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:453)
org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:399)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.example.web.BeerSelect.doPost(BeerSelect.java:21)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Se alguém puder me ajudar eu agradeceria muito, pois quero mesmo aprender...
Muito Obrigadão.