You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by st...@apache.org on 2011/10/26 16:41:43 UTC
svn commit: r1189247 - in
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces: el/unified/
el/unified/resolver/ el/unified/resolver/implicitobject/ lifecycle/
logging/ renderkit/ renderkit/html/ shared_impl/webapp/webxml/
Author: struberg
Date: Wed Oct 26 14:41:42 2011
New Revision: 1189247
URL: http://svn.apache.org/viewvc?rev=1189247&view=rev
Log:
MYFACES-3368 fix codestyle errors
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/ResolverBuilderBase.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceResolver.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/InitParamImplicitObject.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ParamImplicitObject.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewSupport.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogKey.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogMessage.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogger.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlDoctypeRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormatRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXmlParser.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/ResolverBuilderBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/ResolverBuilderBase.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/ResolverBuilderBase.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/ResolverBuilderBase.java Wed Oct 26 14:41:42 2011
@@ -24,7 +24,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import javax.el.ELResolver;
-import javax.faces.application.Application;
import javax.faces.el.PropertyResolver;
import javax.faces.el.VariableResolver;
@@ -73,7 +72,8 @@ public class ResolverBuilderBase
/**
* add the el resolvers from the faces config, the el resolver wrapper for variable resolver, the el resolver
- * wrapper for the property resolver and the el resolvers added by {@link Application#addELResolver(ELResolver)}.
+ * wrapper for the property resolver and the el resolvers added by
+ * {@link javax.faces.application.Application#addELResolver(ELResolver)}.
* The resolvers where only added if they are not null
*
* @param resolvers
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceResolver.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceResolver.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceResolver.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceResolver.java Wed Oct 26 14:41:42 2011
@@ -107,7 +107,8 @@ public final class ResourceResolver exte
{
FacesContext facesContext = facesContext(context);
Location location = ResourceELUtils.getResourceLocationForResolver(facesContext);
- UIComponent cc = CompositeComponentELUtils.getCompositeComponentBasedOnLocation(facesContext, location);
+ UIComponent cc = CompositeComponentELUtils.
+ getCompositeComponentBasedOnLocation(facesContext, location);
Resource ccResource = (Resource) cc.getAttributes().get(Resource.COMPONENT_RESOURCE_KEY);
libraryName = ccResource.getLibraryName();
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/InitParamImplicitObject.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/InitParamImplicitObject.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/InitParamImplicitObject.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/InitParamImplicitObject.java Wed Oct 26 14:41:42 2011
@@ -59,7 +59,8 @@ public class InitParamImplicitObject ext
public FeatureDescriptor getDescriptor()
{
return makeDescriptor(NAME,
- "Map whose keys are a set of application initialization param names and whose values are the corresponding values",
+ "Map whose keys are a set of application initialization param names "
+ + "and whose values are the corresponding values",
Map.class);
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ParamImplicitObject.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ParamImplicitObject.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ParamImplicitObject.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ParamImplicitObject.java Wed Oct 26 14:41:42 2011
@@ -59,7 +59,8 @@ public class ParamImplicitObject extends
public FeatureDescriptor getDescriptor()
{
return makeDescriptor(NAME,
- "Map whose keys are a set of request param names and whose values are the first (or only) values for each name in the request",
+ "Map whose keys are a set of request param names and whose values are the "
+ + "first (or only) values for each name in the request",
Map.class);
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java Wed Oct 26 14:41:42 2011
@@ -107,8 +107,8 @@ class RenderResponseExecutor extends Pha
Level level = production ? Level.FINE : Level.WARNING;
if (log.isLoggable(level))
{
- log.log(level, "Cicle over buildView-PreRenderViewEvent on RENDER_RESPONSE phase reaches maximal limit, please check " +
- "listeners for infinite recursion.");
+ log.log(level, "Cicle over buildView-PreRenderViewEvent on RENDER_RESPONSE phase "
+ + "reaches maximal limit, please check listeners for infinite recursion.");
}
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java Wed Oct 26 14:41:42 2011
@@ -129,8 +129,8 @@ class RestoreViewExecutor extends PhaseE
{
// If the return from ViewHandler.restoreView() is null, throw a ViewExpiredException with an
// appropriate error message.
- throw new ViewExpiredException("No saved view state could be found for the view identifier: " + viewId,
- viewId);
+ throw new ViewExpiredException("No saved view state could be found for the view identifier: "
+ + viewId, viewId);
}
// Store the restored UIViewRoot in the FacesContext.
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewSupport.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewSupport.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewSupport.java Wed Oct 26 14:41:42 2011
@@ -18,9 +18,7 @@
*/
package org.apache.myfaces.lifecycle;
-import javax.faces.FacesException;
import javax.faces.component.UIComponent;
-import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
/**
@@ -37,10 +35,10 @@ public interface RestoreViewSupport
* </p>
* <ul>
* <li>lookup the viewid from the request attribute "javax.servlet.include.path_info"
- * <li>if null lookup the value for viewid by {@link ExternalContext#getRequestPathInfo()}
+ * <li>if null lookup the value for viewid by {@link javax.faces.context.ExternalContext#getRequestPathInfo()}
* <li>if null lookup the value for viewid from the request attribute "javax.servlet.include.servlet_path"
- * <li>if null lookup the value for viewid by {@link ExternalContext#getRequestServletPath()}
- * <li>if null throw a {@link FacesException}
+ * <li>if null lookup the value for viewid by {@link javax.faces.context.ExternalContext#getRequestServletPath()}
+ * <li>if null throw a {@link javax.faces.FacesException}
* </ul>
*/
String calculateViewId(FacesContext facesContext);
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogKey.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogKey.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogKey.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogKey.java Wed Oct 26 14:41:42 2011
@@ -21,12 +21,14 @@ package org.apache.myfaces.logging;
/**
* Object representation of log key.
*/
-public interface MyfacesLogKey {
+public interface MyfacesLogKey
+{
/**
* Returns String representation of this log key.
*
- * Q: why is this method name(), not getName()? A: java enum can out of the box implement this interface - {@link Enum#name()}
+ * Q: why is this method name(), not getName()? A: java enum can out of the box
+ * implement this interface - {@link Enum#name()}
*
* @return String reprezentation of log key
*/
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogMessage.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogMessage.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogMessage.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogMessage.java Wed Oct 26 14:41:42 2011
@@ -23,7 +23,8 @@ import javax.faces.application.FacesMess
/**
* Normal logging or/and exception handling works with one String message (like {@link Throwable#getMessage()}.
*
- * The purpose of this class is to provide object oriented representation of message - useful properties can be added later.
+ * The purpose of this class is to provide object oriented representation
+ * of message - useful properties can be added later.
*
*/
public class MyfacesLogMessage extends FacesMessage
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogger.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogger.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogger.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/logging/MyfacesLogger.java Wed Oct 26 14:41:42 2011
@@ -34,7 +34,8 @@ import java.util.logging.Logger;
* Packages or Classes (not arbitrary names) to force
* proper logging hierarchies.
*
- * Has predefined Logger for javax.faces related packages, like {@link MyfacesLogger#APPLICATION_LOGGER} for javax.faces.application and related
+ * Has predefined Logger for javax.faces related packages, like
+ * {@link MyfacesLogger#APPLICATION_LOGGER} for javax.faces.application and related
*
* Original code copied from TrinidadLogger
*
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java Wed Oct 26 14:41:42 2011
@@ -81,13 +81,13 @@ import org.apache.myfaces.view.facelets.
/**
* This class provides utility methods to generate the
* MyFaces error and debug pages.
- *
+ *
* @author Jacob Hookom (ICLA with ASF filed)
* @author Jakob Korherr (refactored and moved here from javax.faces.webapp._ErrorPageWriter)
*/
public final class ErrorPageWriter
{
-
+
/**
* This bean aims to generate the error page html for inclusion on a facelet error page via
* <ui:include src="javax.faces.error.xhtml" />. When performing this include the facelet
@@ -99,26 +99,26 @@ public final class ErrorPageWriter
*/
public static class ErrorPageBean implements Serializable
{
-
+
private static final long serialVersionUID = -79513324193326616L;
public String getErrorPageHtml() throws IOException
{
FacesContext facesContext = FacesContext.getCurrentInstance();
Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
-
+
Throwable t = (Throwable) requestMap.get(EXCEPTION_KEY);
if (t == null)
{
throw new IllegalStateException("No Exception to handle");
}
-
+
UIViewRoot view = (UIViewRoot) requestMap.get(VIEW_KEY);
-
+
StringWriter writer = new StringWriter();
ErrorPageWriter.debugHtml(writer, facesContext, view, null, t);
String html = writer.toString();
-
+
// change the HTML in the buffer to be included in an existing html page
String body;
try
@@ -130,7 +130,7 @@ public final class ErrorPageWriter
// no body found - return the entire html
return html;
}
-
+
String head;
try
{
@@ -141,7 +141,7 @@ public final class ErrorPageWriter
// no head found - return entire body
return body;
}
-
+
// extract style and script information from head and add it to body
StringBuilder builder = new StringBuilder(body);
// extract <style>
@@ -176,17 +176,17 @@ public final class ErrorPageWriter
break;
}
}
-
+
return builder.toString();
}
-
+
}
-
+
/**
* The key which is used to store the ErrorPageBean in the view map of a facelet error page.
*/
public static final String ERROR_PAGE_BEAN_KEY = "__myFacesErrorPageBean";
-
+
private static final String EXCEPTION_KEY = "javax.servlet.error.exception";
public static final String VIEW_KEY = "org.apache.myfaces.error.UIViewRoot";
@@ -199,14 +199,14 @@ public final class ErrorPageWriter
/**
* Indicate the template name used to render the default error page used by MyFaces specific
* error handler implementation.
- *
+ *
* <p>See org.apache.myfaces.ERROR_HANDLING for details about
* how to enable/disable it.</p>
*/
@JSFWebConfigParam(defaultValue="META-INF/rsc/myfaces-dev-error.xml", since="1.2.4")
private static final String ERROR_TEMPLATE_RESOURCE = "org.apache.myfaces.ERROR_TEMPLATE_RESOURCE";
- private static String[] ERROR_PARTS;
+ private static String[] errorParts;
private static final String DEBUG_TEMPLATE = "META-INF/rsc/myfaces-dev-debug.xml";
@@ -216,29 +216,28 @@ public final class ErrorPageWriter
@JSFWebConfigParam(defaultValue="META-INF/rsc/myfaces-dev-debug.xml", since="1.2.4")
private static final String DEBUG_TEMPLATE_RESOURCE = "org.apache.myfaces.DEBUG_TEMPLATE_RESOURCE";
- private static String[] DEBUG_PARTS;
-
+ private static String[] debugParts;
+
private static final String REGEX_PATTERN = ".*?\\Q,Id:\\E\\s*(\\S+)\\s*\\].*?";
-
+
private final static String[] IGNORE = new String[] { "parent", "rendererType" };
-
+
private final static String[] ALWAYS_WRITE = new String[] { "class", "clientId" };
-
+
/**
* Extended debug info is stored under this key in the request
* map for every UIInput component when in Development mode.
* ATTENTION: this constant is duplicate in javax.faces.component.UIInput
*/
public static final String DEBUG_INFO_KEY = "org.apache.myfaces.debug.DEBUG_INFO";
-
+
/**
* The number of facets of this component which have already been visited while
* creating the extended component tree is saved under this key in the component's
* attribute map.
*/
//private static final String VISITED_FACET_COUNT_KEY = "org.apache.myfaces.debug.VISITED_FACET_COUNT";
-
- private static final Map<UIComponent, Integer> visitedFacetCount = new HashMap<UIComponent, Integer>();
+ private static Map<UIComponent, Integer> visitedFacetCount = new HashMap<UIComponent, Integer>();
/**
* Indicate if myfaces is responsible to handle errors.
@@ -252,7 +251,7 @@ public final class ErrorPageWriter
{
super();
}
-
+
/**
* Generates the HTML error page for the given Throwable
* and writes it to the given writer.
@@ -265,16 +264,17 @@ public final class ErrorPageWriter
{
debugHtml(writer, faces, faces.getViewRoot(), null, e);
}
-
+
private static void debugHtml(Writer writer, FacesContext faces, UIViewRoot view,
Collection<UIComponent> components, Throwable... exs) throws IOException
{
_init(faces);
Date now = new Date();
- for (int i = 0; i < ERROR_PARTS.length; i++)
+ for (int i = 0; i < errorParts.length; i++)
{
- if ("view".equals((ERROR_PARTS[i]))) {
+ if ("view".equals((errorParts[i])))
+ {
if (faces.getViewRoot() != null)
{
String viewId = faces.getViewRoot().getViewId();
@@ -298,9 +298,9 @@ public final class ErrorPageWriter
writer.write("phaseId=" + faces.getCurrentPhaseId());
writer.write("<br/>");
writer.write("<br/>");
- }
+ }
}
- else if ("message".equals(ERROR_PARTS[i]))
+ else if ("message".equals(errorParts[i]))
{
boolean printed = false;
//Iterator<UIComponent> iterator = null;
@@ -326,7 +326,7 @@ public final class ErrorPageWriter
printed = true;
}
}
- else if ("trace".equals(ERROR_PARTS[i]))
+ else if ("trace".equals(errorParts[i]))
{
boolean printed = false;
for (Throwable e : exs)
@@ -339,11 +339,11 @@ public final class ErrorPageWriter
printed = true;
}
}
- else if ("now".equals(ERROR_PARTS[i]))
+ else if ("now".equals(errorParts[i]))
{
writer.write(DateFormat.getDateTimeInstance().format(now));
}
- else if ("tree".equals(ERROR_PARTS[i]))
+ else if ("tree".equals(errorParts[i]))
{
if (view != null)
{
@@ -351,16 +351,16 @@ public final class ErrorPageWriter
_writeComponent(faces, writer, view, errorIds, true);
}
}
- else if ("vars".equals(ERROR_PARTS[i]))
+ else if ("vars".equals(errorParts[i]))
{
_writeVariables(writer, faces, view);
}
- else if ("cause".equals(ERROR_PARTS[i]))
+ else if ("cause".equals(errorParts[i]))
{
boolean printed = false;
Iterator<UIComponent> iterator = null;
if (components != null)
- {
+ {
iterator = components.iterator();
}
for (Throwable e : exs)
@@ -373,11 +373,9 @@ public final class ErrorPageWriter
if (iterator != null)
{
UIComponent uiComponent = iterator.next();
- if (uiComponent != null) {
+ if (uiComponent != null)
+ {
_writeComponent(faces, writer, uiComponent, null, /* writeChildren */false);
- //writer.write("<br/>");
- //writer.write(RendererUtils.getPathToComponent(uiComponent));
- //writer.write("<br/>");
}
}
printed = true;
@@ -385,7 +383,7 @@ public final class ErrorPageWriter
}
else
{
- writer.write(ERROR_PARTS[i]);
+ writer.write(errorParts[i]);
}
}
}
@@ -401,35 +399,35 @@ public final class ErrorPageWriter
{
_init(faces);
Date now = new Date();
- for (int i = 0; i < DEBUG_PARTS.length; i++)
+ for (int i = 0; i < debugParts.length; i++)
{
- if ("message".equals(DEBUG_PARTS[i]))
+ if ("message".equals(debugParts[i]))
{
writer.write(faces.getViewRoot().getViewId());
}
- else if ("now".equals(DEBUG_PARTS[i]))
+ else if ("now".equals(debugParts[i]))
{
writer.write(DateFormat.getDateTimeInstance().format(now));
}
- else if ("tree".equals(DEBUG_PARTS[i]))
+ else if ("tree".equals(debugParts[i]))
{
_writeComponent(faces, writer, faces.getViewRoot(), null, true);
}
- else if ("extendedtree".equals(DEBUG_PARTS[i]))
+ else if ("extendedtree".equals(debugParts[i]))
{
_writeExtendedComponentTree(writer, faces);
}
- else if ("vars".equals(DEBUG_PARTS[i]))
+ else if ("vars".equals(debugParts[i]))
{
_writeVariables(writer, faces, faces.getViewRoot());
}
else
{
- writer.write(DEBUG_PARTS[i]);
+ writer.write(debugParts[i]);
}
}
}
-
+
public static void handle(FacesContext facesContext, Collection<UIComponent> components,
Throwable... exs) throws FacesException
{
@@ -437,7 +435,7 @@ public final class ErrorPageWriter
{
_prepareExceptionStack(ex);
}
-
+
if (!facesContext.getExternalContext().isResponseCommitted())
{
facesContext.getExternalContext().responseReset();
@@ -460,7 +458,7 @@ public final class ErrorPageWriter
{
facesContext.getExternalContext().setResponseStatus(responseStatus);
}
-
+
// normal request --> html error page
facesContext.getExternalContext().setResponseContentType("text/html");
facesContext.getExternalContext().setResponseCharacterEncoding("UTF-8");
@@ -496,16 +494,16 @@ public final class ErrorPageWriter
public static void handleThrowable(FacesContext facesContext, Throwable ex) throws FacesException
{
_prepareExceptionStack(ex);
-
+
boolean errorPageWritten = false;
-
+
// check if an error page is present in web.xml
// if so, do not generate an error page
//WebXml webXml = WebXml.getWebXml(facesContext.getExternalContext());
//if (webXml.isErrorPagePresent())
WebConfigProvider webConfigProvider = WebConfigProviderFactory.getWebConfigProviderFactory(
facesContext.getExternalContext()).getWebConfigProvider(facesContext.getExternalContext());
-
+
if(webConfigProvider.isErrorPagePresent(facesContext.getExternalContext()))
{
// save current view in the request map to access it on the error page
@@ -528,7 +526,7 @@ public final class ErrorPageWriter
{
httpResp.reset();
if (facesContext.getPartialViewContext().isAjaxRequest())
- {
+ {
// ajax request --> xml error page
httpResp.setContentType("text/xml; charset=UTF-8");
try
@@ -556,7 +554,7 @@ public final class ErrorPageWriter
}
}
else
- {
+ {
// normal request --> html error page
httpResp.setContentType("text/html; charset=UTF-8");
try
@@ -570,16 +568,16 @@ public final class ErrorPageWriter
}
}
log.log(Level.SEVERE, "An exception occurred", ex);
-
+
// mark the response as complete
facesContext.responseComplete();
-
+
errorPageWritten = true;
}
}
}
}
-
+
// rethrow the throwable, if we did not write the error page
if (!errorPageWritten)
{
@@ -618,20 +616,20 @@ public final class ErrorPageWriter
private static void _init(FacesContext context) throws IOException
{
- if (ERROR_PARTS == null)
+ if (errorParts == null)
{
- ERROR_PARTS = _splitTemplate(_getErrorTemplate(context));
+ errorParts = _splitTemplate(_getErrorTemplate(context));
}
- if (DEBUG_PARTS == null)
+ if (debugParts == null)
{
- DEBUG_PARTS = _splitTemplate(_getDebugTemplate(context));
+ debugParts = _splitTemplate(_getDebugTemplate(context));
}
}
private static String[] _splitTemplate(String rsc) throws IOException
{
- InputStream is = ClassUtils.getContextClassLoader().getResourceAsStream(rsc);
+ InputStream is = ClassUtils.getContextClassLoader().getResourceAsStream(rsc);
if (is == null)
{
// try to get the resource from ExternalContext
@@ -641,7 +639,7 @@ public final class ErrorPageWriter
// fallback
is = ErrorPageWriter.class.getClassLoader().getResourceAsStream(rsc);
}
- }
+ }
if (is == null)
{
@@ -661,27 +659,27 @@ public final class ErrorPageWriter
String str = baos.toString();
return str.split("@@");
}
-
+
private static List<String> _getErrorId(Collection<UIComponent> components, Throwable... exs)
{
List<String> list = null;
for (Throwable e : exs)
{
String message = e.getMessage();
-
+
if (message == null)
{
continue;
}
-
+
Pattern pattern = Pattern.compile(REGEX_PATTERN);
Matcher matcher = pattern.matcher(message);
-
+
while (matcher.find())
{
if (list == null)
{
- list = new ArrayList<String>();
+ list = new ArrayList<String>();
}
list.add(matcher.group(1));
}
@@ -693,7 +691,8 @@ public final class ErrorPageWriter
else if (components != null)
{
list = new ArrayList<String>();
- for (UIComponent uiComponent : components) {
+ for (UIComponent uiComponent : components)
+ {
if (uiComponent != null)
{
list.add(uiComponent.getId());
@@ -712,7 +711,7 @@ public final class ErrorPageWriter
pstr.close();
writer.write(str.toString().replaceAll("<", TS));
}
-
+
private static void _writeCause(Writer writer, Throwable ex) throws IOException
{
String msg = ex.getMessage();
@@ -720,8 +719,8 @@ public final class ErrorPageWriter
if (ex instanceof ContextAware)
{
ContextAware caex = (ContextAware) ex;
- contextAwareLocation = caex.getLocation().toString() + " " +
- caex.getQName() + "=\"" +
+ contextAwareLocation = caex.getLocation().toString() + " " +
+ caex.getQName() + "=\"" +
caex.getExpressionString() + "\"";
}
while (ex.getCause() != null)
@@ -730,8 +729,8 @@ public final class ErrorPageWriter
if (ex instanceof ContextAware)
{
ContextAware caex = (ContextAware) ex;
- contextAwareLocation = caex.getLocation().toString() + " " +
- caex.getQName() + "=\"" +
+ contextAwareLocation = caex.getLocation().toString() + " " +
+ caex.getQName() + "=\"" +
caex.getExpressionString() + "\"";
}
if (ex.getMessage() != null)
@@ -751,7 +750,7 @@ public final class ErrorPageWriter
}
StackTraceElement stackTraceElement = ex.getStackTrace()[0];
writer.write("<br/> at " + stackTraceElement.toString());
-
+
if (contextAwareLocation != null)
{
writer.write("<br/> <br/>");
@@ -777,12 +776,13 @@ public final class ErrorPageWriter
_writeVariables(writer, ctx.getApplicationMap(), "Application Attributes");
}
- private static void _writeVariables(Writer writer, Map<String, ? extends Object> vars, String caption) throws IOException
+ private static void _writeVariables(Writer writer, Map<String, ? extends Object> vars, String caption)
+ throws IOException
{
writer.write("<table><caption>");
writer.write(caption);
- writer
- .write("</caption><thead><tr><th style=\"width: 10%; \">Name</th><th style=\"width: 90%; \">Value</th></tr></thead><tbody>");
+ writer.write("</caption><thead><tr><th style=\"width: 10%; \">Name</th>"
+ + "<th style=\"width: 90%; \">Value</th></tr></thead><tbody>");
boolean written = false;
if (!vars.isEmpty())
{
@@ -796,10 +796,14 @@ public final class ErrorPageWriter
writer.write(key.replaceAll("<", TS));
writer.write("</td><td>");
Object value = entry.getValue();
- // in some (very rare) situations value can be null or not null but with null toString() representation
- if (value != null && value.toString() != null) {
+ // in some (very rare) situations value can be null or not null
+ // but with null toString() representation
+ if (value != null && value.toString() != null)
+ {
writer.write(value.toString().replaceAll("<", TS));
- } else {
+ }
+ else
+ {
writer.write("null");
}
writer.write("</td></tr>");
@@ -814,7 +818,8 @@ public final class ErrorPageWriter
writer.write("</tbody></table>");
}
- private static void _writeComponent(FacesContext faces, Writer writer, UIComponent c, List<String> highlightId, boolean writeChildren) throws IOException
+ private static void _writeComponent(FacesContext faces, Writer writer, UIComponent c, List<String> highlightId,
+ boolean writeChildren) throws IOException
{
writer.write("<dl><dt");
if (_isText(c))
@@ -888,55 +893,55 @@ public final class ErrorPageWriter
}
writer.write("</dl>");
}
-
+
/**
* Creates the Extended Component Tree via UIViewRoot.visitTree()
* and ExtendedComponentTreeVisitCallback as VisitCallback.
- *
+ *
* @param writer
* @param facesContext
* @throws IOException
*/
- private static void _writeExtendedComponentTree(Writer writer,
+ private static void _writeExtendedComponentTree(Writer writer,
FacesContext facesContext) throws IOException
{
VisitContext visitContext = VisitContext.createVisitContext(
facesContext, null, EnumSet.of(VisitHint.SKIP_UNRENDERED));
facesContext.getViewRoot().visitTree(visitContext, new ExtendedComponentTreeVisitCallback(writer));
}
-
+
/**
* The VisitCallback that is used to create the Extended Component Tree.
- *
+ *
* @author Jakob Korherr
*/
private static class ExtendedComponentTreeVisitCallback implements VisitCallback
{
private Writer _writer;
-
+
public ExtendedComponentTreeVisitCallback(Writer writer)
{
_writer = writer;
}
-
+
@SuppressWarnings("unchecked")
public VisitResult visit(VisitContext context, UIComponent target)
{
final Map<String, Object> requestMap = context.getFacesContext()
.getExternalContext().getRequestMap();
-
+
try
{
if (!(target instanceof UIViewRoot))
{
_writer.write("<dd>");
}
-
+
UIComponent parent = target.getParent();
boolean hasChildren = (target.getChildCount() > 0 || target.getFacets().size() > 0);
String facetName = _getFacetName(target);
-
+
if (!(target instanceof UIColumn))
{
if (parent instanceof UIColumn
@@ -960,10 +965,10 @@ public final class ErrorPageWriter
_writeStart(_writer, parent, true, false);
_writer.write("</dt><dd>");
}
-
+
if (facetName != null)
{
- _writer.write("<span>" + facetName + "</span>");
+ _writer.write("<span>" + facetName + "</span>");
_incrementVisitedFacetCount(parent);
}
_writer.write("<dl><dt");
@@ -972,7 +977,7 @@ public final class ErrorPageWriter
_writer.write(" class=\"uicText\"");
}
_writer.write(">");
-
+
Map<String, List<Object[]>> debugInfos = null;
// is the target a EditableValueHolder component?
// If so, debug infos from DebugPhaseListener should be available
@@ -982,7 +987,7 @@ public final class ErrorPageWriter
debugInfos = (Map<String, List<Object[]>>) requestMap
.get(DEBUG_INFO_KEY + target.getClientId());
}
-
+
// Get the component's renderer.
// Note that getRenderer(FacesContext context) is definded in UIComponent,
// but it is protected, so we have to use reflection!
@@ -999,18 +1004,18 @@ public final class ErrorPageWriter
{
// nothing - do not output renderer information
}
-
+
// write the component start
_writeStart(_writer, target, (hasChildren || debugInfos != null || renderer != null), false);
_writer.write("</dt>");
-
+
if (renderer != null)
{
// write renderer info
_writer.write("<div class=\"renderer\">Rendered by ");
_writer.write(renderer.getClass().getCanonicalName());
_writer.write("</div>");
-
+
if (!hasChildren && debugInfos == null)
{
// close the component
@@ -1019,7 +1024,7 @@ public final class ErrorPageWriter
_writer.write("</dt>");
}
}
-
+
if (debugInfos != null)
{
final String fieldid = target.getClientId() + "_lifecycle";
@@ -1034,7 +1039,7 @@ public final class ErrorPageWriter
_writer.write("<div id=\"");
_writer.write(fieldid);
_writer.write("\" class=\"lifecycle_values\">");
-
+
// process any available debug info
for (Map.Entry<String, List<Object[]>> entry : debugInfos.entrySet())
{
@@ -1049,7 +1054,7 @@ public final class ErrorPageWriter
// - 1: old value
// - 2: new value
// - 3: StackTraceElement List
-
+
// oldValue and newValue could be null
String oldValue = debugInfo[1] == null ? "null" : debugInfo[1].toString();
String newValue = debugInfo[2] == null ? "null" : debugInfo[2].toString();
@@ -1061,7 +1066,7 @@ public final class ErrorPageWriter
_writer.write(newValue);
_writer.write("</b> in Phase ");
_writer.write(debugInfo[0].toString());
-
+
// check if a call stack is available
if (debugInfo[3] != null)
{
@@ -1078,7 +1083,7 @@ public final class ErrorPageWriter
_writer.write(stackTraceId);
_writer.write("\" class=\"stacktrace_values\">");
_writer.write("<ul>");
- for (StackTraceElement stackTraceElement
+ for (StackTraceElement stackTraceElement
: (List<StackTraceElement>) debugInfo[3])
{
_writer.write("<li>");
@@ -1087,20 +1092,20 @@ public final class ErrorPageWriter
}
_writer.write("</ul></div></div>");
}
-
+
_writer.write("</li>");
-
+
i++;
}
_writer.write("</ol>");
}
-
+
_writer.write("</div></div>");
-
+
// now remove the debug info from the request map,
// so that it does not appear in the scope values of the debug page
requestMap.remove(DEBUG_INFO_KEY + target.getClientId());
-
+
if (!hasChildren)
{
// close the component
@@ -1110,21 +1115,21 @@ public final class ErrorPageWriter
}
}
}
-
+
if (!hasChildren)
{
_writer.write("</dl>");
-
- while (parent != null
- && ((parent.getChildCount()>0 && parent.getChildren().get(parent.getChildCount() - 1) == target)
- || (parent.getFacetCount() != 0
+
+ while (parent != null &&
+ ((parent.getChildCount()>0 && parent.getChildren().get(parent.getChildCount()-1) == target)
+ || (parent.getFacetCount() != 0
&& _getVisitedFacetCount(parent) == parent.getFacetCount())))
{
// target is last child of parent or the "last" facet
-
+
// remove the visited facet count from the attribute map
_removeVisitedFacetCount(parent);
-
+
// check for componentes that visit their children multiple times
if (parent instanceof UIData)
{
@@ -1144,18 +1149,18 @@ public final class ErrorPageWriter
break;
}
}
-
+
_writer.write("</dd><dt>");
_writeEnd(_writer, parent);
_writer.write("</dt></dl>");
-
+
if (!(parent instanceof UIViewRoot))
{
_writer.write("</dd>");
}
-
+
target = parent;
- parent = target.getParent();
+ parent = target.getParent();
}
}
}
@@ -1163,12 +1168,12 @@ public final class ErrorPageWriter
{
throw new FacesException(ioe);
}
-
+
return VisitResult.ACCEPT;
}
-
+
}
-
+
private static boolean _isFirstUIColumn(UIComponent uidata, UIColumn uicolumn)
{
for (int i = 0, childCount = uidata.getChildCount(); i < childCount; i++)
@@ -1181,7 +1186,7 @@ public final class ErrorPageWriter
}
return false;
}
-
+
private static String _getFacetName(UIComponent component)
{
UIComponent parent = component.getParent();
@@ -1200,7 +1205,7 @@ public final class ErrorPageWriter
}
return null;
}
-
+
private static int _getVisitedFacetCount(UIComponent component)
{
Integer count = visitedFacetCount.get(component);
@@ -1210,12 +1215,12 @@ public final class ErrorPageWriter
}
return 0;
}
-
+
private static void _incrementVisitedFacetCount(UIComponent component)
{
visitedFacetCount.put(component, _getVisitedFacetCount(component) + 1);
}
-
+
private static void _removeVisitedFacetCount(UIComponent component)
{
visitedFacetCount.remove(component);
@@ -1244,7 +1249,8 @@ public final class ErrorPageWriter
String str = null;
for (int i = 0; i < pd.length; i++)
{
- if ((pd[i].getWriteMethod() != null || Arrays.binarySearch(ALWAYS_WRITE, pd[i].getName()) > -1) && Arrays.binarySearch(IGNORE, pd[i].getName()) < 0)
+ if ((pd[i].getWriteMethod() != null || Arrays.binarySearch(ALWAYS_WRITE, pd[i].getName()) > -1)
+ && Arrays.binarySearch(IGNORE, pd[i].getName()) < 0)
{
m = pd[i].getReadMethod();
try
@@ -1280,7 +1286,7 @@ public final class ErrorPageWriter
{
str = v.toString();
}
-
+
_writeAttribute(writer, pd[i].getName(), str);
}
}
@@ -1297,7 +1303,7 @@ public final class ErrorPageWriter
{
_writeAttribute(writer, "binding", binding.getExpressionString());
}
-
+
// write the location
String location = _getComponentLocation(c);
if (location != null)
@@ -1310,7 +1316,7 @@ public final class ErrorPageWriter
// do nothing
}
}
-
+
private static void _writeAttribute(Writer writer, String name, String value) throws IOException
{
writer.write(" ");
@@ -1320,7 +1326,7 @@ public final class ErrorPageWriter
writer.write("\"");
}
- private static void _writeStart(Writer writer, UIComponent c,
+ private static void _writeStart(Writer writer, UIComponent c,
boolean children, boolean valueExpressionValues) throws IOException
{
if (_isText(c))
@@ -1404,7 +1410,7 @@ public final class ErrorPageWriter
return false;
}
}
-
+
/**
* Gets the Location of the given UIComponent from its attribute map.
* @param component
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java Wed Oct 26 14:41:42 2011
@@ -229,7 +229,7 @@ class ServerSideStateCacheImpl extends S
{
if (isUseFlashScopePurgeViewsInSession(context.getExternalContext()) &&
Boolean.TRUE.equals(context.getExternalContext().getRequestMap()
- .get("oam.Flash.REDIRECT.PREVIOUSREQUEST")))
+ .get("oam.Flash.REDIRECT.PREVIOUSREQUEST")))
{
key = (SerializedViewKey)
context.getExternalContext().getFlash().get(RESTORED_VIEW_KEY_REQUEST_ATTR);
@@ -418,7 +418,7 @@ class ServerSideStateCacheImpl extends S
/**
* Reads the value of the <code>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</code> context parameter.
- * @see SERIALIZE_STATE_IN_SESSION_PARAM
+ * @see #SERIALIZE_STATE_IN_SESSION_PARAM
* @param context <code>FacesContext</code> for the request we are processing.
* @return boolean true, if the server state should be serialized in the session
*/
@@ -436,7 +436,7 @@ class ServerSideStateCacheImpl extends S
/**
* Reads the value of the <code>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</code> context parameter.
- * @see COMPRESS_SERVER_STATE_PARAM
+ * @see #COMPRESS_SERVER_STATE_PARAM
* @param context <code>FacesContext</code> for the request we are processing.
* @return boolean true, if the server state steam should be compressed
*/
@@ -595,7 +595,7 @@ class ServerSideStateCacheImpl extends S
while (_keys.remove(key))
{
- ;
+ // do nothing
}
_keys.add(key);
@@ -619,7 +619,7 @@ class ServerSideStateCacheImpl extends S
{
while (_keys.remove(keyToRemove))
{
- ;
+ // do nothing
}
Object oldView = _serializedViews.remove(keyToRemove);
@@ -668,7 +668,7 @@ class ServerSideStateCacheImpl extends S
/**
* Reads the amount (default = 20) of views to be stored in session.
- * @see NUMBER_OF_VIEWS_IN_SESSION_PARAM
+ * @see #NUMBER_OF_VIEWS_IN_SESSION_PARAM
* @param context FacesContext for the current request, we are processing
* @return Number vf views stored in the session
*/
@@ -737,7 +737,7 @@ class ServerSideStateCacheImpl extends S
* @since 1.2.5
* @param context
* @return constant indicating caching mode
- * @see CACHE_OLD_VIEWS_IN_SESSION_MODE
+ * @see #CACHE_OLD_VIEWS_IN_SESSION_MODE
*/
protected String getCacheOldViewsInSessionMode(FacesContext context)
{
@@ -808,10 +808,10 @@ class ServerSideStateCacheImpl extends S
@Override
public int hashCode()
{
- final int PRIME = 31;
+ final int prime = 31;
int result = 1;
- result = PRIME * result + ((_sequenceId == null) ? 0 : _sequenceId.hashCode());
- result = PRIME * result + ((_viewId == null) ? 0 : _viewId.hashCode());
+ result = prime * result + ((_sequenceId == null) ? 0 : _sequenceId.hashCode());
+ result = prime * result + ((_viewId == null) ? 0 : _viewId.hashCode());
return result;
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java Wed Oct 26 14:41:42 2011
@@ -70,10 +70,12 @@ public class HtmlAjaxBehaviorRenderer ex
private static final String IDENTIFYER_MARKER = "@";
public void decode(FacesContext context, UIComponent component,
- ClientBehavior behavior) {
+ ClientBehavior behavior)
+ {
assertBehavior(behavior);
AjaxBehavior ajaxBehavior = (AjaxBehavior) behavior;
- if (ajaxBehavior.isDisabled() || !component.isRendered()) {
+ if (ajaxBehavior.isDisabled() || !component.isRendered())
+ {
return;
}
@@ -82,24 +84,27 @@ public class HtmlAjaxBehaviorRenderer ex
public String getScript(ClientBehaviorContext behaviorContext,
- ClientBehavior behavior) {
+ ClientBehavior behavior)
+ {
assertBehavior(behavior);
AjaxBehavior ajaxBehavior = (AjaxBehavior) behavior;
-
- if (ajaxBehavior.isDisabled()) {
+
+ if (ajaxBehavior.isDisabled())
+ {
return null;
}
-
+
return makeAjax(behaviorContext, ajaxBehavior).toString();
}
- private final void dispatchBehaviorEvent(UIComponent component, AjaxBehavior ajaxBehavior) {
+ private final void dispatchBehaviorEvent(UIComponent component, AjaxBehavior ajaxBehavior)
+ {
AjaxBehaviorEvent event = new AjaxBehaviorEvent(component, ajaxBehavior);
PhaseId phaseId = ajaxBehavior.isImmediate() || isComponentImmediate(component) ?
- PhaseId.APPLY_REQUEST_VALUES :
- PhaseId.INVOKE_APPLICATION;
+ PhaseId.APPLY_REQUEST_VALUES :
+ PhaseId.INVOKE_APPLICATION;
event.setPhaseId(phaseId);
@@ -107,31 +112,40 @@ public class HtmlAjaxBehaviorRenderer ex
}
- private final boolean isComponentImmediate(UIComponent component) {
+ private final boolean isComponentImmediate(UIComponent component)
+ {
/**
* Currently implemented by ActionSource and EditableValueHolder
* but we cannot be sure about both interfaces so
* lets make introspection calls here
*/
Method immediate = null;
- try {
+ try
+ {
immediate = component.getClass().getMethod("isImmediate", new Class[]{});
//public isImmediate must be present
if (Modifier.isPublic(immediate.getModifiers()) ||
- immediate.getReturnType().equals(boolean.class) ||
- immediate.getReturnType().equals(Boolean.class)) /*autoboxing*/ {
+ immediate.getReturnType().equals(boolean.class) ||
+ immediate.getReturnType().equals(Boolean.class)) /*autoboxing*/
+ {
return (Boolean) immediate.invoke(component, new Object[]{});
}
return false;
- } catch (NoSuchMethodException e) {
+ }
+ catch (NoSuchMethodException e)
+ {
//not implemented at all we can return, this is
//not really a programmatic exception but we do not have an
//hasMethod, and iterating over all methods is way slower
return false;
- } catch (InvocationTargetException e) {
+ }
+ catch (InvocationTargetException e)
+ {
throw new FacesException(e);
- } catch (IllegalAccessException e) {
+ }
+ catch (IllegalAccessException e)
+ {
throw new FacesException(e);
}
}
@@ -145,7 +159,8 @@ public class HtmlAjaxBehaviorRenderer ex
* @param behavior the behavior
* @return a fully working javascript with calls into jsf.js
*/
- private final StringBuilder makeAjax(ClientBehaviorContext context, AjaxBehavior behavior) {
+ private final StringBuilder makeAjax(ClientBehaviorContext context, AjaxBehavior behavior)
+ {
StringBuilder retVal = new StringBuilder();
@@ -157,7 +172,7 @@ public class HtmlAjaxBehaviorRenderer ex
String onEvent = behavior.getOnevent();
onEvent = (onEvent != null && !onEvent.trim().equals(EMPTY)) ? AJAX_KEY_ONEVENT + COLON + onEvent : null;
- String sourceId = (context.getSourceId() == null) ? AJAX_VAL_THIS : '\''+context.getSourceId()+'\'';
+ String sourceId = (context.getSourceId() == null) ? AJAX_VAL_THIS : '\'' + context.getSourceId() + '\'';
String event = context.getEventName();
retVal.append(JS_AJAX_REQUEST);
@@ -171,24 +186,30 @@ public class HtmlAjaxBehaviorRenderer ex
int paramSize = (params != null) ? params.size() : 0;
List<String> parameterList = new ArrayList<String>(paramSize + 2);
- if (executes != null) {
+ if (executes != null)
+ {
parameterList.add(executes.toString());
}
- if (render != null) {
+ if (render != null)
+ {
parameterList.add(render.toString());
}
- if (onError != null) {
- parameterList.add (onError);
+ if (onError != null)
+ {
+ parameterList.add(onError);
+ }
+ if (onEvent != null)
+ {
+ parameterList.add(onEvent);
}
- if (onEvent != null) {
- parameterList.add (onEvent);
- }
- if (paramSize > 0) {
+ if (paramSize > 0)
+ {
/**
* see ClientBehaviorContext.html of the spec
* the param list has to be added in the post back
*/
- for (ClientBehaviorContext.Parameter param : params) {
+ for (ClientBehaviorContext.Parameter param : params)
+ {
//TODO we may need a proper type handling in this part
//lets leave it for now as it is
//quotes etc.. should be transferred directly
@@ -221,18 +242,24 @@ public class HtmlAjaxBehaviorRenderer ex
}
- private StringBuilder buildOptions(List<String> options) {
+ private StringBuilder buildOptions(List<String> options)
+ {
StringBuilder retVal = new StringBuilder();
retVal.append("{");
boolean first = true;
-
- for (int i = 0, size = options.size(); i < size; i++) {
+
+ for (int i = 0, size = options.size(); i < size; i++)
+ {
String option = options.get(i);
- if (option != null && !option.trim().equals(EMPTY)) {
- if (!first) {
+ if (option != null && !option.trim().equals(EMPTY))
+ {
+ if (!first)
+ {
retVal.append(COMMA);
- } else {
+ }
+ else
+ {
first = false;
}
retVal.append(option);
@@ -242,30 +269,39 @@ public class HtmlAjaxBehaviorRenderer ex
return retVal;
}
- private final StringBuilder mapToString(ClientBehaviorContext context, String target, Collection<String> dataHolder) {
+ private final StringBuilder mapToString(ClientBehaviorContext context, String target, Collection<String> dataHolder)
+ {
StringBuilder retVal = new StringBuilder(20);
- if (dataHolder == null) {
+ if (dataHolder == null)
+ {
dataHolder = Collections.emptyList();
}
int executeSize = dataHolder.size();
- if (executeSize > 0) {
+ if (executeSize > 0)
+ {
retVal.append(target);
retVal.append(COLON);
retVal.append(QUOTE);
int cnt = 0;
- for (String strVal : dataHolder) {
+ for (String strVal : dataHolder)
+ {
cnt++;
strVal = strVal.trim();
- if (!strVal.equals("")) {
- if (!strVal.startsWith(IDENTIFYER_MARKER)) {
+ if (!strVal.equals(""))
+ {
+ if (!strVal.startsWith(IDENTIFYER_MARKER))
+ {
retVal.append(getComponentId(context, strVal));
- } else {
+ }
+ else
+ {
retVal.append(strVal);
}
- if (cnt < dataHolder.size()) {
+ if (cnt < dataHolder.size())
+ {
retVal.append(BLANK);
}
}
@@ -279,21 +315,26 @@ public class HtmlAjaxBehaviorRenderer ex
}
- private final String getComponentId(ClientBehaviorContext context, String id) {
+ private final String getComponentId(ClientBehaviorContext context, String id)
+ {
UIComponent contextComponent = context.getComponent();
UIComponent target = contextComponent.findComponent(id);
- if (target == null) {
+ if (target == null)
+ {
target = contextComponent.findComponent(UINamingContainer.getSeparatorChar(context.getFacesContext()) + id);
}
- if (target != null) {
+ if (target != null)
+ {
return target.getClientId();
}
throw new FacesException("Component with id:" + id + " not found");
}
- private final void assertBehavior(ClientBehavior behavior) {
- if (!(behavior instanceof AjaxBehavior)) {
+ private final void assertBehavior(ClientBehavior behavior)
+ {
+ if (!(behavior instanceof AjaxBehavior))
+ {
throw new FacesException(ERR_NO_AJAX_BEHAVIOR);
}
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlDoctypeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlDoctypeRenderer.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlDoctypeRenderer.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlDoctypeRenderer.java Wed Oct 26 14:41:42 2011
@@ -54,7 +54,8 @@ public class HtmlDoctypeRenderer extends
ResponseWriter writer = context.getResponseWriter();
Map<String, Object> attributes = component.getAttributes();
- //<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ //<!DOCTYPE html PUBLIC
+ // "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
writer.write("<!DOCTYPE ");
writer.write((String) attributes.get("rootElement"));
String publicValue = (String) attributes.get("public");
@@ -73,4 +74,4 @@ public class HtmlDoctypeRenderer extends
}
writer.write(">");
}
-}
\ No newline at end of file
+}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormRenderer.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormRenderer.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormRenderer.java Wed Oct 26 14:41:42 2011
@@ -49,15 +49,17 @@ public class HtmlFormRenderer
//private static final Log log = LogFactory.getLog(HtmlFormRenderer.class);
@Override
- protected void afterFormElementsEnd(FacesContext facesContext,
- UIComponent component) throws IOException {
+ protected void afterFormElementsEnd(FacesContext facesContext, UIComponent component) throws IOException
+ {
super.afterFormElementsEnd(facesContext, component);
ResponseWriter writer = facesContext.getResponseWriter();
ExternalContext extContext = facesContext.getExternalContext();
// If javascript viewstate is enabled write empty hidden input in forms
- if (JavascriptUtils.isJavascriptAllowed(extContext) && MyfacesConfig.getCurrentInstance(extContext).isViewStateJavascript()) {
+ if (JavascriptUtils.isJavascriptAllowed(extContext)
+ && MyfacesConfig.getCurrentInstance(extContext).isViewStateJavascript())
+ {
writer.startElement(HTML.INPUT_ELEM, null);
writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_HIDDEN, null);
writer.writeAttribute(HTML.NAME_ATTR, HtmlResponseStateManager.VIEW_STATE_PARAM, null);
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormatRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormatRenderer.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormatRenderer.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormatRenderer.java Wed Oct 26 14:41:42 2011
@@ -194,7 +194,8 @@ public class HtmlFormatRenderer extends
}
catch (Exception e)
{
- log.log(Level.SEVERE, "Error formatting message of component " + htmlOutputFormat.getClientId(facesContext));
+ log.log(Level.SEVERE, "Error formatting message of component "
+ + htmlOutputFormat.getClientId(facesContext));
return "";
}
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java Wed Oct 26 14:41:42 2011
@@ -91,7 +91,8 @@ public class HtmlLabelRenderer extends H
encodeBefore(facesContext, writer, uiComponent);
writer.startElement(HTML.LABEL_ELEM, uiComponent);
- if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (uiComponent instanceof ClientBehaviorHolder
+ && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
{
if (!behaviors.isEmpty())
{
@@ -102,7 +103,8 @@ public class HtmlLabelRenderer extends H
HtmlRendererUtils.writeIdIfNecessary(writer, uiComponent, facesContext);
}
HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, uiComponent, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, uiComponent, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer,
+ uiComponent, behaviors);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
CommonPropertyUtils.renderLabelPassthroughPropertiesWithoutEvents(writer,
@@ -110,7 +112,8 @@ public class HtmlLabelRenderer extends H
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.LABEL_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+ HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
+ HTML.LABEL_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
}
}
else
@@ -156,7 +159,8 @@ public class HtmlLabelRenderer extends H
}
else
{
- escape = RendererUtils.getBooleanAttribute(uiComponent, org.apache.myfaces.shared.renderkit.JSFAttr.ESCAPE_ATTR,
+ escape = RendererUtils.getBooleanAttribute(uiComponent,
+ org.apache.myfaces.shared.renderkit.JSFAttr.ESCAPE_ATTR,
true); //default is to escape
}
if (escape)
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java Wed Oct 26 14:41:42 2011
@@ -79,7 +79,8 @@ public class HtmlResponseStateManager ex
{
if (_handleStateCachingMechanics == null)
{
- _handleStateCachingMechanics = WebConfigParamUtils.getBooleanInitParameter(facesContext.getExternalContext(), INIT_PARAM_HANDLE_STATE_CACHING_MECHANICS, true);
+ _handleStateCachingMechanics = WebConfigParamUtils.getBooleanInitParameter(facesContext.getExternalContext(),
+ INIT_PARAM_HANDLE_STATE_CACHING_MECHANICS, true);
}
return _handleStateCachingMechanics.booleanValue();
}
@@ -242,11 +243,12 @@ public class HtmlResponseStateManager ex
*
* @return the reconstructed state, or <code>null</code> if there was no saved state
*/
- private Object[] getSavedState(FacesContext facesContext) {
+ private Object[] getSavedState(FacesContext facesContext)
+ {
Object encodedState =
- facesContext.getExternalContext().
- getRequestParameterMap().get(STANDARD_STATE_SAVING_PARAM);
- if(encodedState==null || (((String) encodedState).length() == 0)) {
+ facesContext.getExternalContext().getRequestParameterMap().get(STANDARD_STATE_SAVING_PARAM);
+ if(encodedState==null || (((String) encodedState).length() == 0))
+ {
return null;
}
@@ -255,7 +257,8 @@ public class HtmlResponseStateManager ex
if (savedState == null)
{
- if (log.isLoggable(Level.FINEST)) {
+ if (log.isLoggable(Level.FINEST))
+ {
log.finest("No saved state");
}
return null;
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java Wed Oct 26 14:41:42 2011
@@ -57,23 +57,27 @@ import org.apache.myfaces.view.facelets.
*/
@JSFRenderer(renderKitId = "HTML_BASIC", family = "javax.faces.Output", type = "javax.faces.resource.Script")
@ListenerFor(systemEventClass = PostAddToViewEvent.class)
-public class HtmlScriptRenderer extends Renderer implements ComponentSystemEventListener {
+public class HtmlScriptRenderer extends Renderer implements ComponentSystemEventListener
+{
//private static final Log log = LogFactory.getLog(HtmlScriptRenderer.class);
private static final Logger log = Logger.getLogger(HtmlScriptRenderer.class.getName());
private static final String IS_BUILDING_INITIAL_STATE = "javax.faces.IS_BUILDING_INITIAL_STATE";
- public void processEvent(ComponentSystemEvent event) {
- if (event instanceof PostAddToViewEvent) {
+ public void processEvent(ComponentSystemEvent event)
+ {
+ if (event instanceof PostAddToViewEvent)
+ {
UIComponent component = event.getComponent();
String target = (String) component.getAttributes().get(JSFAttr.TARGET_ATTR);
- if (target != null) {
+ if (target != null)
+ {
FacesContext facesContext = FacesContext.getCurrentInstance();
Location location = (Location) component.getAttributes().get(CompositeComponentELUtils.LOCATION_KEY);
if (location != null)
{
- UIComponent ccParent = CompositeComponentELUtils.getCompositeComponentBasedOnLocation(facesContext, location);
+ UIComponent ccParent = CompositeComponentELUtils.getCompositeComponentBasedOnLocation(facesContext, location);
if (ccParent != null)
{
component.getAttributes().put(
@@ -86,7 +90,7 @@ public class HtmlScriptRenderer extends
// was propagated to relocate this resource, means the header must be refreshed.
// Note ajax request does not occur
if (!ExternalContextUtils.isPortlet(facesContext.getExternalContext()) &&
- facesContext.getPartialViewContext().isAjaxRequest() &&
+ facesContext.getPartialViewContext().isAjaxRequest() &&
!facesContext.getAttributes().containsKey(IS_BUILDING_INITIAL_STATE) &&
MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isStrictJsf2RefreshTargetAjax())
{
@@ -106,10 +110,12 @@ public class HtmlScriptRenderer extends
//TODO target check here
UIComponent component = event.getComponent();
String target = (String) component.getAttributes().get(JSFAttr.TARGET_ATTR);
- if (target != null) {
+ if (target != null)
+ {
FacesContext facesContext = FacesContext.getCurrentInstance();
UIComponent uiTarget = facesContext.getViewRoot().getFacet(target);
- if (uiTarget == null) {
+ if (uiTarget == null)
+ {
throw new FacesException("Target for component not found");
}
}
@@ -117,13 +123,15 @@ public class HtmlScriptRenderer extends
}
@Override
- public boolean getRendersChildren() {
+ public boolean getRendersChildren()
+ {
return true;
}
@Override
public void encodeChildren(FacesContext facesContext, UIComponent component)
- throws IOException {
+ throws IOException
+ {
if (facesContext == null)
{
throw new NullPointerException("context");
@@ -137,13 +145,18 @@ public class HtmlScriptRenderer extends
String resourceName = (String) componentAttributesMap.get(JSFAttr.NAME_ATTR);
boolean hasChildren = component.getChildCount() > 0;
- if (resourceName != null && (!"".equals(resourceName))) {
- if (hasChildren) {
+ if (resourceName != null && (!"".equals(resourceName)))
+ {
+ if (hasChildren)
+ {
log.info("Component with resourceName " + resourceName +
" and child components found. Child components will be ignored.");
}
- } else {
- if (hasChildren) {
+ }
+ else
+ {
+ if (hasChildren)
+ {
// Children are encoded as usual. Usually the layout is
// <script type="text/javascript">
// ...... some javascript .......
@@ -153,9 +166,12 @@ public class HtmlScriptRenderer extends
writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
RendererUtils.renderChildren(facesContext, component);
writer.endElement(HTML.SCRIPT_ELEM);
- } else {
+ }
+ else
+ {
if (!facesContext.getApplication().getProjectStage().equals(
- ProjectStage.Production)) {
+ ProjectStage.Production))
+ {
facesContext.addMessage(component.getClientId(),
new FacesMessage("Component with no name and no body content, so nothing rendered."));
}
@@ -165,25 +181,28 @@ public class HtmlScriptRenderer extends
@Override
public void encodeEnd(FacesContext facesContext, UIComponent component)
- throws IOException {
+ throws IOException
+ {
super.encodeEnd(facesContext, component); //check for NP
Map<String, Object> componentAttributesMap = component.getAttributes();
String resourceName = (String) componentAttributesMap.get(JSFAttr.NAME_ATTR);
String libraryName = (String) componentAttributesMap.get(JSFAttr.LIBRARY_ATTR);
- if (resourceName == null) {
+ if (resourceName == null)
+ {
//log.warn("Trying to encode resource represented by component" +
// component.getClientId() + " without resourceName."+
// " It will be silenty ignored.");
return;
}
- if ("".equals(resourceName)) {
+ if ("".equals(resourceName))
+ {
return;
}
-
+
String additionalQueryParams = null;
- int index = resourceName.indexOf('?');
+ int index = resourceName.indexOf('?');
if (index >= 0)
{
additionalQueryParams = resourceName.substring(index + 1);
@@ -191,15 +210,20 @@ public class HtmlScriptRenderer extends
}
Resource resource;
- if (libraryName == null) {
- if (ResourceUtils.isRenderedScript(facesContext, libraryName, resourceName)) {
+ if (libraryName == null)
+ {
+ if (ResourceUtils.isRenderedScript(facesContext, libraryName, resourceName))
+ {
//Resource already founded
return;
}
resource = facesContext.getApplication().getResourceHandler()
.createResource(resourceName);
- } else {
- if (ResourceUtils.isRenderedScript(facesContext, libraryName, resourceName)) {
+ }
+ else
+ {
+ if (ResourceUtils.isRenderedScript(facesContext, libraryName, resourceName))
+ {
//Resource already founded
return;
}
@@ -208,19 +232,23 @@ public class HtmlScriptRenderer extends
}
- if (resource == null) {
+ if (resource == null)
+ {
//no resource found
log.warning("Resource referenced by resourceName " + resourceName +
(libraryName == null ? "" : " and libraryName " + libraryName) +
" not found in call to ResourceHandler.createResource." +
" It will be silenty ignored.");
return;
- } else {
- if (ResourceUtils.isRenderedScript(facesContext, resource.getLibraryName(), resource.getResourceName())) {
+ }
+ else
+ {
+ if (ResourceUtils.isRenderedScript(facesContext, resource.getLibraryName(), resource.getResourceName()))
+ {
//Resource already founded
return;
}
-
+
// Rendering resource
ResourceUtils.markScriptAsRendered(facesContext, libraryName, resourceName);
ResourceUtils.markStylesheetAsRendered(facesContext, resource.getLibraryName(), resource.getResourceName());
@@ -232,7 +260,7 @@ public class HtmlScriptRenderer extends
String path = resource.getRequestPath();
if (additionalQueryParams != null)
{
- path = path + ( (path.indexOf('?') >= 0) ? "&" : "?" ) + additionalQueryParams;
+ path = path + ((path.indexOf('?') >= 0) ? "&" : "?") + additionalQueryParams;
}
writer.writeURIAttribute(HTML.SRC_ATTR, facesContext.getExternalContext().encodeResourceURL(path), null);
writer.endElement(HTML.SCRIPT_ELEM);
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java Wed Oct 26 14:41:42 2011
@@ -247,9 +247,11 @@ public class WebXml
protected boolean isOld(ExternalContext context)
{
- if (refreshPeriod > 0) {
+ if (refreshPeriod > 0)
+ {
long ttl = this.parsingTime + refreshPeriod;
- if (System.currentTimeMillis() > ttl) {
+ if (System.currentTimeMillis() > ttl)
+ {
long lastModified = WebXmlParser.getWebXmlLastModified(context);
return lastModified == 0 || lastModified > ttl;
}
@@ -287,7 +289,8 @@ public class WebXml
public static void update(ExternalContext context)
{
- if (getWebXml(context).isOld(context)){
+ if (getWebXml(context).isOld(context))
+ {
WebXml.init(context);
}
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXmlParser.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXmlParser.java?rev=1189247&r1=1189246&r2=1189247&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXmlParser.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXmlParser.java Wed Oct 26 14:41:42 2011
@@ -120,13 +120,16 @@ public class WebXmlParser
public static long getWebXmlLastModified(ExternalContext context)
{
- try {
+ try
+ {
URL url = context.getResource(WEB_XML_PATH);
if (url != null)
{
return url.openConnection().getLastModified();
}
- } catch (IOException e) {
+ }
+ catch (IOException e)
+ {
log.log(Level.SEVERE, "Could not find web.xml in path " + WEB_XML_PATH);
}
return 0L;