View Javadoc

1   package com.germinus.merlin.controller.news;
2   
3   import java.util.HashMap;
4   import java.util.Map;
5   
6   import javax.portlet.ActionRequest;
7   import javax.portlet.ActionResponse;
8   import javax.portlet.RenderRequest;
9   import javax.portlet.RenderResponse;
10  
11  import org.apache.commons.logging.Log;
12  import org.apache.commons.logging.LogFactory;
13  import org.springframework.beans.factory.InitializingBean;
14  import org.springframework.web.portlet.ModelAndView;
15  import org.springframework.web.portlet.mvc.AbstractController;
16  
17  /**Controllador de last news.
18   * @author David Jiménez, Germinus XXI
19   * @version 1.0
20   * @since 1.0
21   */
22  public class NewsViewController extends AbstractController implements InitializingBean  {
23  
24      private static final Log log = LogFactory.getLog(NewsViewController.class);
25      
26      /**
27       * Process the action request. There is nothing to return.
28       */
29      @Override
30  	protected void handleActionRequestInternal(ActionRequest request,
31  			ActionResponse response) throws Exception {
32      	
33      		log.debug("handleActionRequestInternal");	
34  	}
35      
36      /**
37       * Process the render request and return a ModelAndView object which the
38       * DispatcherPortlet will render.
39       */
40      public ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception {
41          
42      	log.debug("handleRenderRequestInternal");
43          
44          //put the view parameter in a Map. 
45          Map<String, Object> model = new HashMap<String, Object>();
46          
47          return new ModelAndView("news/viewNews", "model", model);
48      }
49  
50  	public void afterPropertiesSet() throws Exception {
51  		
52  //		log.debug("afterPropertiesSet");
53  	
54  	}
55  
56  }