-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainPageStrategy.java
More file actions
26 lines (19 loc) · 840 Bytes
/
Copy pathMainPageStrategy.java
File metadata and controls
26 lines (19 loc) · 840 Bytes
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
package com.example.cw.controllers.Strats;
import com.example.cw.model.Customer;
import com.example.cw.services.LotService;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class MainPageStrategy extends SomeStrat {
private final LotService lotService;
public MainPageStrategy(LotService lotService) {
this.lotService = lotService;
}
@Override
public void execGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Customer user = (Customer) request.getSession().getAttribute("user");
request.setAttribute("ownersLots", lotService.getLotsWithOwner(user.getId()));
forwardToJsp(request, response, "MainPage");
}
}