0
I am following the E-book "Java EE7 With JSF, Primefaces and CDI". I created the Maven project, edited the file pom.xml
how the workbook guides, when creating the example file OiMundoServlet.java
, I checked that appeared the errors that the booklet informs, but while editing again the file pom.xml
to eliminate errors, these same errors are not gone. How to fix this?
- Note 1: I am using the latest version of Eclipse Java EE (Mars.1 Release (4.5.1))
- Note 2: When I added apache server 8, when linking the Maven project I found the following error:
Project facet Java version 1.8 is not supported
. - Note 3: The file
web.xml
was not created automatically. I had to create it because it was an error in the filepom.xml
in line with<packaging>war</packaging>
.
Follows the code:
package br.com.farmsystem.servlet;//essa linha apresenta erro
import java.io.IOException;//essa linha apresenta erro
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class OiMundoServlet
*/
@WebServlet("/oi-mundo")
public class OiMundoServlet extends HttpServlet { //essa linha apresenta erro
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public OiMundoServlet() {
super();//essa linha apresenta erro
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {//essa linha apresenta erro
// TODO Auto-generated method stub
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {//essa linha apresenta erro
// TODO Auto-generated method stub
}
}