/** * Overridden for friendlier behavior in unit tests. */ @Override protected String getTitle(RenderRequest renderRequest) { try { return super.getTitle(renderRequest); } catch (NullPointerException ex) { return getPortletName(); } }
/** * Delegate render requests to processRequest/doRenderService. */ @Override protected final void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException { processRequest(request, response); }
/** * Convenient constructor to take a single model object. * @param viewName name of the View to render, to be resolved * by the DispatcherPortlet's ViewResolver * @param modelName name of the single entry in the model * @param modelObject the single model object */ public ModelAndView(String viewName, String modelName, Object modelObject) { this.view = viewName; addObject(modelName, modelObject); }
/** * Refresh the strategy objects that this portlet uses. * <p>May be overridden in subclasses in order to initialize * further strategy objects. */ protected void initStrategies(ApplicationContext context) { initMultipartResolver(context); initHandlerMappings(context); initHandlerAdapters(context); initHandlerExceptionResolvers(context); initViewResolvers(context); }
protected void doRenderService(RenderRequest request, RenderResponse response) throws Exception { // dispatch normally super.doRenderService(request, response); }
/** * Return the PortletContext attribute name for this portlets's ApplicationContext. * <p>The default implementation returns PORTLET_CONTEXT_PREFIX + portlet name. * @see #PORTLET_CONTEXT_PREFIX * @see #getPortletName */ public String getPortletContextAttributeName() { return PORTLET_CONTEXT_PREFIX + getPortletName(); }
/** * This implementation calls {@link #initStrategies}. */ @Override public void onRefresh(ApplicationContext context) { initStrategies(context); }
/** * Return whether this ModelAndView object is empty as a result of a call to {@link #clear} * i.e. whether it does not hold any view and does not contain a model. * Returns {@code false} if any additional state was added to the instance * <strong>after</strong> the call to {@link #clear}. * @see #clear() */ public boolean wasCleared() { return (this.cleared && isEmpty()); }
/** * Refresh the strategy objects that this portlet uses. * <p>May be overridden in subclasses in order to initialize * further strategy objects. */ protected void initStrategies(ApplicationContext context) { initMultipartResolver(context); initHandlerMappings(context); initHandlerAdapters(context); initHandlerExceptionResolvers(context); initViewResolvers(context); }
/** * Convenient constructor to take a single model object. * @param view View object to render (usually a Servlet MVC View object) * @param modelName name of the single entry in the model * @param modelObject the single model object */ public ModelAndView(Object view, String modelName, Object modelObject) { this.view = view; addObject(modelName, modelObject); }
protected void doRenderService(RenderRequest request, RenderResponse response) throws Exception { // dispatch normally super.doRenderService(request, response); }
/** * Overridden for friendlier behavior in unit tests. */ @Override protected String getTitle(RenderRequest renderRequest) { try { return super.getTitle(renderRequest); } catch (NullPointerException ex) { return getPortletName(); } }
@Override public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { processRequest(request, response); }
/** * Return the namespace for this portlet, falling back to default scheme if * no custom namespace was set. (e.g. "test-portlet" for a portlet named "test") */ public String getNamespace() { return (this.namespace != null) ? this.namespace : getPortletName() + DEFAULT_NAMESPACE_SUFFIX; }
/** * This implementation calls {@link #initStrategies}. */ @Override public void onRefresh(ApplicationContext context) { initStrategies(context); }
/** * Return whether this ModelAndView object is empty as a result of a call to {@link #clear} * i.e. whether it does not hold any view and does not contain a model. * Returns <code>false</code> if any additional state was added to the instance * <strong>after</strong> the call to {@link #clear}. * @see #clear() */ public boolean wasCleared() { return (this.cleared && isEmpty()); }
/** * Convenient constructor to take a single model object. * @param view View object to render (usually a Servlet MVC View object) * @param modelName name of the single entry in the model * @param modelObject the single model object */ public ModelAndView(Object view, String modelName, Object modelObject) { this.view = view; addObject(modelName, modelObject); }
/** * Delegate action requests to processRequest/doActionService. */ @Override public final void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { processRequest(request, response); }
/** * Return the namespace for this portlet, falling back to default scheme if * no custom namespace was set. (e.g. "test-portlet" for a portlet named "test") */ public String getNamespace() { return (this.namespace != null) ? this.namespace : getPortletName() + DEFAULT_NAMESPACE_SUFFIX; }
@Override public void processEvent(EventRequest request, EventResponse response) throws PortletException, IOException { processRequest(request, response); }