-
Notifications
You must be signed in to change notification settings - Fork 0
/
ContactServlet.java
33 lines (29 loc) · 1.17 KB
/
ContactServlet.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.atom.custommvc1.servlet;
import com.atom.custommvc1.service.ProjectService;
import com.atom.custommvc1.serviceimpl.ProjectServiceImpl;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author rabin dulal
*/
@WebServlet(name = "contact",urlPatterns = {"/contact"} )
public class ContactServlet extends HttpServlet{
private ProjectService projectservice=new ProjectServiceImpl();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setAttribute("projects", projectservice.getAll());
RequestDispatcher dispatcher = req.getRequestDispatcher("/WEB-INF/views/contact.jsp");
dispatcher.forward(req, resp);
}
}