JBossWeb SVN: r1594 - in trunk/java/org/apache/coyote: ajp and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-11-30 09:48:56 -0500 (Tue, 30 Nov 2010)
New Revision: 1594
Modified:
trunk/java/org/apache/coyote/Constants.java
trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
trunk/java/org/apache/coyote/ajp/AjpProtocol.java
trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
trunk/java/org/apache/coyote/http11/Http11Protocol.java
Log:
- Add quick config for the wait time when pausing.
Modified: trunk/java/org/apache/coyote/Constants.java
===================================================================
--- trunk/java/org/apache/coyote/Constants.java 2010-11-30 14:46:02 UTC (rev 1593)
+++ trunk/java/org/apache/coyote/Constants.java 2010-11-30 14:48:56 UTC (rev 1594)
@@ -68,4 +68,7 @@
"org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER",
"false")).booleanValue();
+ public static final int MAX_PAUSE_WAIT =
+ Integer.valueOf(System.getProperty("org.apache.coyote.MAX_PAUSE_WAIT", "60")).intValue();
+
}
Modified: trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java 2010-11-30 14:46:02 UTC (rev 1593)
+++ trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java 2010-11-30 14:48:56 UTC (rev 1594)
@@ -214,7 +214,7 @@
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
Modified: trunk/java/org/apache/coyote/ajp/AjpProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpProtocol.java 2010-11-30 14:46:02 UTC (rev 1593)
+++ trunk/java/org/apache/coyote/ajp/AjpProtocol.java 2010-11-30 14:48:56 UTC (rev 1594)
@@ -214,7 +214,7 @@
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
Modified: trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2010-11-30 14:46:02 UTC (rev 1593)
+++ trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2010-11-30 14:48:56 UTC (rev 1594)
@@ -162,7 +162,7 @@
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
Modified: trunk/java/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Protocol.java 2010-11-30 14:46:02 UTC (rev 1593)
+++ trunk/java/org/apache/coyote/http11/Http11Protocol.java 2010-11-30 14:48:56 UTC (rev 1594)
@@ -230,7 +230,7 @@
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
14 years, 10 months
JBossWeb SVN: r1593 - trunk/java/org/apache/catalina/core.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-11-30 09:46:02 -0500 (Tue, 30 Nov 2010)
New Revision: 1593
Modified:
trunk/java/org/apache/catalina/core/StandardService.java
Log:
- Supposedly self seeding is good enough.
Modified: trunk/java/org/apache/catalina/core/StandardService.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardService.java 2010-11-25 17:00:03 UTC (rev 1592)
+++ trunk/java/org/apache/catalina/core/StandardService.java 2010-11-30 14:46:02 UTC (rev 1593)
@@ -309,8 +309,6 @@
}
if (apr) {
setEntropy(new String(Base64.encode(result)));
- } else {
- setEntropy(this.toString());
}
}
return (this.entropy);
@@ -763,7 +761,12 @@
}
// Construct and seed a new random number generator
- random = new SecureRandom(getEntropy().getBytes());
+ String entropy = getEntropy();
+ if (entropy != null) {
+ random = new SecureRandom(getEntropy().getBytes());
+ } else {
+ random = new SecureRandom();
+ }
}
public void destroy() throws LifecycleException {
14 years, 10 months
JBossWeb SVN: r1592 - trunk/java/org/apache/catalina/connector.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-11-25 12:00:03 -0500 (Thu, 25 Nov 2010)
New Revision: 1592
Modified:
trunk/java/org/apache/catalina/connector/Request.java
Log:
- Add an option to use the shared random.
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2010-11-25 11:24:57 UTC (rev 1591)
+++ trunk/java/org/apache/catalina/connector/Request.java 2010-11-25 17:00:03 UTC (rev 1592)
@@ -156,6 +156,10 @@
Boolean.valueOf(System.getProperty("org.apache.catalina.connector.Request.USE_PRINCIPAL_FROM_SESSION", "false")).booleanValue();
+ protected static final boolean LOCAL_RANDOM =
+ Boolean.valueOf(System.getProperty("org.apache.catalina.connector.Request.LOCAL_RANDOM", "true")).booleanValue();
+
+
// ----------------------------------------------------------- Constructors
@@ -630,9 +634,10 @@
*/
public void setConnector(Connector connector) {
this.connector = connector;
- SecureRandom seedRandom = connector.getService().getRandom();
- synchronized (seedRandom) {
- random = new SecureRandom(seedRandom.generateSeed(16));
+ if (LOCAL_RANDOM) {
+ random = new SecureRandom(connector.getService().getRandom().generateSeed(16));
+ } else {
+ random = connector.getService().getRandom();
}
}
14 years, 10 months
JBossWeb SVN: r1591 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-11-25 06:24:57 -0500 (Thu, 25 Nov 2010)
New Revision: 1591
Modified:
trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
trunk/webapps/docs/changelog.xml
Log:
- Allow a landing page for FORM.
Modified: trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
===================================================================
--- trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java 2010-11-25 11:20:52 UTC (rev 1590)
+++ trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java 2010-11-25 11:24:57 UTC (rev 1591)
@@ -73,7 +73,14 @@
*/
protected String characterEncoding = null;
+ /**
+ * Landing page to use if a user tries to access the login page directly or
+ * if the session times out during login. If not set, error responses will
+ * be sent instead.
+ */
+ protected String landingPage = null;
+
// ------------------------------------------------------------- Properties
@@ -103,6 +110,22 @@
}
+ /**
+ * Return the landing page to use when FORM auth is mis-used.
+ */
+ public String getLandingPage() {
+ return landingPage;
+ }
+
+
+ /**
+ * Set the landing page to use when the FORM auth is mis-used.
+ */
+ public void setLandingPage(String landingPage) {
+ this.landingPage = landingPage;
+ }
+
+
// --------------------------------------------------------- Public Methods
@@ -269,8 +292,19 @@
if (containerLog.isDebugEnabled())
containerLog.debug
("User took so long to log on the session expired");
- response.sendError(HttpServletResponse.SC_REQUEST_TIMEOUT,
- sm.getString("authenticator.sessionExpired"));
+ if (landingPage == null) {
+ response.sendError(HttpServletResponse.SC_REQUEST_TIMEOUT,
+ sm.getString("authenticator.sessionExpired"));
+ } else {
+ // Make the authenticator think the user originally requested
+ // the landing page
+ String uri = request.getContextPath() + landingPage;
+ SavedRequest saved = new SavedRequest();
+ saved.setRequestURI(uri);
+ request.getSessionInternal(true).setNote(
+ Constants.FORM_REQUEST_NOTE, saved);
+ response.sendRedirect(response.encodeRedirectURL(uri));
+ }
return (false);
}
@@ -287,8 +321,18 @@
if (log.isDebugEnabled())
log.debug("Redirecting to original '" + requestURI + "'");
if (requestURI == null)
- response.sendError(HttpServletResponse.SC_BAD_REQUEST,
- sm.getString("authenticator.formlogin"));
+ if (landingPage == null) {
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST,
+ sm.getString("authenticator.formlogin"));
+ } else {
+ // Make the authenticator think the user originally requested
+ // the landing page
+ String uri = request.getContextPath() + landingPage;
+ SavedRequest saved = new SavedRequest();
+ saved.setRequestURI(uri);
+ session.setNote(Constants.FORM_REQUEST_NOTE, saved);
+ response.sendRedirect(response.encodeRedirectURL(uri));
+ }
else
response.sendRedirect(response.encodeRedirectURL(requestURI));
return (false);
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-11-25 11:20:52 UTC (rev 1590)
+++ trunk/webapps/docs/changelog.xml 2010-11-25 11:24:57 UTC (rev 1591)
@@ -35,6 +35,9 @@
<bug>49991</bug>: Actually call Request listener when entering and exiting the application scope, not simply just before
calling the filter chain. (remm)
</fix>
+ <fix>
+ Allow a landing page for FORM. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
14 years, 10 months
JBossWeb SVN: r1590 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-11-25 06:20:52 -0500 (Thu, 25 Nov 2010)
New Revision: 1590
Modified:
trunk/java/org/apache/catalina/core/StandardContextValve.java
trunk/java/org/apache/catalina/core/StandardHostValve.java
trunk/webapps/docs/changelog.xml
Log:
- 49991: Improve timing of request listener calls.
Modified: trunk/java/org/apache/catalina/core/StandardContextValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContextValve.java 2010-11-25 10:43:58 UTC (rev 1589)
+++ trunk/java/org/apache/catalina/core/StandardContextValve.java 2010-11-25 11:20:52 UTC (rev 1590)
@@ -158,59 +158,8 @@
}
}
- // Normal request processing
- Object instances[] = context.getApplicationEventListeners();
-
- ServletRequestEvent event = null;
-
- if ((instances != null)
- && (instances.length > 0)) {
- event = new ServletRequestEvent
- (((StandardContext) container).getServletContext(),
- request.getRequest());
- // create pre-service event
- for (int i = 0; i < instances.length; i++) {
- if (instances[i] == null)
- continue;
- if (!(instances[i] instanceof ServletRequestListener))
- continue;
- ServletRequestListener listener =
- (ServletRequestListener) instances[i];
- try {
- listener.requestInitialized(event);
- } catch (Throwable t) {
- container.getLogger().error(sm.getString("standardContext.requestListener.requestInit",
- instances[i].getClass().getName()), t);
- ServletRequest sreq = request.getRequest();
- sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
- return;
- }
- }
- }
-
wrapper.getPipeline().getFirst().invoke(request, response);
- if ((instances !=null ) &&
- (instances.length > 0)) {
- // create post-service event
- for (int i = instances.length - 1; i >= 0; i--) {
- if (instances[i] == null)
- continue;
- if (!(instances[i] instanceof ServletRequestListener))
- continue;
- ServletRequestListener listener =
- (ServletRequestListener) instances[i];
- try {
- listener.requestDestroyed(event);
- } catch (Throwable t) {
- container.getLogger().error(sm.getString("standardContext.requestListener.requestDestroy",
- instances[i].getClass().getName()), t);
- ServletRequest sreq = request.getRequest();
- sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
- }
- }
- }
-
}
@@ -229,56 +178,10 @@
public final void event(Request request, Response response, HttpEvent httpEvent)
throws IOException, ServletException {
- Object instances[] = context.getApplicationEventListeners();
- ServletRequestEvent event = null;
- if (instances != null && (instances.length > 0)) {
- event = new ServletRequestEvent
- (((StandardContext) container).getServletContext(),
- request.getRequest());
- // create pre-service event
- for (int i = 0; i < instances.length; i++) {
- if (instances[i] == null)
- continue;
- if (!(instances[i] instanceof ServletRequestListener))
- continue;
- ServletRequestListener listener =
- (ServletRequestListener) instances[i];
- try {
- listener.requestInitialized(event);
- } catch (Throwable t) {
- container.getLogger().error(sm.getString("requestListenerValve.requestInit",
- instances[i].getClass().getName()), t);
- ServletRequest sreq = request.getRequest();
- sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
- return;
- }
- }
- }
-
// Select the Wrapper to be used for this Request
Wrapper wrapper = request.getWrapper();
wrapper.getPipeline().getFirst().event(request, response, httpEvent);
- if (instances != null && (instances.length > 0)) {
- // create post-service event
- for (int i = instances.length - 1; i >= 0; i--) {
- if (instances[i] == null)
- continue;
- if (!(instances[i] instanceof ServletRequestListener))
- continue;
- ServletRequestListener listener =
- (ServletRequestListener) instances[i];
- try {
- listener.requestDestroyed(event);
- } catch (Throwable t) {
- container.getLogger().error(sm.getString("requestListenerValve.requestDestroy",
- instances[i].getClass().getName()), t);
- ServletRequest sreq = request.getRequest();
- sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
- }
- }
- }
-
}
Modified: trunk/java/org/apache/catalina/core/StandardHostValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardHostValve.java 2010-11-25 10:43:58 UTC (rev 1589)
+++ trunk/java/org/apache/catalina/core/StandardHostValve.java 2010-11-25 11:20:52 UTC (rev 1590)
@@ -24,6 +24,9 @@
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.ServletRequestListener;
import javax.servlet.http.HttpServletResponse;
import org.apache.catalina.Context;
@@ -123,6 +126,36 @@
(context.getLoader().getClassLoader());
}
+ // Enter application scope
+ Object instances[] = context.getApplicationEventListeners();
+
+ ServletRequestEvent event = null;
+
+ if ((instances != null)
+ && (instances.length > 0)) {
+ event = new ServletRequestEvent
+ (((StandardContext) container).getServletContext(),
+ request.getRequest());
+ // create pre-service event
+ for (int i = 0; i < instances.length; i++) {
+ if (instances[i] == null)
+ continue;
+ if (!(instances[i] instanceof ServletRequestListener))
+ continue;
+ ServletRequestListener listener =
+ (ServletRequestListener) instances[i];
+ try {
+ listener.requestInitialized(event);
+ } catch (Throwable t) {
+ container.getLogger().error(sm.getString("standardContext.requestListener.requestInit",
+ instances[i].getClass().getName()), t);
+ ServletRequest sreq = request.getRequest();
+ sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
+ return;
+ }
+ }
+ }
+
// Ask this Context to process this request
context.getPipeline().getFirst().invoke(request, response);
@@ -143,6 +176,28 @@
status(request, response);
}
+ // Exit application scope
+ if ((instances !=null ) &&
+ (instances.length > 0)) {
+ // create post-service event
+ for (int i = instances.length - 1; i >= 0; i--) {
+ if (instances[i] == null)
+ continue;
+ if (!(instances[i] instanceof ServletRequestListener))
+ continue;
+ ServletRequestListener listener =
+ (ServletRequestListener) instances[i];
+ try {
+ listener.requestDestroyed(event);
+ } catch (Throwable t2) {
+ container.getLogger().error(sm.getString("standardContext.requestListener.requestDestroy",
+ instances[i].getClass().getName()), t2);
+ ServletRequest sreq = request.getRequest();
+ sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t2);
+ }
+ }
+ }
+
// Restore the context classloader
Thread.currentThread().setContextClassLoader
(StandardHostValve.class.getClassLoader());
@@ -174,6 +229,33 @@
(context.getLoader().getClassLoader());
}
+ // Enter application scope
+ Object instances[] = context.getApplicationEventListeners();
+ ServletRequestEvent event2 = null;
+ if (instances != null && (instances.length > 0)) {
+ event2 = new ServletRequestEvent
+ (((StandardContext) container).getServletContext(),
+ request.getRequest());
+ // create pre-service event
+ for (int i = 0; i < instances.length; i++) {
+ if (instances[i] == null)
+ continue;
+ if (!(instances[i] instanceof ServletRequestListener))
+ continue;
+ ServletRequestListener listener =
+ (ServletRequestListener) instances[i];
+ try {
+ listener.requestInitialized(event2);
+ } catch (Throwable t) {
+ container.getLogger().error(sm.getString("requestListenerValve.requestInit",
+ instances[i].getClass().getName()), t);
+ ServletRequest sreq = request.getRequest();
+ sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
+ return;
+ }
+ }
+ }
+
// Ask this Context to process this request
context.getPipeline().getFirst().event(request, response, event);
@@ -209,6 +291,27 @@
}
}
+ // Exit application scope
+ if (instances != null && (instances.length > 0)) {
+ // create post-service event
+ for (int i = instances.length - 1; i >= 0; i--) {
+ if (instances[i] == null)
+ continue;
+ if (!(instances[i] instanceof ServletRequestListener))
+ continue;
+ ServletRequestListener listener =
+ (ServletRequestListener) instances[i];
+ try {
+ listener.requestDestroyed(event2);
+ } catch (Throwable t) {
+ container.getLogger().error(sm.getString("requestListenerValve.requestDestroy",
+ instances[i].getClass().getName()), t);
+ ServletRequest sreq = request.getRequest();
+ sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
+ }
+ }
+ }
+
// Restore the context classloader
Thread.currentThread().setContextClassLoader
(StandardHostValve.class.getClassLoader());
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-11-25 10:43:58 UTC (rev 1589)
+++ trunk/webapps/docs/changelog.xml 2010-11-25 11:20:52 UTC (rev 1590)
@@ -31,6 +31,10 @@
<fix>
<bug>49779</bug>: Interaction between continue and FORM. (markt)
</fix>
+ <fix>
+ <bug>49991</bug>: Actually call Request listener when entering and exiting the application scope, not simply just before
+ calling the filter chain. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
14 years, 10 months
JBossWeb SVN: r1589 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-11-25 05:43:58 -0500 (Thu, 25 Nov 2010)
New Revision: 1589
Modified:
trunk/java/org/apache/el/parser/AstCompositeExpression.java
trunk/webapps/docs/changelog.xml
Log:
- Minor EL fix for enums.
Modified: trunk/java/org/apache/el/parser/AstCompositeExpression.java
===================================================================
--- trunk/java/org/apache/el/parser/AstCompositeExpression.java 2010-11-25 10:25:23 UTC (rev 1588)
+++ trunk/java/org/apache/el/parser/AstCompositeExpression.java 2010-11-25 10:43:58 UTC (rev 1589)
@@ -20,6 +20,7 @@
import javax.el.ELException;
+import org.apache.el.lang.ELSupport;
import org.apache.el.lang.EvaluationContext;
@@ -46,7 +47,7 @@
for (int i = 0; i < this.children.length; i++) {
obj = this.children[i].getValue(ctx);
if (obj != null) {
- sb.append(obj);
+ sb.append(ELSupport.coerceToString(obj));
}
}
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-11-25 10:25:23 UTC (rev 1588)
+++ trunk/webapps/docs/changelog.xml 2010-11-25 10:43:58 UTC (rev 1589)
@@ -61,6 +61,9 @@
<bug>50066</bug>: Fix building of recursive tag files when the file depends on a JAR file.
Patch provided by Sylvain Laurent. (markt)
</fix>
+ <fix>
+ <bug>50105</bug>: Use Enum.name() rather than Enum.toString() in composite expressions. (markt)
+ </fix>
</changelog>
</subsection>
</section>
14 years, 10 months
JBossWeb SVN: r1588 - trunk/java/org/apache/catalina/servlets.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-11-25 05:25:23 -0500 (Thu, 25 Nov 2010)
New Revision: 1588
Modified:
trunk/java/org/apache/catalina/servlets/WebdavServlet.java
Log:
- Revert previous patch, which aims at supporting toy webdav clients.
Modified: trunk/java/org/apache/catalina/servlets/WebdavServlet.java
===================================================================
--- trunk/java/org/apache/catalina/servlets/WebdavServlet.java 2010-11-25 09:59:34 UTC (rev 1587)
+++ trunk/java/org/apache/catalina/servlets/WebdavServlet.java 2010-11-25 10:25:23 UTC (rev 1588)
@@ -114,17 +114,16 @@
* http://host:port/context/webdavedit/content
*
* @author Remy Maucherat
- * @version $Id$
+ * @version $Revision$ $Date$
*/
public class WebdavServlet
extends DefaultServlet {
- private static final long serialVersionUID = 1L;
-
// -------------------------------------------------------------- Constants
+
private static final String METHOD_PROPFIND = "PROPFIND";
private static final String METHOD_PROPPATCH = "PROPPATCH";
private static final String METHOD_MKCOL = "MKCOL";
@@ -260,7 +259,6 @@
/**
* Initialize this servlet.
*/
- @Override
public void init()
throws ServletException {
@@ -311,7 +309,6 @@
/**
* Handles the special WebDAV methods.
*/
- @Override
protected void service(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
@@ -355,7 +352,6 @@
* and false if any of the conditions is not satisfied, in which case
* request processing is stopped
*/
- @Override
protected boolean checkIfHeaders(HttpServletRequest request,
HttpServletResponse response,
ResourceAttributes resourceAttributes)
@@ -378,7 +374,6 @@
*
* @param request The servlet request we are processing
*/
- @Override
protected String getRelativePath(HttpServletRequest request) {
// Are we being processed by a RequestDispatcher.include()?
if (request.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI) != null) {
@@ -407,7 +402,6 @@
* @throws ServletException If an error occurs
* @throws IOException If an IO error occurs
*/
- @Override
protected void doOptions(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
@@ -512,8 +506,6 @@
if (type == FIND_BY_PROPERTY) {
properties = new Vector<String>();
- // propNode must be non-null if type == FIND_BY_PROPERTY
- @SuppressWarnings("null")
NodeList childList = propNode.getChildNodes();
for (int i=0; i < childList.getLength(); i++) {
@@ -563,13 +555,13 @@
new XMLWriter(resp.getWriter());
generatedXML.writeXMLHeader();
generatedXML.writeElement
- (null, "D:multistatus"
+ (null, "multistatus"
+ generateNamespaceDeclarations(),
XMLWriter.OPENING);
parseLockNullProperties
(req, generatedXML, lockNullPath, type,
properties);
- generatedXML.writeElement(null, "D:multistatus",
+ generatedXML.writeElement(null, "multistatus",
XMLWriter.CLOSING);
generatedXML.sendData();
return;
@@ -592,7 +584,7 @@
XMLWriter generatedXML = new XMLWriter(resp.getWriter());
generatedXML.writeXMLHeader();
- generatedXML.writeElement(null, "D:multistatus"
+ generatedXML.writeElement(null, "multistatus"
+ generateNamespaceDeclarations(),
XMLWriter.OPENING);
@@ -672,7 +664,7 @@
}
}
- generatedXML.writeElement(null, "D:multistatus",
+ generatedXML.writeElement(null, "multistatus",
XMLWriter.CLOSING);
generatedXML.sendData();
@@ -683,8 +675,9 @@
/**
* PROPPATCH Method.
*/
- protected void doProppatch(HttpServletRequest req, HttpServletResponse resp)
- throws IOException {
+ protected void doProppatch(HttpServletRequest req,
+ HttpServletResponse resp)
+ throws ServletException, IOException {
if (readOnly) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
@@ -784,7 +777,6 @@
/**
* DELETE Method.
*/
- @Override
protected void doDelete(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
@@ -812,7 +804,6 @@
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet-specified error occurs
*/
- @Override
protected void doPut(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
@@ -834,7 +825,7 @@
* COPY Method.
*/
protected void doCopy(HttpServletRequest req, HttpServletResponse resp)
- throws IOException {
+ throws ServletException, IOException {
if (readOnly) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
@@ -850,7 +841,7 @@
* MOVE Method.
*/
protected void doMove(HttpServletRequest req, HttpServletResponse resp)
- throws IOException {
+ throws ServletException, IOException {
if (readOnly) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
@@ -1157,7 +1148,7 @@
generatedXML.writeXMLHeader();
generatedXML.writeElement
- (null, "D:multistatus" + generateNamespaceDeclarations(),
+ (null, "multistatus" + generateNamespaceDeclarations(),
XMLWriter.OPENING);
while (lockPathsList.hasMoreElements()) {
@@ -1291,15 +1282,19 @@
LockInfo toRenew = resourceLocks.get(path);
Enumeration<String> tokenList = null;
+ if (lock != null) {
- // At least one of the tokens of the locks must have been given
- tokenList = toRenew.tokens.elements();
- while (tokenList.hasMoreElements()) {
- String token = tokenList.nextElement();
- if (ifHeader.indexOf(token) != -1) {
- toRenew.expiresAt = lock.expiresAt;
- lock = toRenew;
+ // At least one of the tokens of the locks must have been given
+
+ tokenList = toRenew.tokens.elements();
+ while (tokenList.hasMoreElements()) {
+ String token = tokenList.nextElement();
+ if (ifHeader.indexOf(token) != -1) {
+ toRenew.expiresAt = lock.expiresAt;
+ lock = toRenew;
+ }
}
+
}
// Checking inheritable collection locks
@@ -1328,19 +1323,19 @@
// the lock information
XMLWriter generatedXML = new XMLWriter();
generatedXML.writeXMLHeader();
- generatedXML.writeElement(null, "D:prop"
+ generatedXML.writeElement(null, "prop"
+ generateNamespaceDeclarations(),
XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:lockdiscovery",
+ generatedXML.writeElement(null, "lockdiscovery",
XMLWriter.OPENING);
lock.toXML(generatedXML);
- generatedXML.writeElement(null, "D:lockdiscovery",
+ generatedXML.writeElement(null, "lockdiscovery",
XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:prop", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "prop", XMLWriter.CLOSING);
resp.setStatus(WebdavStatus.SC_OK);
resp.setContentType("text/xml; charset=UTF-8");
@@ -1355,7 +1350,7 @@
* UNLOCK Method.
*/
protected void doUnlock(HttpServletRequest req, HttpServletResponse resp)
- throws IOException {
+ throws ServletException, IOException {
if (readOnly) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
@@ -1432,7 +1427,7 @@
* Generate the namespace declarations.
*/
private String generateNamespaceDeclarations() {
- return " xmlns:D=\"" + DEFAULT_NAMESPACE + "\"";
+ return " xmlns=\"" + DEFAULT_NAMESPACE + "\"";
}
@@ -1532,7 +1527,7 @@
*/
private boolean copyResource(HttpServletRequest req,
HttpServletResponse resp)
- throws IOException {
+ throws ServletException, IOException {
// Parsing destination header
@@ -1698,13 +1693,13 @@
/**
* Copy a collection.
*
- * @param dirContext Resources implementation to be used
+ * @param resources Resources implementation to be used
* @param errorList Hashtable containing the list of errors which occurred
* during the copy operation
* @param source Path of the resource to be copied
* @param dest Destination path
*/
- private boolean copyResource(DirContext dirContext,
+ private boolean copyResource(DirContext resources,
Hashtable<String,Integer> errorList, String source, String dest) {
if (debug > 1)
@@ -1712,7 +1707,7 @@
Object object = null;
try {
- object = dirContext.lookup(source);
+ object = resources.lookup(source);
} catch (NamingException e) {
// Ignore
}
@@ -1720,16 +1715,15 @@
if (object instanceof DirContext) {
try {
- dirContext.createSubcontext(dest);
+ resources.createSubcontext(dest);
} catch (NamingException e) {
- errorList.put
- (dest, new Integer(WebdavStatus.SC_CONFLICT));
+ errorList.put(dest, WebdavStatus.SC_CONFLICT);
return false;
}
try {
NamingEnumeration<NameClassPair> enumeration =
- dirContext.list(source);
+ resources.list(source);
while (enumeration.hasMoreElements()) {
NameClassPair ncPair = enumeration.nextElement();
String childDest = dest;
@@ -1740,11 +1734,10 @@
if (!childSrc.equals("/"))
childSrc += "/";
childSrc += ncPair.getName();
- copyResource(dirContext, errorList, childSrc, childDest);
+ copyResource(resources, errorList, childSrc, childDest);
}
} catch (NamingException e) {
- errorList.put
- (dest, new Integer(WebdavStatus.SC_INTERNAL_SERVER_ERROR));
+ errorList.put(dest, WebdavStatus.SC_INTERNAL_SERVER_ERROR);
return false;
}
@@ -1752,23 +1745,19 @@
if (object instanceof Resource) {
try {
- dirContext.bind(dest, object);
+ resources.bind(dest, object);
} catch (NamingException e) {
if (e.getCause() instanceof FileNotFoundException) {
// We know the source exists so it must be the
// destination dir that can't be found
- errorList.put(source,
- new Integer(WebdavStatus.SC_CONFLICT));
+ errorList.put(source, WebdavStatus.SC_CONFLICT);
} else {
- errorList.put(source,
- new Integer(WebdavStatus.SC_INTERNAL_SERVER_ERROR));
+ errorList.put(source, WebdavStatus.SC_INTERNAL_SERVER_ERROR);
}
return false;
}
} else {
- errorList.put
- (source,
- new Integer(WebdavStatus.SC_INTERNAL_SERVER_ERROR));
+ errorList.put(source, WebdavStatus.SC_INTERNAL_SERVER_ERROR);
return false;
}
@@ -1788,7 +1777,7 @@
*/
private boolean deleteResource(HttpServletRequest req,
HttpServletResponse resp)
- throws IOException {
+ throws ServletException, IOException {
String path = getRelativePath(req);
@@ -1808,7 +1797,7 @@
*/
private boolean deleteResource(String path, HttpServletRequest req,
HttpServletResponse resp, boolean setStatus)
- throws IOException {
+ throws ServletException, IOException {
if ((path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF")) ||
(path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF"))) {
@@ -1883,12 +1872,12 @@
/**
* Deletes a collection.
*
- * @param dirContext Resources implementation associated with the context
+ * @param resources Resources implementation associated with the context
* @param path Path to the collection to be deleted
* @param errorList Contains the list of the errors which occurred
*/
private void deleteCollection(HttpServletRequest req,
- DirContext dirContext,
+ DirContext resources,
String path,
Hashtable<String,Integer> errorList) {
@@ -1911,7 +1900,7 @@
Enumeration<NameClassPair> enumeration = null;
try {
- enumeration = dirContext.list(path);
+ enumeration = resources.list(path);
} catch (NamingException e) {
errorList.put(path, new Integer
(WebdavStatus.SC_INTERNAL_SERVER_ERROR));
@@ -1932,13 +1921,13 @@
} else {
try {
- Object object = dirContext.lookup(childName);
+ Object object = resources.lookup(childName);
if (object instanceof DirContext) {
- deleteCollection(req, dirContext, childName, errorList);
+ deleteCollection(req, resources, childName, errorList);
}
try {
- dirContext.unbind(childName);
+ resources.unbind(childName);
} catch (NamingException e) {
if (!(object instanceof DirContext)) {
// If it's not a collection, then it's an unknown
@@ -1970,7 +1959,7 @@
*/
private void sendReport(HttpServletRequest req, HttpServletResponse resp,
Hashtable<String,Integer> errorList)
- throws IOException {
+ throws ServletException, IOException {
resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
@@ -2046,13 +2035,13 @@
return;
}
- generatedXML.writeElement(null, "D:response", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "response", XMLWriter.OPENING);
String status = new String("HTTP/1.1 " + WebdavStatus.SC_OK + " "
+ WebdavStatus.getStatusText
(WebdavStatus.SC_OK));
// Generating href element
- generatedXML.writeElement(null, "D:href", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "href", XMLWriter.OPENING);
String href = req.getContextPath() + req.getServletPath();
if ((href.endsWith("/")) && (path.startsWith("/")))
@@ -2064,7 +2053,7 @@
generatedXML.writeText(rewriteUrl(href));
- generatedXML.writeElement(null, "D:href", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "href", XMLWriter.CLOSING);
String resourceName = path;
int lastSlash = path.lastIndexOf('/');
@@ -2075,98 +2064,98 @@
case FIND_ALL_PROP :
- generatedXML.writeElement(null, "D:propstat", XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:prop", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "propstat", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "prop", XMLWriter.OPENING);
generatedXML.writeProperty
- (null, "D:creationdate",
+ (null, "creationdate",
getISOCreationDate(cacheEntry.attributes.getCreation()));
- generatedXML.writeElement(null, "D:displayname", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "displayname", XMLWriter.OPENING);
generatedXML.writeData(resourceName);
- generatedXML.writeElement(null, "D:displayname", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "displayname", XMLWriter.CLOSING);
if (cacheEntry.resource != null) {
generatedXML.writeProperty
- (null, "D:getlastmodified", FastHttpDateFormat.formatDate
+ (null, "getlastmodified", FastHttpDateFormat.formatDate
(cacheEntry.attributes.getLastModified(), null));
generatedXML.writeProperty
- (null, "D:getcontentlength",
+ (null, "getcontentlength",
String.valueOf(cacheEntry.attributes.getContentLength()));
String contentType = getServletContext().getMimeType
(cacheEntry.name);
if (contentType != null) {
- generatedXML.writeProperty(null, "D:getcontenttype",
+ generatedXML.writeProperty(null, "getcontenttype",
contentType);
}
- generatedXML.writeProperty(null, "D:getetag",
+ generatedXML.writeProperty(null, "getetag",
cacheEntry.attributes.getETag());
- generatedXML.writeElement(null, "D:resourcetype",
+ generatedXML.writeElement(null, "resourcetype",
XMLWriter.NO_CONTENT);
} else {
- generatedXML.writeElement(null, "D:resourcetype",
+ generatedXML.writeElement(null, "resourcetype",
XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:collection",
+ generatedXML.writeElement(null, "collection",
XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:resourcetype",
+ generatedXML.writeElement(null, "resourcetype",
XMLWriter.CLOSING);
}
- generatedXML.writeProperty(null, "D:source", "");
+ generatedXML.writeProperty(null, "source", "");
- String supportedLocks = "<D:lockentry>"
- + "<D:lockscope><D:exclusive/></D:lockscope>"
- + "<D:locktype><D:write/></D:locktype>"
- + "</D:lockentry>" + "<D:lockentry>"
- + "<D:lockscope><D:shared/></D:lockscope>"
- + "<D:locktype><D:write/></D:locktype>"
- + "</D:lockentry>";
- generatedXML.writeElement(null, "D:supportedlock",
+ String supportedLocks = "<lockentry>"
+ + "<lockscope><exclusive/></lockscope>"
+ + "<locktype><write/></locktype>"
+ + "</lockentry>" + "<lockentry>"
+ + "<lockscope><shared/></lockscope>"
+ + "<locktype><write/></locktype>"
+ + "</lockentry>";
+ generatedXML.writeElement(null, "supportedlock",
XMLWriter.OPENING);
generatedXML.writeText(supportedLocks);
- generatedXML.writeElement(null, "D:supportedlock",
+ generatedXML.writeElement(null, "supportedlock",
XMLWriter.CLOSING);
generateLockDiscovery(path, generatedXML);
- generatedXML.writeElement(null, "D:prop", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:status", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "prop", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "status", XMLWriter.OPENING);
generatedXML.writeText(status);
- generatedXML.writeElement(null, "D:status", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:propstat", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "status", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "propstat", XMLWriter.CLOSING);
break;
case FIND_PROPERTY_NAMES :
- generatedXML.writeElement(null, "D:propstat", XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:prop", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "propstat", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "prop", XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:creationdate",
+ generatedXML.writeElement(null, "creationdate",
XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:displayname",
+ generatedXML.writeElement(null, "displayname",
XMLWriter.NO_CONTENT);
if (cacheEntry.resource != null) {
- generatedXML.writeElement(null, "D:getcontentlanguage",
+ generatedXML.writeElement(null, "getcontentlanguage",
XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:getcontentlength",
+ generatedXML.writeElement(null, "getcontentlength",
XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:getcontenttype",
+ generatedXML.writeElement(null, "getcontenttype",
XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:getetag",
+ generatedXML.writeElement(null, "getetag",
XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:getlastmodified",
+ generatedXML.writeElement(null, "getlastmodified",
XMLWriter.NO_CONTENT);
}
- generatedXML.writeElement(null, "D:resourcetype",
+ generatedXML.writeElement(null, "resourcetype",
XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:source", XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:lockdiscovery",
+ generatedXML.writeElement(null, "source", XMLWriter.NO_CONTENT);
+ generatedXML.writeElement(null, "lockdiscovery",
XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:prop", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:status", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "prop", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "status", XMLWriter.OPENING);
generatedXML.writeText(status);
- generatedXML.writeElement(null, "D:status", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:propstat", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "status", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "propstat", XMLWriter.CLOSING);
break;
@@ -2176,8 +2165,8 @@
// Parse the list of properties
- generatedXML.writeElement(null, "D:propstat", XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:prop", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "propstat", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "prop", XMLWriter.OPENING);
Enumeration<String> properties = propertiesVector.elements();
@@ -2187,19 +2176,19 @@
if (property.equals("creationdate")) {
generatedXML.writeProperty
- (null, "D:creationdate",
+ (null, "creationdate",
getISOCreationDate(cacheEntry.attributes.getCreation()));
} else if (property.equals("displayname")) {
generatedXML.writeElement
- (null, "D:displayname", XMLWriter.OPENING);
+ (null, "displayname", XMLWriter.OPENING);
generatedXML.writeData(resourceName);
generatedXML.writeElement
- (null, "D:displayname", XMLWriter.CLOSING);
+ (null, "displayname", XMLWriter.CLOSING);
} else if (property.equals("getcontentlanguage")) {
if (cacheEntry.context != null) {
propertiesNotFound.addElement(property);
} else {
- generatedXML.writeElement(null, "D:getcontentlanguage",
+ generatedXML.writeElement(null, "getcontentlanguage",
XMLWriter.NO_CONTENT);
}
} else if (property.equals("getcontentlength")) {
@@ -2207,7 +2196,7 @@
propertiesNotFound.addElement(property);
} else {
generatedXML.writeProperty
- (null, "D:getcontentlength",
+ (null, "getcontentlength",
(String.valueOf(cacheEntry.attributes.getContentLength())));
}
} else if (property.equals("getcontenttype")) {
@@ -2215,7 +2204,7 @@
propertiesNotFound.addElement(property);
} else {
generatedXML.writeProperty
- (null, "D:getcontenttype",
+ (null, "getcontenttype",
getServletContext().getMimeType
(cacheEntry.name));
}
@@ -2224,42 +2213,42 @@
propertiesNotFound.addElement(property);
} else {
generatedXML.writeProperty
- (null, "D:getetag", cacheEntry.attributes.getETag());
+ (null, "getetag", cacheEntry.attributes.getETag());
}
} else if (property.equals("getlastmodified")) {
if (cacheEntry.context != null) {
propertiesNotFound.addElement(property);
} else {
generatedXML.writeProperty
- (null, "D:getlastmodified", FastHttpDateFormat.formatDate
+ (null, "getlastmodified", FastHttpDateFormat.formatDate
(cacheEntry.attributes.getLastModified(), null));
}
} else if (property.equals("resourcetype")) {
if (cacheEntry.context != null) {
- generatedXML.writeElement(null, "D:resourcetype",
+ generatedXML.writeElement(null, "resourcetype",
XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:collection",
+ generatedXML.writeElement(null, "collection",
XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:resourcetype",
+ generatedXML.writeElement(null, "resourcetype",
XMLWriter.CLOSING);
} else {
- generatedXML.writeElement(null, "D:resourcetype",
+ generatedXML.writeElement(null, "resourcetype",
XMLWriter.NO_CONTENT);
}
} else if (property.equals("source")) {
- generatedXML.writeProperty(null, "D:source", "");
+ generatedXML.writeProperty(null, "source", "");
} else if (property.equals("supportedlock")) {
- supportedLocks = "<D:lockentry>"
- + "<D:lockscope><D:exclusive/></D:lockscope>"
- + "<D:locktype><D:write/></D:locktype>"
- + "</D:lockentry>" + "<D:lockentry>"
- + "<D:lockscope><D:shared/></D:lockscope>"
- + "<D:locktype><D:write/></D:locktype>"
- + "</D:lockentry>";
- generatedXML.writeElement(null, "D:supportedlock",
+ supportedLocks = "<lockentry>"
+ + "<lockscope><exclusive/></lockscope>"
+ + "<locktype><write/></locktype>"
+ + "</lockentry>" + "<lockentry>"
+ + "<lockscope><shared/></lockscope>"
+ + "<locktype><write/></locktype>"
+ + "</lockentry>";
+ generatedXML.writeElement(null, "supportedlock",
XMLWriter.OPENING);
generatedXML.writeText(supportedLocks);
- generatedXML.writeElement(null, "D:supportedlock",
+ generatedXML.writeElement(null, "supportedlock",
XMLWriter.CLOSING);
} else if (property.equals("lockdiscovery")) {
if (!generateLockDiscovery(path, generatedXML))
@@ -2270,11 +2259,11 @@
}
- generatedXML.writeElement(null, "D:prop", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:status", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "prop", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "status", XMLWriter.OPENING);
generatedXML.writeText(status);
- generatedXML.writeElement(null, "D:status", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:propstat", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "status", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "propstat", XMLWriter.CLOSING);
Enumeration<String> propertiesNotFoundList =
propertiesNotFound.elements();
@@ -2285,8 +2274,8 @@
+ " " + WebdavStatus.getStatusText
(WebdavStatus.SC_NOT_FOUND));
- generatedXML.writeElement(null, "D:propstat", XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:prop", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "propstat", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "prop", XMLWriter.OPENING);
while (propertiesNotFoundList.hasMoreElements()) {
generatedXML.writeElement
@@ -2294,11 +2283,11 @@
XMLWriter.NO_CONTENT);
}
- generatedXML.writeElement(null, "D:prop", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:status", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "prop", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "status", XMLWriter.OPENING);
generatedXML.writeText(status);
- generatedXML.writeElement(null, "D:status", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:propstat", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "status", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "propstat", XMLWriter.CLOSING);
}
@@ -2306,13 +2295,13 @@
}
- generatedXML.writeElement(null, "D:response", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "response", XMLWriter.CLOSING);
}
/**
- * Propfind helper method. Displays the properties of a lock-null resource.
+ * Propfind helper method. Dispays the properties of a lock-null resource.
*
* @param resources Resources object associated with this context
* @param generatedXML XML response to the Propfind request
@@ -2390,7 +2379,7 @@
generatedXML.writeElement(null, "resourcetype",
XMLWriter.CLOSING);
- generatedXML.writeProperty(null, "D:source", "");
+ generatedXML.writeProperty(null, "source", "");
String supportedLocks = "<lockentry>"
+ "<lockscope><exclusive/></lockscope>"
@@ -2578,7 +2567,7 @@
if (resourceLock != null) {
wroteStart = true;
- generatedXML.writeElement(null, "D:lockdiscovery",
+ generatedXML.writeElement(null, "lockdiscovery",
XMLWriter.OPENING);
resourceLock.toXML(generatedXML);
}
@@ -2588,7 +2577,7 @@
if (path.startsWith(currentLock.path)) {
if (!wroteStart) {
wroteStart = true;
- generatedXML.writeElement(null, "D:lockdiscovery",
+ generatedXML.writeElement(null, "lockdiscovery",
XMLWriter.OPENING);
}
currentLock.toXML(generatedXML);
@@ -2596,7 +2585,7 @@
}
if (wroteStart) {
- generatedXML.writeElement(null, "D:lockdiscovery",
+ generatedXML.writeElement(null, "lockdiscovery",
XMLWriter.CLOSING);
} else {
return false;
@@ -2638,7 +2627,7 @@
* Determines the methods normally allowed for the resource.
*
*/
- private StringBuilder determineMethodsAllowed(DirContext dirContext,
+ private StringBuilder determineMethodsAllowed(DirContext resources,
HttpServletRequest req) {
StringBuilder methodsAllowed = new StringBuilder();
@@ -2647,7 +2636,7 @@
try {
String path = getRelativePath(req);
- object = dirContext.lookup(path);
+ object = resources.lookup(path);
} catch (NamingException e) {
exists = false;
}
@@ -2710,7 +2699,6 @@
/**
* Get a String representation of this lock token.
*/
- @Override
public String toString() {
String result = "Type:" + type + "\n";
@@ -2752,44 +2740,44 @@
*/
public void toXML(XMLWriter generatedXML) {
- generatedXML.writeElement(null, "D:activelock", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "activelock", XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:locktype", XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:" + type, XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:locktype", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "locktype", XMLWriter.OPENING);
+ generatedXML.writeElement(null, type, XMLWriter.NO_CONTENT);
+ generatedXML.writeElement(null, "locktype", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:lockscope", XMLWriter.OPENING);
- generatedXML.writeElement(null, "D:" + scope, XMLWriter.NO_CONTENT);
- generatedXML.writeElement(null, "D:lockscope", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "lockscope", XMLWriter.OPENING);
+ generatedXML.writeElement(null, scope, XMLWriter.NO_CONTENT);
+ generatedXML.writeElement(null, "lockscope", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:depth", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "depth", XMLWriter.OPENING);
if (depth == maxDepth) {
generatedXML.writeText("Infinity");
} else {
generatedXML.writeText("0");
}
- generatedXML.writeElement(null, "D:depth", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "depth", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:owner", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "owner", XMLWriter.OPENING);
generatedXML.writeText(owner);
- generatedXML.writeElement(null, "D:owner", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "owner", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:timeout", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "timeout", XMLWriter.OPENING);
long timeout = (expiresAt - System.currentTimeMillis()) / 1000;
generatedXML.writeText("Second-" + timeout);
- generatedXML.writeElement(null, "D:timeout", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "timeout", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:locktoken", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "locktoken", XMLWriter.OPENING);
Enumeration<String> tokensList = tokens.elements();
while (tokensList.hasMoreElements()) {
- generatedXML.writeElement(null, "D:href", XMLWriter.OPENING);
+ generatedXML.writeElement(null, "href", XMLWriter.OPENING);
generatedXML.writeText("opaquelocktoken:"
+ tokensList.nextElement());
- generatedXML.writeElement(null, "D:href", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "href", XMLWriter.CLOSING);
}
- generatedXML.writeElement(null, "D:locktoken", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "locktoken", XMLWriter.CLOSING);
- generatedXML.writeElement(null, "D:activelock", XMLWriter.CLOSING);
+ generatedXML.writeElement(null, "activelock", XMLWriter.CLOSING);
}
@@ -2800,9 +2788,8 @@
// --------------------------------------------- WebdavResolver Inner Class
/**
* Work around for XML parsers that don't fully respect
- * {@link DocumentBuilderFactory#setExpandEntityReferences(boolean)} when
- * called with <code>false</code>. External references are filtered out for
- * security reasons. See CVE-2007-5461.
+ * {@link DocumentBuilderFactory#setExpandEntityReferences(false)}. External
+ * references are filtered out for security reasons. See CVE-2007-5461.
*/
private class WebdavResolver implements EntityResolver {
private ServletContext context;
@@ -3024,8 +3011,8 @@
* providing status for multiple independent operations.
*/
public static final int SC_MULTI_STATUS = 207;
- // This one collides with HTTP 1.1
- // "207 Partial Update OK"
+ // This one colides with HTTP 1.1
+ // "207 Parital Update OK"
/**
@@ -3033,7 +3020,7 @@
* the PATCH method was not understood by the resource.
*/
public static final int SC_UNPROCESSABLE_ENTITY = 418;
- // This one collides with HTTP 1.1
+ // This one colides with HTTP 1.1
// "418 Reauthentication Required"
@@ -3043,7 +3030,7 @@
* execution of this method.
*/
public static final int SC_INSUFFICIENT_SPACE_ON_RESOURCE = 419;
- // This one collides with HTTP 1.1
+ // This one colides with HTTP 1.1
// "419 Proxy Reauthentication Required"
@@ -3069,7 +3056,7 @@
static {
- // HTTP 1.0 status Code
+ // HTTP 1.0 tatus Code
addStatusCodeMap(SC_OK, "OK");
addStatusCodeMap(SC_CREATED, "Created");
addStatusCodeMap(SC_ACCEPTED, "Accepted");
@@ -3139,3 +3126,5 @@
}
}
+
+
14 years, 10 months
JBossWeb SVN: r1587 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-11-25 04:59:34 -0500 (Thu, 25 Nov 2010)
New Revision: 1587
Modified:
trunk/java/org/apache/jasper/compiler/TagFileProcessor.java
trunk/webapps/docs/changelog.xml
Log:
- 50066: Tag file processing fix.
Modified: trunk/java/org/apache/jasper/compiler/TagFileProcessor.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/TagFileProcessor.java 2010-11-25 09:56:13 UTC (rev 1586)
+++ trunk/java/org/apache/jasper/compiler/TagFileProcessor.java 2010-11-25 09:59:34 UTC (rev 1587)
@@ -618,6 +618,9 @@
.getServletContext(), ctxt.getOptions(),
tagFilePath, tagInfo, ctxt.getRuntimeContext(),
ctxt.getTagFileJarUrl(tagFilePath));
+ // Use same classloader and classpath for compiling tag files
+ tempWrapper.getJspEngineContext().setClassLoader(ctxt.getClassLoader());
+ tempWrapper.getJspEngineContext().setClassPath(ctxt.getClassPath());
tagClazz = tempWrapper.loadTagFilePrototype();
tempVector.add(tempWrapper.getJspEngineContext()
.getCompiler());
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-11-25 09:56:13 UTC (rev 1586)
+++ trunk/webapps/docs/changelog.xml 2010-11-25 09:59:34 UTC (rev 1587)
@@ -57,6 +57,10 @@
<bug>49998</bug>: Handle single quoted attributes in detection of jsp:root
element in XML syntax JSP files. (markt)
</fix>
+ <fix>
+ <bug>50066</bug>: Fix building of recursive tag files when the file depends on a JAR file.
+ Patch provided by Sylvain Laurent. (markt)
+ </fix>
</changelog>
</subsection>
</section>
14 years, 10 months
JBossWeb SVN: r1586 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-11-25 04:56:13 -0500 (Thu, 25 Nov 2010)
New Revision: 1586
Modified:
trunk/java/org/apache/jasper/compiler/ParserController.java
trunk/webapps/docs/changelog.xml
Log:
- 49998: XML syntax detection improvement.
Modified: trunk/java/org/apache/jasper/compiler/ParserController.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/ParserController.java 2010-11-23 12:35:04 UTC (rev 1585)
+++ trunk/java/org/apache/jasper/compiler/ParserController.java 2010-11-25 09:56:13 UTC (rev 1586)
@@ -612,10 +612,12 @@
&& Character.isWhitespace(root.charAt(index))) {
index++;
}
- if (index < root.length() && root.charAt(index++) == '"'
- && root.regionMatches(index, JSP_URI, 0,
- JSP_URI.length())) {
- return true;
+ if (index < root.length()
+ && (root.charAt(index) == '"' || root.charAt(index) == '\'')) {
+ index++;
+ if (root.regionMatches(index, JSP_URI, 0, JSP_URI.length())) {
+ return true;
+ }
}
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-11-23 12:35:04 UTC (rev 1585)
+++ trunk/webapps/docs/changelog.xml 2010-11-25 09:56:13 UTC (rev 1586)
@@ -49,10 +49,14 @@
<fix>
<bug>49555</bug>: Fix use of static inner classes in taglibs. (markt)
</fix>
- <fix>
+ <fix>
<bug>49726</bug>: Specifying a default content type via a JSP property group
should not prevent a page from setting some other content type. (markt)
</fix>
+ <fix>
+ <bug>49998</bug>: Handle single quoted attributes in detection of jsp:root
+ element in XML syntax JSP files. (markt)
+ </fix>
</changelog>
</subsection>
</section>
14 years, 10 months
JBossWeb SVN: r1585 - trunk/java/org/apache/catalina/core.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-11-23 07:35:04 -0500 (Tue, 23 Nov 2010)
New Revision: 1585
Modified:
trunk/java/org/apache/catalina/core/AprLifecycleListener.java
Log:
- Drop teminate call.
Modified: trunk/java/org/apache/catalina/core/AprLifecycleListener.java
===================================================================
--- trunk/java/org/apache/catalina/core/AprLifecycleListener.java 2010-11-23 10:18:39 UTC (rev 1584)
+++ trunk/java/org/apache/catalina/core/AprLifecycleListener.java 2010-11-23 12:35:04 UTC (rev 1585)
@@ -89,33 +89,10 @@
}
}
}
- } else if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType())) {
- if (!aprInitialized) {
- return;
- }
- try {
- terminateAPR();
- } catch (Throwable t) {
- if (!log.isDebugEnabled()) {
- log.info(sm.getString("aprListener.aprDestroy"));
- } else {
- log.debug(sm.getString("aprListener.aprDestroy"), t);
- }
- }
}
}
- private static synchronized void terminateAPR()
- throws ClassNotFoundException, NoSuchMethodException,
- IllegalAccessException, InvocationTargetException
- {
- String methodName = "terminate";
- Method method = Class.forName("org.apache.tomcat.jni.Library")
- .getMethod(methodName, (Class [])null);
- method.invoke(null, (Object []) null);
- }
-
private boolean init()
{
int major = 0;
@@ -154,13 +131,6 @@
TCN_REQUIRED_MAJOR + "." +
TCN_REQUIRED_MINOR + "." +
TCN_REQUIRED_PATCH));
- try {
- // Terminate the APR in case the version
- // is below required.
- terminateAPR();
- } catch (Throwable t) {
- // Ignore
- }
return false;
}
if (patch < TCN_RECOMMENDED_PV) {
14 years, 10 months