-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakeOfferWithoutStrategy.java
More file actions
43 lines (37 loc) · 1.71 KB
/
Copy pathMakeOfferWithoutStrategy.java
File metadata and controls
43 lines (37 loc) · 1.71 KB
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
34
35
36
37
38
39
40
41
42
43
package com.example.cw.controllers.Strats;
import com.example.cw.services.LotOfferService;
import com.example.cw.services.LotService;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class MakeOfferWithoutStrategy extends SomeStrat {
private final LotOfferService lotOfferService;
private final LotService lotService;
public MakeOfferWithoutStrategy(LotOfferService lotOfferService, LotService lotService) {
this.lotOfferService = lotOfferService;
this.lotService = lotService;
}
@Override
public void execPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// try {
// Customer user = (Customer) request.getSession().getAttribute("user");
// lotOfferService.createNewOfferWithoutDescription(
// Double.parseDouble(request.getParameter("money")),
// Long.parseLong((String) request.getSession().getAttribute("lotId")),
// user.getId()
// );
// request.getSession().setAttribute("lots", lotService.getLots());
// } catch (SQLException | LessThanZeroException | LessThanGivenException e) {
// request.setAttribute("errorMessage", e.getLocalizedMessage());
// forwardError(request, response,"DefinedError");
// return;
// }
//
// forwardToJsp(request, response, "AllLots");
}
@Override
public void execGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
forwardToJsp(request, response, "NewOffer");
}
}