| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| PicBrowserPageController |
|
| 2.0;2 |
| 1 | /****************************************************************************** | |
| 2 | * PicBrowserPageController.java - The Spring controller for the Picture Browser | |
| 3 | * | |
| 4 | * PicMan - The BuckoSoft Picture Manager in Java | |
| 5 | * Copyright(c) 2009 - Dick Balaska | |
| 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 | ||
| 23 | /** | |
| 24 | * The Spring controller for the Picture Browser. <br> | |
| 25 | * See <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/WebContent/WEB-INF/jsp/PicBrowserPage.jsp">PicBrowserPage.jsp</a> | |
| 26 | * which is pretty boring. All the good stuff happens in the javascript | |
| 27 | * <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/WebContent/js/picBrowser.js">picBrowser.js</a> | |
| 28 | * @author Dick Balaska | |
| 29 | * @since 2009/06/09 | |
| 30 | */ | |
| 31 | 0 | public class PicBrowserPageController extends BSAccountPageController { |
| 32 | ||
| 33 | /** Spring standard http request handler | |
| 34 | * @param request The http request | |
| 35 | * @param response The http response | |
| 36 | * @return The Spring Model and View | |
| 37 | */ | |
| 38 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) | |
| 39 | throws ServletException, IOException { | |
| 40 | ||
| 41 | 0 | BSAccountUserWebSession userWebSession = this.bsAccountMan.getUserWebSession(request); |
| 42 | ||
| 43 | 0 | String now = (new java.util.Date()).toString(); |
| 44 | ||
| 45 | 0 | Map<String, Object> myModel = new HashMap<String, Object>(); |
| 46 | 0 | myModel.put("userWebSession", userWebSession); |
| 47 | 0 | myModel.put("now", now); |
| 48 | ||
| 49 | 0 | String v = request.getParameter("pic"); |
| 50 | 0 | if (v != null) |
| 51 | 0 | myModel.put("pic", v); |
| 52 | ||
| 53 | 0 | return new ModelAndView("PicBrowserPage", "model", myModel); |
| 54 | } | |
| 55 | } |