${uiLabelMap.CommonUsername}:
@@ -60,7 +60,7 @@ under the License.
${uiLabelMap.CommonForgotYourPassword}?
-
@@ -74,7 +74,7 @@ under the License.
${uiLabelMap.CommonNewUser}
-
diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
index bcfdcec54a..ea22b85393 100644
--- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
+++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
@@ -465,7 +465,7 @@ public class ShoppingCartEvents {
partyId = userLogin.getString("partyId");
}
String formAction = "/additemsurvey";
- String nextPage = RequestHandler.getNextPageUri(request.getPathInfo());
+ String nextPage = RequestHandler.getOverrideViewUri(request.getPathInfo());
if (nextPage != null) {
formAction = formAction + "/" + nextPage;
}
diff --git a/framework/base/src/org/ofbiz/base/util/UtilHttp.java b/framework/base/src/org/ofbiz/base/util/UtilHttp.java
index 60d3fc5b50..7abda2d43f 100644
--- a/framework/base/src/org/ofbiz/base/util/UtilHttp.java
+++ b/framework/base/src/org/ofbiz/base/util/UtilHttp.java
@@ -37,7 +37,6 @@ import java.util.Currency;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -97,22 +96,29 @@ public class UtilHttp {
* @return The resulting Map
*/
public static Map
getParameterMap(HttpServletRequest request) {
- return getParameterMap(request, null);
+ return getParameterMap(request, null, null);
+ }
+
+ public static Map getParameterMap(HttpServletRequest request, Set extends String> nameSet) {
+ return getParameterMap(request, nameSet, null);
}
/**
* Create a map from a HttpServletRequest (parameters) object
+ * @param onlyIncludeOrSkip If true only include, if false skip, the named parameters in the nameSet. If this is null and nameSet is not null, default to skip.
* @return The resulting Map
*/
- public static Map getParameterMap(HttpServletRequest request, Set extends String> namesToSkip) {
+ public static Map getParameterMap(HttpServletRequest request, Set extends String> nameSet, Boolean onlyIncludeOrSkip) {
+ boolean onlyIncludeOrSkipPrim = onlyIncludeOrSkip == null ? true : onlyIncludeOrSkip.booleanValue();
Map paramMap = FastMap.newInstance();
// add all the actual HTTP request parameters
- Enumeration e = request.getParameterNames();
+ Enumeration e = request.getParameterNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
- if (namesToSkip != null && namesToSkip.contains(name))
+ if (nameSet != null && (onlyIncludeOrSkipPrim ^ nameSet.contains(name))) {
continue;
+ }
Object value = null;
String[] paramArr = request.getParameterValues(name);
@@ -126,7 +132,52 @@ public class UtilHttp {
}
paramMap.put(name, value);
}
+
+ paramMap.putAll(getPathInfoOnlyParameterMap(request, nameSet, onlyIncludeOrSkip));
+ if (paramMap.size() == 0) {
+ // nothing found in the parameters; maybe we read the stream instead
+ Map multiPartMap = UtilGenerics.checkMap(request.getAttribute("multiPartMap"));
+ if (UtilValidate.isNotEmpty(multiPartMap)) {
+ paramMap.putAll(multiPartMap);
+ }
+ }
+
+ if (Debug.verboseOn()) {
+ Debug.logVerbose("Made Request Parameter Map with [" + paramMap.size() + "] Entries", module);
+ Debug.logVerbose("Request Parameter Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(paramMap), module);
+ }
+
+ return paramMap;
+ }
+
+ public static Map getQueryStringOnlyParameterMap(HttpServletRequest request) {
+ Map paramMap = FastMap.newInstance();
+ String queryString = request.getQueryString();
+ if (UtilValidate.isNotEmpty(queryString)) {
+ StringTokenizer queryTokens = new StringTokenizer(queryString, "&");
+ while (queryTokens.hasMoreTokens()) {
+ String token = queryTokens.nextToken();
+ if (token.startsWith("amp;")) {
+ // this is most likely a split value that had an & in it, so don't consider this a name; note that some old code just stripped the "amp;" and went with it
+ //token = token.substring(4);
+ continue;
+ }
+ int equalsIndex = token.indexOf("=");
+ String name = token;
+ if (equalsIndex > 0) {
+ name = token.substring(0, equalsIndex);
+ paramMap.put(name, request.getParameter(name));
+ }
+ }
+ }
+ return paramMap;
+ }
+
+ public static Map getPathInfoOnlyParameterMap(HttpServletRequest request, Set extends String> nameSet, Boolean onlyIncludeOrSkip) {
+ boolean onlyIncludeOrSkipPrim = onlyIncludeOrSkip == null ? true : onlyIncludeOrSkip.booleanValue();
+ Map paramMap = FastMap.newInstance();
+
// now add in all path info parameters /~name1=value1/~name2=value2/
// note that if a parameter with a given name already exists it will be put into a list with all values
String pathInfoStr = request.getPathInfo();
@@ -142,6 +193,10 @@ public class UtilHttp {
last = current;
if (element.charAt(0) == '~' && element.indexOf('=') > -1) {
String name = element.substring(1, element.indexOf('='));
+ if (nameSet != null && (onlyIncludeOrSkipPrim ^ nameSet.contains(name))) {
+ continue;
+ }
+
String value = element.substring(element.indexOf('=') + 1);
Object curValue = paramMap.get(name);
if (curValue != null) {
@@ -162,22 +217,15 @@ public class UtilHttp {
}
}
}
-
- if (paramMap.size() == 0) {
- // nothing found in the parameters; maybe we read the stream instead
- Map multiPartMap = UtilGenerics.checkMap(request.getAttribute("multiPartMap"));
- if (UtilValidate.isNotEmpty(multiPartMap)) {
- paramMap.putAll(multiPartMap);
- }
- }
-
- if (Debug.verboseOn()) {
- Debug.logVerbose("Made Request Parameter Map with [" + paramMap.size() + "] Entries", module);
- Debug.logVerbose("Request Parameter Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(paramMap), module);
- }
return paramMap;
}
+
+ public static Map getUrlOnlyParameterMap(HttpServletRequest request) {
+ Map paramMap = getQueryStringOnlyParameterMap(request);
+ paramMap.putAll(getPathInfoOnlyParameterMap(request, null, null));
+ return paramMap;
+ }
/**
* Create a map from a HttpRequest (attributes) object
@@ -960,7 +1008,7 @@ public class UtilHttp {
}
return retStr;
}
-
+
/**
* Given multi form data with the ${param}_o_N notation, creates a Collection
* of Maps for the submitted rows. Each Map contains the key/value pairs
diff --git a/framework/common/webcommon/WEB-INF/common-controller.xml b/framework/common/webcommon/WEB-INF/common-controller.xml
index a17d4679b7..689fe167cb 100644
--- a/framework/common/webcommon/WEB-INF/common-controller.xml
+++ b/framework/common/webcommon/WEB-INF/common-controller.xml
@@ -77,7 +77,7 @@ under the License.
-
+
diff --git a/framework/common/webcommon/includes/header.ftl b/framework/common/webcommon/includes/header.ftl
index 8097316648..16d64f02d5 100644
--- a/framework/common/webcommon/includes/header.ftl
+++ b/framework/common/webcommon/includes/header.ftl
@@ -106,10 +106,8 @@ under the License.
<#if person?has_content>
${uiLabelMap.CommonWelcome} ${person.firstName?if_exists} ${person.middleName?if_exists} ${person.lastName?if_exists} [${userLogin.userLoginId}]
- <#if defaultOrganizationPartyId?exists>${uiLabelMap.CommonDefaultOrganizationPartyId} : ${defaultOrganizationPartyGroupName?if_exists} [${defaultOrganizationPartyId}]#if>
<#elseif partyGroup?has_content>
${uiLabelMap.CommonWelcome} ${partyGroup.groupName?if_exists} [${userLogin.userLoginId}]
- <#if defaultOrganizationPartyId?exists>${uiLabelMap.CommonDefaultOrganizationPartyId} : ${defaultOrganizationPartyGroupName?if_exists} [${defaultOrganizationPartyId}]#if>
<#else>
${uiLabelMap.CommonWelcome}!
#if>
@@ -134,27 +132,23 @@ under the License.
background="${layoutSettings.headerRightBackgroundUrl}"#if>>
<#if userLogin?exists>
+ <#if person?has_content>
+ ${uiLabelMap.CommonWelcome} ${person.firstName?if_exists} ${person.lastName?if_exists}
+ <#elseif partyGroup?has_content>
+ ${uiLabelMap.CommonWelcome} ${partyGroup.groupName?if_exists}
+ #if>
+ [${userLogin.userLoginId}]
${uiLabelMap.CommonLogout}
- #if>
-
- <#if person?has_content>
- ${uiLabelMap.CommonWelcome} ${person.firstName?if_exists} ${person.lastName?if_exists} [${userLogin.userLoginId}]
-
<#if defaultOrganizationPartyId?exists>${uiLabelMap.CommonDefaultOrganizationPartyId} : ${defaultOrganizationPartyGroupName?if_exists} [${defaultOrganizationPartyId}]
#if>
- <#elseif partyGroup?has_content>
- ${uiLabelMap.CommonWelcome} ${partyGroup.groupName?if_exists} [${userLogin.userLoginId}]
-
- <#if defaultOrganizationPartyId?exists>${uiLabelMap.CommonDefaultOrganizationPartyId} : ${defaultOrganizationPartyGroupName?if_exists} [${defaultOrganizationPartyId}]
#if>
- <#else>
+ <#else/>
+
${uiLabelMap.CommonWelcome}! ${uiLabelMap.CommonLogin}
-
+
#if>
#if>
-
+
diff --git a/framework/common/webcommon/login.ftl b/framework/common/webcommon/login.ftl
index 61db4ecb7b..ef517a4ba1 100644
--- a/framework/common/webcommon/login.ftl
+++ b/framework/common/webcommon/login.ftl
@@ -19,11 +19,6 @@ under the License.
<#if requestAttributes.uiLabelMap?exists><#assign uiLabelMap = requestAttributes.uiLabelMap>#if>
-<#assign previousParams = sessionAttributes._PREVIOUS_PARAMS_?if_exists>
-<#if previousParams?has_content>
- <#assign previousParams = "?" + previousParams>
-#if>
-
<#assign username = requestParameters.USERNAME?default((sessionAttributes.autoUserLogin.userLoginId)?default(""))>
<#if username != "">
<#assign focusName = false>
@@ -36,7 +31,7 @@ under the License.