New file |
0,0 → 1,32 |
package pt.estgp.es.exemplos.hibernate.web.rest; |
|
import javax.servlet.ServletException; |
import javax.servlet.http.HttpServlet; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
import java.io.IOException; |
|
public class AbstractRestServlet extends HttpServlet |
{ |
@Override |
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
process(req,resp); |
} |
|
@Override |
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
process(req,resp); |
} |
|
protected void process(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException |
{ |
if(req.getContentType().equals("application/json")) |
{ |
|
} |
else |
{ |
|
} |
} |
} |