svn commit: r608574 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r608574 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

jleroux@apache.org
Author: jleroux
Date: Thu Jan  3 09:52:27 2008
New Revision: 608574

URL: http://svn.apache.org/viewvc?rev=608574&view=rev
Log:
A slightly refactored patch from Chris Howe "visit tracking should default to on" (https://issues.apache.org/jira/browse/OFBIZ-1554) OFBIZ-1554
Maybe the title could have better been "Allow requests to provide guidance on tracking"

Refactoring : one liner syndrom, but note I kept uriString : not totally affected, some brain remains. I also wondered if keeping appStat and appVisit could provide some kind of information but finally chose to do like it was already done in lines just below. This note only to follow the discussion we had on this topic in dev ML.

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=608574&r1=608573&r2=608574&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Thu Jan  3 09:52:27 2008
@@ -908,9 +908,8 @@
     }
 
     public boolean trackStats(HttpServletRequest request) {
-        String appStats = context.getInitParameter("track-serverhit");
-        if (appStats != null && !"false".equalsIgnoreCase(appStats)) {
-            String uriString =  RequestHandler.getRequestUri(request.getPathInfo());
+        if (!"false".equalsIgnoreCase(context.getInitParameter("track-serverhit"))) {
+            String uriString = RequestHandler.getRequestUri(request.getPathInfo());
             return !"false".equalsIgnoreCase(requestManager.getRequestAttribute(uriString, ConfigXMLReader.REQUEST_TRACK_STATS));
         } else {
             return false;
@@ -918,9 +917,8 @@
     }
 
     public boolean trackVisit(HttpServletRequest request) {
-        String appVisit = context.getInitParameter("track-visit");
-        if (appVisit != null && !"false".equalsIgnoreCase(appVisit)) {
-            String uriString =  RequestHandler.getRequestUri(request.getPathInfo());
+        if (!"false".equalsIgnoreCase(context.getInitParameter("track-visit"))) {
+            String uriString = RequestHandler.getRequestUri(request.getPathInfo());
             return !"false".equalsIgnoreCase(requestManager.getRequestAttribute(uriString, ConfigXMLReader.REQUEST_TRACK_VISIT));
         } else {
             return false;