|
default<Mode>Action
is used instead.
* @param request The portlet request.
* @return <code>true if the action should be reset.
*/
private boolean resetAction(PortletRequest request) {
boolean reset = false;
Map paramMap = request.getParameterMap();
String[] modeParam = (String[]) paramMap.get(MODE_PARAM);
if (modeParam != null && modeParam.length == 1) {
String originatingMode = modeParam[0];
String currentMode = request.getPortletMode().toString();
if (!currentMode.equals(originatingMode)) {
reset = true;
}
}
if(reset) {
request.setAttribute(ACTION_RESET, Boolean.TRUE);
}
else {
request.setAttribute(ACTION_RESET, Boolean.FALSE);
}
return reset;
}
public void destroy() {
if (dispatcherUtils == null) {
LOG.warn("something is seriously wrong, DispatcherUtil is not initialized (null) ");
} else {
dispatcherUtils.cleanup();
}
}
/**
* @param actionMapper the actionMapper to set
*/
public void setActionMapper(ActionMapper actionMapper) {
this.actionMapper = actionMapper;
}
}
Here is a short list of links related to this Struts Jsr168Dispatcher.java source code file:
Struts example source code file (Jsr168Dispatcher.java)
The Struts Jsr168Dispatcher.java source code/* * $Id: Jsr168Dispatcher.java 1076544 2011-03-03 07:19:37Z lukaszlenart $ * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.struts2.portlet.dispatcher; import java.io.IOException; import java.io.InputStream; import java.util.Enumeration; import java.util.HashMap; import java.util.Locale; import java.util.Map; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.GenericPortlet; import javax.portlet.PortletConfig; import javax.portlet.PortletException; import javax.portlet.PortletMode; import javax.portlet.PortletRequest; import javax.portlet.PortletResponse; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.WindowState; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.StrutsConstants; import org.apache.struts2.StrutsException; import org.apache.struts2.StrutsStatics; import org.apache.struts2.dispatcher.ApplicationMap; import org.apache.struts2.dispatcher.Dispatcher; import org.apache.struts2.dispatcher.RequestMap; import org.apache.struts2.dispatcher.SessionMap; import org.apache.struts2.dispatcher.mapper.ActionMapper; import org.apache.struts2.dispatcher.mapper.ActionMapping; import org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper; import org.apache.struts2.portlet.PortletActionConstants; import org.apache.struts2.portlet.PortletApplicationMap; import org.apache.struts2.portlet.PortletRequestMap; import org.apache.struts2.portlet.PortletSessionMap; import org.apache.struts2.portlet.context.PortletActionContext; import org.apache.struts2.portlet.servlet.PortletServletContext; import org.apache.struts2.portlet.servlet.PortletServletRequest; import org.apache.struts2.portlet.servlet.PortletServletResponse; import org.apache.struts2.util.AttributeMap; import org.apache.commons.lang.StringUtils; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionProxy; import com.opensymphony.xwork2.ActionProxyFactory; import com.opensymphony.xwork2.config.ConfigurationException; import com.opensymphony.xwork2.inject.Container; import com.opensymphony.xwork2.util.FileManager; import com.opensymphony.xwork2.util.LocalizedTextUtil; import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; /** * <!-- START SNIPPET: javadoc --> * <p> * Struts JSR-168 portlet dispatcher. Similar to the WW2 Servlet dispatcher, * but adjusted to a portal environment. The portlet is configured through the <tt>portlet.xml * descriptor. Examples and descriptions follow below: * </p> * <!-- END SNIPPET: javadoc --> * * @author Nils-Helge Garli * @author Rainer Hermanns * * <p>Init parameters * <!-- START SNIPPET: params --> * <table class="confluenceTable"> * <tr> * <th class="confluenceTh">Name * <th class="confluenceTh">Description * <th class="confluenceTh">Default value * </tr> * <tr> * <td class="confluenceTd">portletNamespace | The namespace for the portlet in the xwork configuration. This * namespace is prepended to all action lookups, and makes it possible to host multiple * portlets in the same portlet application. If this parameter is set, the complete namespace * will be <tt>/portletNamespace/modeNamespace/actionName | The default namespace | Base namespace in the xwork configuration for the view portlet * mode</td> | The default namespace | Base namespace in the xwork configuration for the edit portlet * mode</td> | The default namespace | Base namespace in the xwork configuration for the help portlet * mode</td> | The default namespace | Default action to invoke in the view portlet mode if no action is * specified</td> | default | Default action to invoke in the edit portlet mode if no action is * specified</td> | default | Default action to invoke in the help portlet mode if no action is * specified</td> | default |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.