| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
package com.buckosoft.PicMan.web; |
| 9 | |
|
| 10 | |
import java.io.IOException; |
| 11 | |
import java.util.HashMap; |
| 12 | |
import java.util.Map; |
| 13 | |
|
| 14 | |
import javax.servlet.ServletException; |
| 15 | |
import javax.servlet.http.HttpServletRequest; |
| 16 | |
import javax.servlet.http.HttpServletResponse; |
| 17 | |
|
| 18 | |
import org.springframework.web.servlet.ModelAndView; |
| 19 | |
|
| 20 | |
import com.buckosoft.BSAccount.web.BSAccountPageController; |
| 21 | |
import com.buckosoft.BSAccount.web.BSAccountUserWebSession; |
| 22 | |
import com.buckosoft.PicMan.business.PicManFacade; |
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | 0 | public class ShowErrorPageController extends BSAccountPageController { |
| 28 | |
private PicManFacade pmf; |
| 29 | |
|
| 30 | 0 | public void setPicMan(PicManFacade pmf) { this.pmf = pmf; } |
| 31 | 0 | public PicManFacade getPicMan() { return(pmf); } |
| 32 | |
|
| 33 | |
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) |
| 34 | |
throws ServletException, IOException { |
| 35 | |
|
| 36 | 0 | BSAccountUserWebSession userWebSession = this.bsAccountMan.getUserWebSession(request); |
| 37 | |
|
| 38 | 0 | Map<String, Object> myModel = new HashMap<String, Object>(); |
| 39 | 0 | myModel.put("now", new java.util.Date().toString()); |
| 40 | 0 | myModel.put("userWebSession", userWebSession); |
| 41 | 0 | myModel.put("picMan", getPicMan()); |
| 42 | |
|
| 43 | 0 | String v = request.getParameter("e"); |
| 44 | 0 | if (v == null) |
| 45 | 0 | myModel.put("eString", "No Error Specified"); |
| 46 | |
else { |
| 47 | 0 | int i = Integer.parseInt(v); |
| 48 | 0 | Throwable t = pmf.getError(i); |
| 49 | 0 | myModel.put("error", t); |
| 50 | |
} |
| 51 | 0 | return new ModelAndView("ShowErrorPage", "model", myModel); |
| 52 | |
} |
| 53 | |
|
| 54 | |
} |