Author: sshyrkov
Date: Wed Sep 5 18:32:13 2007
New Revision: 18379
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18379&repname=
=3Djahia
Log:
Added check for logger.isDebugEnabled()
Modified:
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/actionmenus/G=
etTimeBasedPublishingState.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/actionmenus/G=
etWorkflowState.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetCh=
ildPagesEntryPoint.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetWo=
rkFlowChildObjects.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetWo=
rkflowEntryPoint.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/LockW=
orkFlowChildObjects.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/SiteM=
apAbstractAction.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/Unloc=
kWorkFlowChildObjects.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/applicati=
ons/ServletIncludeRequestWrapper.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/applicati=
ons/ServletIncludeResponseWrapper.java
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/actionm=
enus/GetTimeBasedPublishingState.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/ajax/actionmenus/GetTimeBasedPublishingStat=
e.java&rev=3D18379&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/actionmenus/G=
etTimeBasedPublishingState.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/actionmenus/G=
etTimeBasedPublishingState.java Wed Sep 5 18:32:13 2007
@@ -86,7 +86,9 @@
final String key =3D getParameter(request, response, KEY);
final ContentObject currentObject =3D getContentObjectFromStri=
ng(key);
=
- logger.debug("Getting Time Based Publishing State for: " + key=
);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Getting Time Based Publishing State for: " +=
key);
+ }
if ( currentObject !=3D null ){
final JahiaObjectDelegate jahiaObjectDelegate =3D
jahiaObjectManager.getJahiaObjectDelegate(currentO=
bject.getObjectKey());
@@ -102,7 +104,9 @@
} else {
displayTimeBasedPublishingStateDialog(mapping, form, r=
equest, response, retRule, jahiaObjectDelegate, now, jParams);
}
- logger.debug("TBPSTATS: elapsed:"+(System.currentTimeMilli=
s()-start_tbp));
+ if (logger.isDebugEnabled()) {
+ logger.debug("TBPSTATS: elapsed:"+(System.currentTimeM=
illis()-start_tbp));
+ }
}
} catch (final Exception e) {
logger.error("Unable to process the request !", e);
@@ -163,7 +167,9 @@
}
final String imagePath =3D JahiaResourceBundle.getUrlPathCommonRes=
ource(statusLabel, jParams);
=
- logger.debug("imagePath: " + imagePath);
+ if (logger.isDebugEnabled()) {
+ logger.debug("imagePath: " + imagePath);
+ }
final ServletContext context =3D super.getServlet().getServletCont=
ext();
response.setContentType(context.getMimeType(imagePath));
response.setHeader(CACHE_CONTROL, NO_CACHE);
@@ -230,8 +236,6 @@
boolean inherited =3D retRule.getInherited().booleanVa=
lue();
boolean isValid =3D jahiaObjectDelegate.isValid();
boolean isExpired =3D jahiaObjectDelegate.isExpired();
- boolean willExpire =3D jahiaObjectDelegate.willExpire(=
now);
- boolean willBecomeValid =3D jahiaObjectDelegate.willBe=
comeValid(now);
schedulingType =3D retRule.getRuleType();
if ( inherited ){
TimeBasedPublishingJahiaObject contentObject =3D (=
TimeBasedPublishingJahiaObject)ContentObject
@@ -275,7 +279,6 @@
.getEngineResource("org.jahia.engines.timebase=
dpublishing.schedulingType."
+schedulingType,jParams,jParams.getLocale(),sc=
hedulingType);
=
- RangeRetentionRule rangeRule =3D (RangeRetentionRule)r=
etRule;
Long dateLong =3D new Long(0);
Format formater =3D JahiaDateFieldUtil.getDateFormat(
"dd MMMM yyyy HH:mm", jParams.getLocale());
@@ -300,7 +303,7 @@
}
=
}
- StringBuffer buff =3D new StringBuffer("");
+ StringBuffer buff =3D new StringBuffer(2048);
buff.append("<table class=3D\"timeBasedPublishingMainTable=
\" border=3D\"0\" cellpadding=3D\"0\" >");
buff.append("<tr>").append("<td colspan=3D\"3\" class=3D\"=
timeBasedPublishingTitle\" valign=3D\"top\" align=3D\"left\">").append(stat=
usLabel).append("</td>").append("</tr>");
buff.append("<tr>").append("<td class=3D\"timeBasedPublish=
ingLabel\" valign=3D\"top\" align=3D\"left\" nowrap>").append(schedulingTyp=
eLabel).append("</td><td valign=3D\"top\" align=3D\"left\" style=3D\"width:=
20px;text-aling:left\">:</td>");
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/actionm=
enus/GetWorkflowState.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/ajax/actionmenus/GetWorkflowState.java&rev=
=3D18379&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/actionmenus/G=
etWorkflowState.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/actionmenus/G=
etWorkflowState.java Wed Sep 5 18:32:13 2007
@@ -62,7 +62,9 @@
=
final String key =3D getParameter(request, response, KEY);
final ContentObject currentObject =3D getContentObjectFromStri=
ng(key);
- logger.debug("Getting Workflow State for: " + key);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Getting Workflow State for: " + key);
+ }
=
final Map languagesStates =3D workflowService.getLanguagesStat=
es(currentObject);
String language =3D getParameter(request,"flaglang","");
@@ -113,7 +115,9 @@
break;
}
=
- logger.debug("imagePath: " + imagePath);
+ if (logger.isDebugEnabled()) {
+ logger.debug("imagePath: " + imagePath);
+ }
final ServletContext context =3D super.getServlet().getServlet=
Context();
response.setContentType(context.getMimeType(imagePath));
response.setHeader(CACHE_CONTROL, NO_CACHE);
@@ -139,7 +143,9 @@
"Unable to Get WorkFlow State ! Msg: " + e.getMess=
age());
}
}
- logger.debug("WFSTATS: elapsed:"+(System.currentTimeMillis()-start=
_wf));
+ if (logger.isDebugEnabled()) {
+ logger.debug("WFSTATS: elapsed:"+(System.currentTimeMillis()-s=
tart_wf));
+ }
return null;
}
}
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap=
/GetChildPagesEntryPoint.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetChildPagesEntryPoint.java&r=
ev=3D18379&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetCh=
ildPagesEntryPoint.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetCh=
ildPagesEntryPoint.java Wed Sep 5 18:32:13 2007
@@ -73,7 +73,9 @@
return null;
}
=
- logger.debug("Getting SiteMap Entry Point: " + key);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Getting SiteMap Entry Point: " + key);
+ }
=
final List locales =3D jParams.getSite().getLanguageSettings(t=
rue);
=
@@ -139,7 +141,9 @@
parent =3D parent.getParent(jParams.getUser(), jParams.get=
EntryLoadRequest(), jParams.getOpMode());
}
}
- logger.debug("InsertionPoint parents are: " + result);
+ if (logger.isDebugEnabled()) {
+ logger.debug("InsertionPoint parents are: " + result);
+ }
return result;
}
}
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap=
/GetWorkFlowChildObjects.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetWorkFlowChildObjects.java&r=
ev=3D18379&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetWo=
rkFlowChildObjects.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetWo=
rkFlowChildObjects.java Wed Sep 5 18:32:13 2007
@@ -80,7 +80,9 @@
return null;
}
=
- logger.debug("Getting WorkFlow ChildObjects for object: " + ke=
y);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Getting WorkFlow ChildObjects for object: " =
+ key);
+ }
=
// Get all active languages
final List locales =3D jParams.getSite().getLanguageSettings(t=
rue);
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap=
/GetWorkflowEntryPoint.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetWorkflowEntryPoint.java&rev=
=3D18379&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetWo=
rkflowEntryPoint.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/GetWo=
rkflowEntryPoint.java Wed Sep 5 18:32:13 2007
@@ -74,7 +74,9 @@
return null;
}
=
- logger.debug("Getting WorkFlow Entry Point: " + key);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Getting WorkFlow Entry Point: " + key);
+ }
=
// Get all active languages
final List locales =3D jParams.getSite().getLanguageSettings(t=
rue);
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap=
/LockWorkFlowChildObjects.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/ajax/sitemap/LockWorkFlowChildObjects.java&=
rev=3D18379&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/LockW=
orkFlowChildObjects.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/LockW=
orkFlowChildObjects.java Wed Sep 5 18:32:13 2007
@@ -85,7 +85,9 @@
boolean doLock =3D false;
for (int j =3D 0; j < locales.size(); j++) {
final String languageCode =3D ((SiteLanguageSettin=
gs) locales.get(j)).getCode();
- logger.debug("Found object: " + objectKey + " in "=
+ languageCode);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Found object: " + objectKey + " =
in " + languageCode);
+ }
Integer languageState =3D (Integer) languagesState=
s.get(languageCode);
Integer sharedLanguageState =3D (Integer) language=
sStates.get(ContentObject.SHARED_LANGUAGE);
=
@@ -104,13 +106,17 @@
obj=
ectKey.getType(), currentObject.getID(), currentObject.getPageID());
if (lockRegistry.acquire(lockKey, currentUser, cur=
rentUser.getUserKey(),
jParams.getSessionState()=
.getMaxInactiveInterval())) {
- logger.info("Lock acquired for object " + obje=
ctKey + " by " +
+ if (logger.isDebugEnabled()) {
+ logger.debug("Lock acquired for object " +=
objectKey + " by " +
currentUser.getUsername());
+ }
final Set wl =3D (Set) jParams.getSessionState=
().getAttribute("workflowLocks");
wl.add(lockKey);
} else {
- logger.info("Cannot acquire lock for object " =
+ objectKey + " by " +
+ if (logger.isInfoEnabled()) {
+ logger.info("Cannot acquire lock for objec=
t " + objectKey + " by " +
currentUser.getUsername());
+ }
}
}
}
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap=
/SiteMapAbstractAction.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/ajax/sitemap/SiteMapAbstractAction.java&rev=
=3D18379&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/SiteM=
apAbstractAction.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/SiteM=
apAbstractAction.java Wed Sep 5 18:32:13 2007
@@ -287,7 +287,9 @@
=
for (int j =3D 0; j < locales.size(); j++) {
final String languageCode =3D ((SiteLanguageSettings) locales.=
get(j)).getCode();
- logger.debug("Found page: " + page.getID() + " in " + language=
Code);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Found page: " + page.getID() + " in " + lang=
uageCode);
+ }
final Element lang =3D resp.createElement("lang");
lang.setAttribute("code", languageCode);
lang.setAttribute("langURL", getPageURL(jParams, pid, language=
Code));
@@ -295,14 +297,20 @@
if (isLiveMode) {
if (page.isReachable(ProcessingContext.NORMAL, languageCod=
e, currentUser)) {
lang.appendChild(resp.createTextNode("10"));
- logger.debug("Page reachable in Live Mode");
+ if (logger.isDebugEnabled()) {
+ logger.debug("Page reachable in Live Mode");
+ }
} else {
lang.appendChild(resp.createTextNode("-1"));
- logger.debug("Page Not reachable in Live Mode");
+ if (logger.isDebugEnabled()) {
+ logger.debug("Page Not reachable in Live Mode");
+ }
}
=
} else {
- logger.debug("getEntryStates: " + entries);
+ if (logger.isDebugEnabled()) {
+ logger.debug("getEntryStates: " + entries);
+ }
Integer languageState =3D (Integer) languagesStates.get(la=
nguageCode);
=
if (mode =3D=3D NORMAL) {
@@ -450,7 +458,9 @@
=
if (languageState.intValue() < 1 && isDeleted) {
lang.appendChild(resp.createTextNode("-2"));
- logger.debug("Page: " + key + " is deleted");
+ if (logger.isDebugEnabled()) {
+ logger.debug("Page: " + key + " is deleted=
");
+ }
} else {
lang.appendChild(resp.createTextNode(languageS=
tate.toString()));
=
@@ -485,7 +495,9 @@
final int id =3D object.getID();
final int pageID =3D object.getPageID();
final ObjectKey objectKey =3D object.getObjectKey();
- logger.debug("processWorkflowObject: " + objectKey);
+ if (logger.isDebugEnabled()) {
+ logger.debug("processWorkflowObject: " + objectKey);
+ }
final Element item =3D resp.createElement("object");
item.setAttribute("id", String.valueOf(id));
item.setAttribute("key", objectKey.toString());
@@ -494,7 +506,9 @@
=
if (object.isMarkedForDelete()) {
item.setAttribute("Style", "MarkedForDelete");
- logger.debug("Object: " + objectKey + " is marked for delete");
+ if (logger.isDebugEnabled()) {
+ logger.debug("Object: " + objectKey + " is marked for dele=
te");
+ }
}
=
if (! hasChildren(object, currentUser, parentID)) {
@@ -572,7 +586,9 @@
}
}
=
- logger.debug("display: " + display + ", action: " + action);
+ if (logger.isDebugEnabled()) {
+ logger.debug("display: " + display + ", action: " + action);
+ }
=
final TreeSet additionalOptions =3D new TreeSet();
final Iterator tabOptionsiterator =3D tabOptions.iterator();
@@ -631,7 +647,9 @@
=
for (int j =3D 0; j < locales.size(); j++) {
final String languageCode =3D ((SiteLanguageSettings) loca=
les.get(j)).getCode();
- logger.debug("Found object: " + objectKey + " in " + langu=
ageCode);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Found object: " + objectKey + " in " + l=
anguageCode);
+ }
final Element lang =3D resp.createElement("lang");
lang.setAttribute("code", languageCode);
if (errors && ! currentUser.isAdminMember(jParams.getSiteI=
D())) {
@@ -662,7 +680,9 @@
final String additionalKey =3D (String) optionsIte=
r.next();
if (languageState.intValue() !=3D EntryLoadRequest=
.ACTIVE_WORKFLOW_STATE &&
workflowHelper.isActive(object.getObjectKe=
y(), languageCode, action, additionalKey)) {
- logger.debug("additionalKey" + i + " for " + l=
anguageCode + ": " + additionalKey);
+ if (logger.isDebugEnabled()) {
+ logger.debug("additionalKey" + i + " for "=
+ languageCode + ": " + additionalKey);
+ }
lang.setAttribute("additionalKey" + i, additio=
nalKey);
}
i++;
@@ -677,11 +697,15 @@
objectKey.getType(), id);
if (lockRegistry.acquire(lockKey, currentUser, currentUser.get=
UserKey(),
jParams.getSessionState().getMaxInactiveInterval())) {
- logger.info("Lock acquired for object " + objectKey + " by=
" + currentUser.getUsername());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Lock acquired for object " + objectKey +=
" by " + currentUser.getUsername());
+ }
final Set wl =3D (Set) jParams.getSessionState().getAttrib=
ute("workflowLocks");
wl.add(lockKey);
} else {
- logger.info("Cannot acquire lock for object " + objectKey =
+ " by " + currentUser.getUsername());
+ if (logger.isInfoEnabled()) {
+ logger.info("Cannot acquire lock for object " + object=
Key + " by " + currentUser.getUsername());
+ }
item.setAttribute("locked", html.drawLockEngineLauncher(lo=
ckKey));
item.setAttribute("Disable", "Disable");
}
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap=
/UnlockWorkFlowChildObjects.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/ajax/sitemap/UnlockWorkFlowChildObjects.jav=
a&rev=3D18379&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/Unloc=
kWorkFlowChildObjects.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/Unloc=
kWorkFlowChildObjects.java Wed Sep 5 18:32:13 2007
@@ -83,8 +83,10 @@
Set wl =3D (Set) jParams.getSessionState().getAttr=
ibute("workflowLocks");
if (wl.contains(lockKey)) {
lockRegistry.release(lockKey, currentUser, cur=
rentUser.getUserKey());
- logger.info("Lock released for object " + obje=
ctKey +
+ if (logger.isDebugEnabled()) {
+ logger.debug("Lock released for object " +=
objectKey +
" by " + currentUser.getUsername()=
);
+ }
wl.remove(lockKey);
}
}
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/app=
lications/ServletIncludeRequestWrapper.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/services/applications/ServletIncludeRequest=
Wrapper.java&rev=3D18379&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/applicati=
ons/ServletIncludeRequestWrapper.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/applicati=
ons/ServletIncludeRequestWrapper.java Wed Sep 5 18:32:13 2007
@@ -190,12 +190,14 @@
je);
emulatedURL =3D null;
}
- logger.debug("emulatedURL value : [" + emulatedURL + "]");
- logger
- .debug("super.requestURI value : [" + super.getRequestURI()
- + "]");
- logger.debug("initial requestURI value : [" + initialRequestURI + =
"]");
-
+ =
+ if (logger.isDebugEnabled()) {
+ logger.debug("emulatedURL value : [" + emulatedURL + "]");
+ logger
+ .debug("super.requestURI value : [" + super.getRequest=
URI()
+ + "]");
+ logger.debug("initial requestURI value : [" + initialRequestUR=
I + "]");
+ }
}
=
// -------------------------------------------------------------------=
-------
@@ -218,17 +220,19 @@
*/
=
if (!super.getRequestURI().equals(initialRequestURI)) {
- logger.debug("Request URI Has changed ! emulatedURI=3D"
+ if (logger.isDebugEnabled()) {
+ logger.debug("Request URI Has changed ! emulatedURI=3D"
+ initialRequestURI + ", super.getRequestURI()=3D"
+ super.getRequestURI());
- if (this.emulatedURL !=3D null) {
- logger.debug(",emulatedURL=3D" + this.emulatedURL.toString=
());
- }
- if (super.getRequestURL() !=3D null) {
- logger.debug(", super.getRequestURL()=3D" + super.getReque=
stURL()
- + "\n");
- } else {
- logger.debug(", super.getRequestURL()=3Dnull\n");
+ if (this.emulatedURL !=3D null) {
+ logger.debug(",emulatedURL=3D" + this.emulatedURL.toSt=
ring());
+ }
+ if (super.getRequestURL() !=3D null) {
+ logger.debug(", super.getRequestURL()=3D" + super.getR=
equestURL()
+ + "\n");
+ } else {
+ logger.debug(", super.getRequestURL()=3Dnull\n");
+ }
}
/*
* logger.debug(RequestDispatcherWrapper.INCLUDE_REQUEST_URI +=
"=3D" + getAttribute("javax.servlet.include.request_uri") + ",
@@ -285,7 +289,9 @@
=
if (queryString !=3D null) {
// Parse any parameters specified in the query string
- logger.info("Parsing query string [" + queryString + "]");
+ if (logger.isInfoEnabled()) {
+ logger.info("Parsing query string [" + queryString + "=
]");
+ }
if (parameters =3D=3D null) {
parameters =3D new Hashtable();
}
@@ -503,14 +509,18 @@
*/
=
public RequestDispatcher getRequestDispatcher(String path) {
- logger.debug("path =3D [" + path + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("path =3D [" + path + "]");
+ }
if (emulatedURL !=3D null) {
ServletContext dispatchedContext =3D jahiaParams.getContext()
.getContext(emulatedContextPath);
if (dispatchedContext =3D=3D null) {
- logger.debug("Error getting request context "
+ if (logger.isDebugEnabled()) {
+ logger.debug("Error getting request context "
+ emulatedContextPath + " for app "
+ appRequest.getName());
+ }
return null;
}
=
@@ -527,19 +537,25 @@
// This method maps servlet roles on Jahia's groups
if (emulatedURL !=3D null) {
if (jahiaParams =3D=3D null) {
- logger.debug("Jahia Params is null, exiting immediately...=
");
+ if (logger.isDebugEnabled()) {
+ logger.debug("Jahia Params is null, exiting immediatel=
y...");
+ }
return false;
}
JahiaUser user =3D jahiaParams.getUser();
if (user !=3D null) {
if (appRequest =3D=3D null) {
- logger
+ if (logger.isDebugEnabled()) {
+ logger
.debug("Null application request object, exiti=
ng isUserInRole...");
+ }
return false;
}
if (appRequest.getApplicationBean() =3D=3D null) {
- logger
+ if (logger.isDebugEnabled()) {
+ logger
.debug("Null application bean object, exiting =
isUserInRole...");
+ }
return false;
}
// Hollis all apps groups roles are a group with siteID=3D0
@@ -550,36 +566,48 @@
+ contextIdentifier + "_" + role);
if (roleGroup !=3D null) {
if (roleGroup.isMember(user) =3D=3D true) {
- logger.debug("User [" + user.getUsername()
+ if (logger.isDebugEnabled()) {
+ logger.debug("User [" + user.getUsername()
+ "] is a member of role ["
+ roleGroup.getName() + "]");
+ }
return true; // user is indeed member of role (aka=
group)
} else {
- logger.debug("User [" + user.getUsername()
+ if (logger.isDebugEnabled()) {
+ logger.debug("User [" + user.getUsername()
+ "] is NOT a member of role ["
+ roleGroup.getName() + "]");
+ }
return false; // user is not member of role (=3Dgr=
oup)
}
} else {
- logger.debug("Role ["
+ if (logger.isDebugEnabled()) {
+ logger.debug("Role ["
+ appRequest.getApplicationBean().getID() + "_"
+ contextIdentifier + "_" + role
+ "] not found in Jahia's groups!");
+ }
return false; // the role (aka group) does not exist
}
} else {
- logger.debug("No user logged, ignoring call !");
+ if (logger.isDebugEnabled()) {
+ logger.debug("No user logged, ignoring call !");
+ }
return false;
}
} else {
// default servlet behavior
- logger.debug("Using servlet API standard call...");
+ if (logger.isDebugEnabled()) {
+ logger.debug("Using servlet API standard call...");
+ }
return super.isUserInRole(role);
}
}
=
public void setContextPath(String newPath) {
- logger.debug("setContextPath(" + newPath + ")");
+ if (logger.isDebugEnabled()) {
+ logger.debug("setContextPath(" + newPath + ")");
+ }
// emulatedContextPath =3D newPath;
}
=
@@ -590,8 +618,10 @@
return contextPath;
}
}
- logger.debug(" super.getContextPath=3D[" + contextPath + "]");
- logger.debug("emulatedContextPath =3D [" + emulatedContextPath + "=
]");
+ if (logger.isDebugEnabled()) {
+ logger.debug(" super.getContextPath=3D[" + contextPath + "]");
+ logger.debug("emulatedContextPath =3D [" + emulatedContextPath=
+ "]");
+ }
return emulatedContextPath;
}
=
@@ -905,7 +935,9 @@
public String getRequestURI() {
=
String requestURI =3D super.getRequestURI();
- logger.debug(" super.getRequestURI()=3D[" + requestURI + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug(" super.getRequestURI()=3D[" + requestURI + "]");
+ }
=
if (emulatedURL !=3D null) {
if (hasRequestURIChanged()) {
@@ -929,7 +961,9 @@
}
// requestURL +=3D this.jSessionId;
=
- logger.debug("emulated requestURI =3D [" + requestURL + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("emulated requestURI =3D [" + requestURL + "]=
");
+ }
// return getContextPath()+ "/" + appRequest.getServletName();
return requestURL;
} else {
@@ -947,8 +981,10 @@
if (emulatedURL !=3D null) {
emulURL =3D emulatedURL.toString();
}
- logger.debug(" super.getRequestURL()=3D[" + reqURL + "], emulatedU=
RL=3D"
+ if (logger.isDebugEnabled()) {
+ logger.debug(" super.getRequestURL()=3D[" + reqURL + "], emula=
tedURL=3D"
+ emulURL);
+ }
=
if (emulatedURL !=3D null) {
if (hasRequestURIChanged()) {
@@ -957,7 +993,9 @@
/*
* logger.debug ("emulated requestURL =3D [" + super.getReques=
tURL () + "]"); return super.getRequestURL ();
*/
- logger.debug("emulated requestURL =3D [" + emulatedURL + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("emulated requestURL =3D [" + emulatedURL + "=
]");
+ }
return new StringBuffer(emulatedURL.toString());
} else {
return super.getRequestURL();
@@ -967,18 +1005,22 @@
public String getServletPath() {
String servletPath =3D super.getServletPath();
String pathInfo =3D super.getPathInfo();
- logger.debug("super.getServletPath()=3D[" + servletPath + "]");
- logger
- .debug("emulated servlet path [" + this.emulatedServletPath
- + "]");
- logger.debug("while super.getPathInfo()=3D[" + pathInfo + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("super.getServletPath()=3D[" + servletPath + "]");
+ logger
+ .debug("emulated servlet path [" + this.emulatedServle=
tPath
+ + "]");
+ logger.debug("while super.getPathInfo()=3D[" + pathInfo + "]");
+ }
=
if (emulatedURL !=3D null) {
=
if (hasRequestURIChanged()) {
- logger
+ if (logger.isDebugEnabled()) {
+ logger
.debug("Request URI has changed, returning super.g=
etServletPath=3D["
+ servletPath + "]");
+ }
return servletPath;
// emulatedServletPath =3D serverPath;
}
@@ -991,8 +1033,10 @@
* @todo remove this hack that was introduced to make inte=
rnal app redirection to JSP work. Must find a better way to detect
* this. This will fail if we try to redirect to a J=
SP directly (or maybe it works but not guaranteed.
*/
- logger.debug("JSP servlet path (" + servletPath
+ if (logger.isDebugEnabled()) {
+ logger.debug("JSP servlet path (" + servletPath
+ ") detected, returning server path...");
+ }
this.emulatedServletPath =3D servletPath;
if (super.getPathInfo() !=3D null) {
this.emulatedPathInfo =3D super.getPathInfo();
@@ -1008,8 +1052,10 @@
return servletPath;
}
=
- logger.debug("emulated servlet path [" + this.emulatedServletP=
ath
+ if (logger.isDebugEnabled()) {
+ logger.debug("emulated servlet path [" + this.emulatedServ=
letPath
+ "]");
+ }
return this.emulatedServletPath;
}
=
@@ -1019,13 +1065,17 @@
=
public String getQueryString() {
String queryString =3D super.getQueryString();
- logger.debug("super.getQueryString()=3D[" + queryString + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("super.getQueryString()=3D[" + queryString + "]");
+ }
if (emulatedURL !=3D null) {
if (hasRequestURIChanged()) {
return queryString;
}
=
- logger.debug("getQueryString() =3D [" + emulatedURL.getQuery()=
+ "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("getQueryString() =3D [" + emulatedURL.getQue=
ry() + "]");
+ }
return emulatedURL.getQuery();
} else {
return super.getQueryString();
@@ -1034,8 +1084,10 @@
=
public String getPathTranslated() {
if (emulatedURL !=3D null) {
- logger.debug("getPathTranslated() =3D [" + super.getPathTransl=
ated()
+ if (logger.isDebugEnabled()) {
+ logger.debug("getPathTranslated() =3D [" + super.getPathTr=
anslated()
+ "]");
+ }
return super.getPathTranslated();
} else {
return super.getPathTranslated();
@@ -1048,7 +1100,9 @@
loc =3D jahiaParams.getLocale();
else
loc =3D super.getLocale();
- logger.debug("getLocale() =3D [" + loc + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("getLocale() =3D [" + loc + "]");
+ }
return loc;
}
=
@@ -1061,27 +1115,37 @@
logger.debug("error getting locales", ex);
locales =3D Collections.singletonList(Locale.getDefault());
}
- logger.debug("getLocale() =3D [" + locales + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("getLocale() =3D [" + locales + "]");
+ }
return Collections.enumeration(locales);
} else {
- logger.debug("getLocale() =3D [" + super.getLocales() + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("getLocale() =3D [" + super.getLocales() + "]=
");
+ }
return super.getLocales();
}
}
=
public String getPathInfo() {
String pathInfo =3D super.getPathInfo();
- logger.debug("super.getPathInfo()=3D[" + pathInfo + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("super.getPathInfo()=3D[" + pathInfo + "]");
+ }
=
if (emulatedURL =3D=3D null) {
- logger.debug("getPathInfo() =3D [" + pathInfo + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("getPathInfo() =3D [" + pathInfo + "]");
+ }
return pathInfo;
} else {
if (hasRequestURIChanged()) {
return pathInfo;
}
- logger.debug("getPathInfo() emulated pathInfo =3D ["
+ if (logger.isDebugEnabled()) {
+ logger.debug("getPathInfo() emulated pathInfo =3D ["
+ this.emulatedPathInfo + "]");
+ }
return this.emulatedPathInfo;
}
}
@@ -1133,7 +1197,9 @@
}
=
public String[] getParameterValues(String name) {
- logger.debug("getParameterValues(" + name + ")");
+ if (logger.isDebugEnabled()) {
+ logger.debug("getParameterValues(" + name + ")");
+ }
if (emulatedURL !=3D null && !hasRequestURIChanged()) {
=
Object objValue =3D parameters.get(name);
@@ -1165,7 +1231,9 @@
=
public Map getParameterMap() {
if (emulatedURL !=3D null && !hasRequestURIChanged()) {
- logger.debug("getParameterMap()");
+ if (logger.isDebugEnabled()) {
+ logger.debug("getParameterMap()");
+ }
return Collections.unmodifiableMap(parameters);
} else {
return super.getParameterMap();
@@ -1181,7 +1249,9 @@
PrintWriter pw =3D new PrintWriter(sw);
Throwable t =3D (Throwable) o;
t.printStackTrace(pw);
- logger.debug("Exception : " + sw.toString());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Exception : " + sw.toString());
+ }
}
}
=
@@ -1211,12 +1281,16 @@
}
=
public void removeAttribute(String name) {
- logger.debug("removeAttribute(" + name + ")");
+ if (logger.isDebugEnabled()) {
+ logger.debug("removeAttribute(" + name + ")");
+ }
super.removeAttribute(name);
}
=
public Object getAttribute(String name) {
- logger.debug("getAttribute(" + name + ")");
+ if (logger.isDebugEnabled()) {
+ logger.debug("getAttribute(" + name + ")");
+ }
return super.getAttribute(name);
}
=
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/app=
lications/ServletIncludeResponseWrapper.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/services/applications/ServletIncludeRespons=
eWrapper.java&rev=3D18379&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/applicati=
ons/ServletIncludeResponseWrapper.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/applicati=
ons/ServletIncludeResponseWrapper.java Wed Sep 5 18:32:13 2007
@@ -101,7 +101,9 @@
public ServletIncludeResponseWrapper (HttpServletResponse httpServletR=
esponse,
boolean passThrough, String forc=
edEncoding) {
super (httpServletResponse);
- logger.debug ("Initializing using normal mode");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("Initializing using normal mode");
+ }
appUniqueIDStr =3D null;
this.isPassThrough =3D passThrough;
this.forceEncoding =3D forcedEncoding;
@@ -122,7 +124,9 @@
boolean passThrough,
String forcedEncoding) {
super (httpServletResponse);
- logger.debug ("Initializing using emulation mode. appID =3D [" + a=
ppUniqueID + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("Initializing using emulation mode. appID =3D ["=
+ appUniqueID + "]");
+ }
appUniqueIDStr =3D appUniqueID;
jahiaParams =3D jParams;
emulatedURL =3D emulURL;
@@ -139,8 +143,10 @@
String appUniqueID, String emulURL, ParamBean jParams,
boolean passThrough, String forcedEncoding) {
super(httpServletResponse);
- logger.debug("Initializing using emulation mode. appID =3D ["
+ if (logger.isDebugEnabled()) {
+ logger.debug("Initializing using emulation mode. appID =3D ["
+ appUniqueID + "]");
+ }
appUniqueIDStr =3D appUniqueID;
jahiaParams =3D jParams;
emulatedURL =3D emulURL;
@@ -154,9 +160,11 @@
}
=
public PrintWriter getWriter () {
- logger.debug ("Using a print writer for output");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("Using a print writer for output");
+ }
checkStreams ();
- if (outputStreamCalled) {
+ if (outputStreamCalled && logger.isDebugEnabled()) {
logger.debug (
"Servlet compliance warning, OutputStream has already =
been called, the response output will be reset !");
}
@@ -164,7 +172,9 @@
}
=
public ServletOutputStream getOutputStream () throws IOException {
- logger.debug ("Using an output stream for output");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("Using an output stream for output");
+ }
checkStreams ();
this.outputStreamCalled =3D true;
return strOutputStream;
@@ -217,19 +227,27 @@
}
}
*/
- logger.debug ("flushBuffer()");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("flushBuffer()");
+ }
}
=
public void resetBuffer () {
- logger.debug ("resetBuffer()");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("resetBuffer()");
+ }
}
=
public void finishResponse () {
- logger.debug ("finishResponse()");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("finishResponse()");
+ }
}
=
public boolean isCommitted () {
- logger.debug ("isCommitted()");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("isCommitted()");
+ }
return false;
}
=
@@ -300,15 +318,19 @@
.getApplication (entryPoint.getApplicationID()=
);
=
if (appBean =3D=3D null) {
- logger.debug (
+ if (logger.isDebugEnabled()) {
+ logger.debug (
"The requested application [" + appUniqueI=
DStr + "] is not available");
+ }
}
=
ServletContext dispatchedContext =3D ((ParamBean)Jahia=
.getThreadParamBean ())
.getContext ().getContext (appBean.getContext =
());
if (dispatchedContext =3D=3D null) {
- logger.debug ("Error getting dispatch context [" +
+ if (logger.isDebugEnabled()) {
+ logger.debug ("Error getting dispatch context =
[" +
appBean.getContext () + "]");
+ }
return super.encodeURL (url);
}
try {
@@ -332,14 +354,18 @@
return super.encodeURL (url);
}
if(dispatchedContext.getRequestDispatcher(path)!=
=3Dnull && "portlet".equals(appBean.getType())) {
- logger.debug("Path =3D "+path+ " URL =3D "+url=
+ " Context =3D "+appBean.getContext());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Path =3D "+path+ " URL =3D "=
+url+ " Context =3D "+appBean.getContext());
+ }
if(!url.startsWith(Jahia.getContextPath())) {
if(url.indexOf(appBean.getContext())<0){
url=3DappBean.getContext()+url;
encodeInJahia =3D false;
} else {
url =3D super.encodeURL(url);
- logger.debug("return encoded url "+url=
);
+ if (logger.isDebugEnabled()) {
+ logger.debug("return encoded url "=
+url);
+ }
return url;
}
// if(!URL.startsWith("http")) {
@@ -419,7 +445,9 @@
}
}
=
- logger.debug ("encodeURL.contextURL=3D[" + contextURL.toSt=
ring () + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("encodeURL.contextURL=3D[" + contextURL.=
toString () + "]");
+ }
=
resolvedURL =3D new URL (contextURL, realURL);
} catch (MalformedURLException mue) {
@@ -490,8 +518,10 @@
=
} else {
if (url.indexOf (";jsessionid=3D") !=3D -1) {
- logger.debug (
+ if (logger.isDebugEnabled()) {
+ logger.debug (
"jsessionid already in URL, ignoring call and retu=
rning unmodified URL... ");
+ }
servletIncludeURL =3D url;
} else {
servletIncludeURL =3D internalEncodeURL(url); // let's add=
Java
@@ -500,7 +530,9 @@
if (!servletIncludeURL.startsWith("http")) {
servletIncludeURL =3D super.encodeURL(servletIncludeURL);
}
- logger.debug("encodeURL return "+servletIncludeURL);
+ if (logger.isDebugEnabled()) {
+ logger.debug("encodeURL return "+servletIncludeURL);
+ }
return servletIncludeURL;
}
=
@@ -509,9 +541,13 @@
}
=
public void sendRedirect (String location) throws IOException {
- logger.debug ("location=3D" + location + "");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("location=3D" + location + "");
+ }
if (redirectLocation !=3D null) {
- logger.debug ("Multiple calls to sendRedirect, keeping only th=
e first one.");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("Multiple calls to sendRedirect, keeping onl=
y the first one.");
+ }
} else {
if (location.endsWith ("/")) {
redirectLocation =3D location.substring (0, location.lengt=
h () - 1);
@@ -520,18 +556,24 @@
}
}
if (isPassThrough) {
- logger.debug (
+ if (logger.isDebugEnabled()) {
+ logger.debug (
"Pass-through active, sending redirect to wrapped resp=
onse directly...");
+ }
super.sendRedirect (location);
} else {
- logger.debug ("redirectLocation=3D" + redirectLocation + "");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("redirectLocation=3D" + redirectLocation + "=
");
+ }
}
}
=
=
public void setContentType (java.lang.String type) {
- logger.debug ("Content-type set to [" + type + "]");
- if (contentType !=3D null) {
+ if (logger.isDebugEnabled()) {
+ logger.debug ("Content-type set to [" + type + "]");
+ }
+ if (contentType !=3D null && logger.isDebugEnabled()) {
if (!this.contentType.equals (type)) {
logger.debug ("Warning, content type has already been set =
to [" +
contentType + "]. Trying to set now to [" + type +
@@ -539,7 +581,9 @@
}
}
if (forceEncoding !=3D null) {
- logger.debug ("Enforcing charset=3D[" + forceEncoding + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug ("Enforcing charset=3D[" + forceEncoding + "]=
");
+ }
int separatorPos =3D type.indexOf (";");
if (separatorPos > 0) {
type =3D type.substring (0, separatorPos);
@@ -569,8 +613,10 @@
} catch (Exception e) {
}
} else {
- logger.debug (
+ if (logger.isDebugEnabled()) {
+ logger.debug (
"Not setting parent response object because this wrapp=
er is not in pass-through mode");
+ }
}
}
=
@@ -604,7 +650,9 @@
}
=
public void addCookie (Cookie cookie) {
- logger.debug ("Adding cookie name=3D" + cookie.getName ());
+ if (logger.isDebugEnabled()) {
+ logger.debug ("Adding cookie name=3D" + cookie.getName ());
+ }
super.addCookie (cookie);
}
=
@@ -613,19 +661,25 @@
try {
// strPrintWriter =3D new StringPrintWriter(new StringWrit=
er(), outputStringBuffer);
if (isPassThrough) {
- logger.debug (
+ if (logger.isDebugEnabled()) {
+ logger.debug (
"Creating output streams for response wrapper =
using pass-through servlet output stream...");
+ }
strOutputStream =3D
new StringServletOutputStream (
super.getResponse ().getOutputStream (=
), encoding);
} else {
- logger.debug (
+ if (logger.isDebugEnabled()) {
+ logger.debug (
"Creating output streams for response wrapper =
using only stringbuffers and no pass-through...");
+ }
strOutputStream =3D new StringServletOutputStream (enc=
oding);
}
OutputStreamWriter streamWriter;
if (encoding !=3D null) {
- logger.debug ("Using PrintWriter with encoding : " + e=
ncoding);
+ if (logger.isDebugEnabled()) {
+ logger.debug ("Using PrintWriter with encoding : "=
+ encoding);
+ }
streamWriter =3D new OutputStreamWriter (strOutputStre=
am, encoding);
} else {
streamWriter =3D new OutputStreamWriter (strOutputStre=
am);
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list