Author: jleroux
Date: Thu Jun 14 13:18:49 2018 New Revision: 1833505 URL: http://svn.apache.org/viewvc?rev=1833505&view=rev Log: Improved: Remove unused code in `CommonEvents::setFollowerPage` (OFBIZ-10413) `CommonEvents::setFollowerPage` contains two unused variable definitions. After basic search I found that this request handler is used only in `webapp/partymgr/controller.xml` However I was unable to understand its purpose, so I have added a comment to add some kind of docstring. jleroux: this event method is never used because the pushPage request map is also never used. So we can get rid of the whole. At the same time, fixes a typo in comment an remove an useless import Thanks: Mathieu Lirzin for initial reporting Modified: ofbiz/ofbiz-framework/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java Modified: ofbiz/ofbiz-framework/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml?rev=1833505&r1=1833504&r2=1833505&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Thu Jun 14 13:18:49 2018 @@ -633,12 +633,6 @@ under the License. <request-map uri="visitdetail"><security https="true" auth="true"/><response name="success" type="view" value="visitdetail"/></request-map> <request-map uri="listLoggedInUsers"><security https="true" auth="true"/><response name="success" type="view" value="listLoggedInUsers"/></request-map> - <request-map uri="pushPage"> - <security https="true" auth="true"/> - <event type="java" path="org.apache.ofbiz.common.CommonEvents" invoke="setFollowerPage"/> - <response name="success" type="view" value="visitdetail"/> - </request-map> - <!-- communication event requests --> <request-map uri="setCommunicationEventRoleStatus"> <security https="true" auth="true"/> Modified: ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java?rev=1833505&r1=1833504&r2=1833505&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java Thu Jun 14 13:18:49 2018 @@ -51,7 +51,6 @@ import org.apache.ofbiz.entity.Delegator import org.apache.ofbiz.entity.GenericEntityException; import org.apache.ofbiz.entity.GenericValue; import org.apache.ofbiz.entity.util.EntityUtilProperties; -import org.apache.ofbiz.security.Security; import org.apache.ofbiz.widget.model.ThemeFactory; import org.apache.ofbiz.widget.renderer.VisualTheme; @@ -76,16 +75,6 @@ public class CommonEvents { "thisRequestUri" }; - public static String setFollowerPage(HttpServletRequest request, HttpServletResponse response) { - Security security = (Security) request.getAttribute("security"); - GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); - String visitId = request.getParameter("visitId"); - if (visitId != null) { - request.setAttribute("visitId", visitId); - } - return "success"; - } - /** Simple event to set the users per-session locale setting. The user's locale * setting should be passed as a "newLocale" request parameter. */ public static String setSessionLocale(HttpServletRequest request, HttpServletResponse response) { @@ -204,7 +193,7 @@ public class CommonEvents { // This was added for security reason (OFBIZ-5409), you might need to remove the "//" prefix when handling the JSON response // Though normally you simply have to access the data you want, so should not be annoyed by the "//" prefix if ("GET".equalsIgnoreCase(httpMethod)) { - Debug.logWarning("for security reason (OFBIZ-5409) the the '//' prefix was added handling the JSON response. " + Debug.logWarning("for security reason (OFBIZ-5409) the '//' prefix was added handling the JSON response. " + "Normally you simply have to access the data you want, so should not be annoyed by the '//' prefix." + "You might need to remove it if you use Ajax GET responses (not recommended)." + "In case, the util.js scrpt is there to help you." |
Free forum by Nabble | Edit this page |