JBossWeb SVN: r888 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-29 06:43:18 -0500 (Mon, 29 Dec 2008)
New Revision: 888
Modified:
trunk/PATCHES.txt
trunk/webapps/docs/changelog.xml
Log:
- Changelog update.
Modified: trunk/PATCHES.txt
===================================================================
--- trunk/PATCHES.txt 2008-12-29 11:42:48 UTC (rev 887)
+++ trunk/PATCHES.txt 2008-12-29 11:43:18 UTC (rev 888)
@@ -33,4 +33,7 @@
724886
Executor modifications, very specialized work that breaks the Executor design (a single task can be submitted
-to the real executor more than once) to supposedly work better with the NIO connector
+to the real executor more than once) to supposedly work better with the NIO connector.
+
+728947
+Lame IE 6 and 7 cookie hack for expires.
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-12-29 11:42:48 UTC (rev 887)
+++ trunk/webapps/docs/changelog.xml 2008-12-29 11:43:18 UTC (rev 888)
@@ -17,6 +17,13 @@
<body>
<section name="JBoss Web 2.1.2.CR1 (remm)">
+ <subsection name="General">
+ <changelog>
+ <update>
+ NSIS 2.41. (remm)
+ </update>
+ </changelog>
+ </subsection>
<subsection name="Catalina">
<changelog>
<fix>
@@ -67,6 +74,18 @@
<update>
Support all cookie flags in RewriteRule. (remm)
</update>
+ <fix>
+ Remove useless normalization when getting a request dispatcher through a request. (remm)
+ </fix>
+ <fix>
+ Filter not found URI in default servlet. (remm)
+ </fix>
+ <fix>
+ <bug>46304</bug>: Cache event methods when security is enabled. (markt)
+ </fix>
+ <fix>
+ <bug>46261</bug>: Handling for / in context path. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -74,6 +93,9 @@
<fix>
JSSE configuration for SSL sessions. (markt)
</fix>
+ <fix>
+ Preload fast date format in HTTP connector. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
15 years, 12 months
JBossWeb SVN: r887 - trunk/java/org/apache/catalina/realm.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-29 06:42:48 -0500 (Mon, 29 Dec 2008)
New Revision: 887
Modified:
trunk/java/org/apache/catalina/realm/JDBCRealm.java
trunk/java/org/apache/catalina/realm/LocalStrings.properties
Log:
- Report URL error in JDBC realm.
Modified: trunk/java/org/apache/catalina/realm/JDBCRealm.java
===================================================================
--- trunk/java/org/apache/catalina/realm/JDBCRealm.java 2008-12-29 11:42:28 UTC (rev 886)
+++ trunk/java/org/apache/catalina/realm/JDBCRealm.java 2008-12-29 11:42:48 UTC (rev 887)
@@ -698,6 +698,9 @@
if (connectionPassword != null)
props.put("password", connectionPassword);
dbConnection = driver.connect(connectionURL, props);
+ if (dbConnection == null) {
+ throw new SQLException(sm.getString("jdbcRealm.open.invalidurl",driverName, connectionURL));
+ }
dbConnection.setAutoCommit(false);
return (dbConnection);
Modified: trunk/java/org/apache/catalina/realm/LocalStrings.properties
===================================================================
--- trunk/java/org/apache/catalina/realm/LocalStrings.properties 2008-12-29 11:42:28 UTC (rev 886)
+++ trunk/java/org/apache/catalina/realm/LocalStrings.properties 2008-12-29 11:42:48 UTC (rev 887)
@@ -38,6 +38,7 @@
jdbcRealm.getPassword.exception=Exception retrieving password for "{0}"
jdbcRealm.getRoles.exception=Exception retrieving roles for "{0}"
jdbcRealm.open=Exception opening database connection
+jdbcRealm.open.invalidurl=Driver "{0}" does not support the url "{1}"
jndiRealm.authenticateFailure=Username {0} NOT successfully authenticated
jndiRealm.authenticateSuccess=Username {0} successfully authenticated
jndiRealm.close=Exception closing directory server connection
15 years, 12 months
JBossWeb SVN: r886 - in trunk/java/org/apache/catalina: manager and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-29 06:42:28 -0500 (Mon, 29 Dec 2008)
New Revision: 886
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
Log:
- No URL escaping in path name for context.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2008-12-29 11:41:03 UTC (rev 885)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2008-12-29 11:42:28 UTC (rev 886)
@@ -1557,7 +1557,7 @@
*/
public void setPath(String path) {
// XXX Use host in name
- setName(RequestUtil.URLDecode(path));
+ setName(path);
}
Modified: trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
===================================================================
--- trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java 2008-12-29 11:41:03 UTC (rev 885)
+++ trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java 2008-12-29 11:42:28 UTC (rev 886)
@@ -44,6 +44,7 @@
import org.apache.catalina.manager.util.SessionUtils;
import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.util.ServerInfo;
+import org.apache.catalina.util.URLEncoder;
import org.apache.tomcat.util.http.fileupload.DiskFileUpload;
import org.apache.tomcat.util.http.fileupload.FileItem;
@@ -72,10 +73,16 @@
public final class HTMLManagerServlet extends ManagerServlet {
+ protected static final URLEncoder URL_ENCODER;
protected static final String APPLICATION_MESSAGE = "message";
protected static final String APPLICATION_ERROR = "error";
protected String sessionsListJspPath = "/sessionsList.jsp";
protected String sessionDetailJspPath = "/sessionDetail.jsp";
+ static {
+ URL_ENCODER = new URLEncoder();
+ // '/' should not be encoded in context paths
+ URL_ENCODER.addSafeCharacter('/');
+ }
// --------------------------------------------------------- Public Methods
@@ -397,24 +404,26 @@
isDeployed = false;
}
- args = new Object[6];
- args[0] = displayPath;
- args[1] = context.getDisplayName();
- if (args[1] == null) {
- args[1] = " ";
+ args = new Object[7];
+ args[0] = URL_ENCODER.encode(displayPath);
+ args[1] = displayPath;
+ args[2] = context.getDisplayName();
+ if (args[2] == null) {
+ args[2] = " ";
}
- args[2] = new Boolean(context.getAvailable());
- args[3] = response.encodeURL
+ args[3] = new Boolean(context.getAvailable());
+ args[4] = response.encodeURL
(request.getContextPath() +
- "/html/sessions?path=" + displayPath);
+ "/html/sessions?path=" + URL_ENCODER.encode(displayPath));
if (context.getManager() != null) {
- args[4] = new Integer
+ args[5] = new Integer
(context.getManager().getActiveSessions());
} else {
- args[4] = new Integer(0);
+ args[5] = new Integer(0);
}
- args[5] = highlightStyle;
+ args[6] = highlightStyle;
+
writer.print
(MessageFormat.format(APPS_ROW_DETAILS_SECTION, args));
@@ -967,11 +976,11 @@
" </tr>\n";
private static final String APPS_ROW_DETAILS_SECTION =
- "<tr class=\"{5}\">\n" +
- " <td class=\"first\" rowspan=\"2\"><a href=\"{0}\">{0}</a></td>\n" +
- " <td rowspan=\"2\">{1}</td>\n" +
+ "<tr class=\"{6}\">\n" +
+ " <td class=\"first\" rowspan=\"2\"><a href=\"{0}\">{1}</a></td>\n" +
" <td rowspan=\"2\">{2}</td>\n" +
- " <td rowspan=\"2\"><a href=\"{3}\" target=\"_new\">{4}</a></td>\n";
+ " <td rowspan=\"2\">{3}</td>\n" +
+ " <td rowspan=\"2\"><a href=\"{4}\" target=\"_new\">{5}</a></td>\n";
private static final String MANAGER_APP_ROW_BUTTON_SECTION =
" <td>\n" +
15 years, 12 months
JBossWeb SVN: r885 - trunk/java/org/apache/catalina/security.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-29 06:41:03 -0500 (Mon, 29 Dec 2008)
New Revision: 885
Modified:
trunk/java/org/apache/catalina/security/SecurityUtil.java
Log:
- Cache event related methods.
Modified: trunk/java/org/apache/catalina/security/SecurityUtil.java
===================================================================
--- trunk/java/org/apache/catalina/security/SecurityUtil.java 2008-12-29 11:38:59 UTC (rev 884)
+++ trunk/java/org/apache/catalina/security/SecurityUtil.java 2008-12-29 11:41:03 UTC (rev 885)
@@ -52,17 +52,22 @@
private final static int INIT= 0;
private final static int SERVICE = 1;
private final static int DOFILTER = 1;
- private final static int DESTROY = 2;
+ private final static int EVENT = 2;
+ private final static int DOFILTEREVENT = 2;
+ private final static int DESTROY = 3;
private final static String INIT_METHOD = "init";
private final static String DOFILTER_METHOD = "doFilter";
private final static String SERVICE_METHOD = "service";
+ private final static String EVENT_METHOD = "event";
+ private final static String DOFILTEREVENT_METHOD = "doFilterEvent";
private final static String DESTROY_METHOD = "destroy";
/**
* Cache every object for which we are creating method on it.
*/
- private static HashMap objectCache = new HashMap();
+ private static HashMap<Object,Method[]> objectCache =
+ new HashMap<Object,Method[]>();
private static org.jboss.logging.Logger log=
org.jboss.logging.Logger.getLogger( SecurityUtil.class );
@@ -108,7 +113,7 @@
*/
public static void doAsPrivilege(final String methodName,
final Servlet targetObject,
- final Class[] targetType,
+ final Class<?>[] targetType,
final Object[] targetArguments)
throws java.lang.Exception{
@@ -136,7 +141,7 @@
*/
public static void doAsPrivilege(final String methodName,
final Servlet targetObject,
- final Class[] targetType,
+ final Class<?>[] targetType,
final Object[] targetArguments,
Principal principal)
throws java.lang.Exception{
@@ -144,7 +149,7 @@
Method method = null;
Method[] methodsCache = null;
if(objectCache.containsKey(targetObject)){
- methodsCache = (Method[])objectCache.get(targetObject);
+ methodsCache = objectCache.get(targetObject);
method = findMethod(methodsCache, methodName);
if (method == null){
method = createMethodAndCacheIt(methodsCache,
@@ -180,7 +185,7 @@
/**
- * Perform work as a particular </code>Subject</code>. Here the work
+ * Perform work as a particular <code>Subject</code>. Here the work
* will be granted to a <code>null</code> subject.
*
* @param methodName the method to apply the security restriction
@@ -193,7 +198,7 @@
*/
public static void doAsPrivilege(final String methodName,
final Filter targetObject,
- final Class[] targetType,
+ final Class<?>[] targetType,
final Object[] targetArguments)
throws java.lang.Exception{
@@ -217,7 +222,7 @@
*/
public static void doAsPrivilege(final String methodName,
final Filter targetObject,
- final Class[] targetType,
+ final Class<?>[] targetType,
final Object[] targetArguments,
Principal principal)
throws java.lang.Exception{
@@ -225,7 +230,7 @@
Method[] methodsCache = null;
if(objectCache.containsKey(targetObject)){
- methodsCache = (Method[])objectCache.get(targetObject);
+ methodsCache = objectCache.get(targetObject);
method = findMethod(methodsCache, methodName);
if (method == null){
method = createMethodAndCacheIt(methodsCache,
@@ -264,8 +269,9 @@
try{
Subject subject = null;
- PrivilegedExceptionAction pea = new PrivilegedExceptionAction(){
- public Object run() throws Exception{
+ PrivilegedExceptionAction<Void> pea =
+ new PrivilegedExceptionAction<Void>(){
+ public Void run() throws Exception{
method.invoke(targetObject, targetArguments);
return null;
}
@@ -299,9 +305,14 @@
}
Subject.doAsPrivileged(subject, pea, null);
- } catch( PrivilegedActionException pe) {
- Throwable e = ((InvocationTargetException)pe.getException())
+ } catch( PrivilegedActionException pe) {
+ Throwable e;
+ if (pe.getException() instanceof InvocationTargetException) {
+ e = ((InvocationTargetException)pe.getException())
.getTargetException();
+ } else {
+ e = pe;
+ }
if (log.isDebugEnabled()){
log.debug(sm.getString("SecurityUtil.doAsPrivilege"), e);
@@ -341,6 +352,12 @@
} else if (methodName.equalsIgnoreCase(DOFILTER_METHOD)
&& methodsCache[DOFILTER] != null){
return methodsCache[DOFILTER];
+ } else if (methodName.equalsIgnoreCase(EVENT_METHOD)
+ && methodsCache[EVENT] != null){
+ return methodsCache[EVENT];
+ } else if (methodName.equalsIgnoreCase(DOFILTEREVENT_METHOD)
+ && methodsCache[DOFILTEREVENT] != null){
+ return methodsCache[DOFILTEREVENT];
}
return null;
}
@@ -359,11 +376,11 @@
private static Method createMethodAndCacheIt(Method[] methodsCache,
String methodName,
Object targetObject,
- Class[] targetType)
+ Class<?>[] targetType)
throws Exception{
if ( methodsCache == null){
- methodsCache = new Method[3];
+ methodsCache = new Method[4];
}
Method method =
@@ -377,6 +394,10 @@
methodsCache[SERVICE] = method;
} else if (methodName.equalsIgnoreCase(DOFILTER_METHOD)){
methodsCache[DOFILTER] = method;
+ } else if (methodName.equalsIgnoreCase(EVENT_METHOD)){
+ methodsCache[EVENT] = method;
+ } else if (methodName.equalsIgnoreCase(DOFILTEREVENT_METHOD)){
+ methodsCache[DOFILTEREVENT] = method;
}
objectCache.put(targetObject, methodsCache );
15 years, 12 months
JBossWeb SVN: r884 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-29 06:38:59 -0500 (Mon, 29 Dec 2008)
New Revision: 884
Modified:
trunk/java/org/apache/coyote/http11/Http11Processor.java
Log:
- Date format security cleanup.
Modified: trunk/java/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Processor.java 2008-12-23 14:30:48 UTC (rev 883)
+++ trunk/java/org/apache/coyote/http11/Http11Processor.java 2008-12-29 11:38:59 UTC (rev 884)
@@ -21,8 +21,6 @@
import java.io.InterruptedIOException;
import java.net.InetAddress;
import java.net.Socket;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -73,7 +71,7 @@
protected static StringManager sm =
StringManager.getManager(Constants.Package);
-
+
// ------------------------------------------------------------ Constructor
@@ -96,6 +94,9 @@
// Cause loading of HexUtils
int foo = HexUtils.DEC[0];
+ // Cause loading of FastHttpDateFormat
+ FastHttpDateFormat.getCurrentDate();
+
}
@@ -1529,19 +1530,7 @@
}
// Add date header
- String date = null;
- if (org.apache.coyote.Constants.IS_SECURITY_ENABLED){
- date = AccessController.doPrivileged(
- new PrivilegedAction<String>() {
- public String run(){
- return FastHttpDateFormat.getCurrentDate();
- }
- }
- );
- } else {
- date = FastHttpDateFormat.getCurrentDate();
- }
- headers.setValue("Date").setString(date);
+ headers.setValue("Date").setString(FastHttpDateFormat.getCurrentDate());
// FIXME: Add transfer encoding header
15 years, 12 months
JBossWeb SVN: r883 - trunk/webapps/docs/config.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-12-23 09:30:48 -0500 (Tue, 23 Dec 2008)
New Revision: 883
Modified:
trunk/webapps/docs/config/host.xml
Log:
Arrange 249172. Note it was already fixing in TC by Mark Thomas.
Modified: trunk/webapps/docs/config/host.xml
===================================================================
--- trunk/webapps/docs/config/host.xml 2008-12-16 16:36:12 UTC (rev 882)
+++ trunk/webapps/docs/config/host.xml 2008-12-23 14:30:48 UTC (rev 883)
@@ -190,14 +190,8 @@
<p>You can nest one or more <a href="context.html">Context</a> elements
inside this <strong>Host</strong> element, each representing a different web
- application associated with this virtual host. In addition, you can nest a
- single <a href="defaultcontext.html">DefaultContext</a> element that defines
- default values for subsequently deployed web applications.</p>
+ application associated with this virtual host.</p>
- <p>You can optional nest a <a href="defaultcontext.html">DefaultContext</a>
- element inside this <strong>Host</strong> element, to define the default
- characteristics of web applications that are automatically deployed.</p>
-
<p>You can nest at most one instance of the following utility components
by nesting a corresponding element inside your <strong>Host</strong>
element:</p>
16 years
JBossWeb SVN: r882 - trunk.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-16 11:36:12 -0500 (Tue, 16 Dec 2008)
New Revision: 882
Modified:
trunk/PATCHES.txt
trunk/build.properties.default
Log:
- NSIS 2.41.
Modified: trunk/PATCHES.txt
===================================================================
--- trunk/PATCHES.txt 2008-12-16 14:39:26 UTC (rev 881)
+++ trunk/PATCHES.txt 2008-12-16 16:36:12 UTC (rev 882)
@@ -20,7 +20,7 @@
Useless session access time refactoring
719602
-Dynamic change for maxThreads in the bare bones thread pool, which go against its simplicity goal
+Dynamic change for maxThreads in the bare bones thread pool, which goes against its simplicity goal
(an executor should be used instead)
720728
Modified: trunk/build.properties.default
===================================================================
--- trunk/build.properties.default 2008-12-16 14:39:26 UTC (rev 881)
+++ trunk/build.properties.default 2008-12-16 16:36:12 UTC (rev 882)
@@ -59,12 +59,12 @@
commons-collections-src.loc=${base-commons.loc}/collections/source/commons-collections-3.2.1-src.tar.gz
# ----- NSIS, version 2.0 or later -----
-nsis.home=${base.path}/nsis-2.40
+nsis.home=${base.path}/nsis-2.41
nsis.exe=${nsis.home}/makensis.exe
nsis.installoptions.dll=${nsis.home}/Plugins/InstallOptions.dll
nsis.nsexec.dll=${nsis.home}/Plugins/nsExec.dll
nsis.nsisdl.dll=${nsis.home}/Plugins/NSISdl.dll
-nsis.loc=${base-sf.loc}/nsis/nsis-2.40.zip
+nsis.loc=${base-sf.loc}/nsis/nsis-2.41.zip
# ----- JBoss Native, version 2.0 or later -----
jbossnative.home=${base.path}/jboss-native-2.0.6
16 years
JBossWeb SVN: r881 - trunk/java/org/apache/catalina/servlets.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-16 09:39:26 -0500 (Tue, 16 Dec 2008)
New Revision: 881
Modified:
trunk/java/org/apache/catalina/servlets/DefaultServlet.java
Log:
- Filter out request URI, similar to what was done in Jasper.
Modified: trunk/java/org/apache/catalina/servlets/DefaultServlet.java
===================================================================
--- trunk/java/org/apache/catalina/servlets/DefaultServlet.java 2008-12-11 13:57:16 UTC (rev 880)
+++ trunk/java/org/apache/catalina/servlets/DefaultServlet.java 2008-12-16 14:39:26 UTC (rev 881)
@@ -643,9 +643,8 @@
// to be ignored by the resource that is including us.
// Therefore, the only way we can let the including resource
// know is by including warning message in response
- response.getWriter().write(
- sm.getString("defaultServlet.missingResource",
- requestUri));
+ response.getWriter().write(sm.getString("defaultServlet.missingResource",
+ RequestUtil.filter(requestUri)));
}
response.sendError(HttpServletResponse.SC_NOT_FOUND,
16 years
JBossWeb SVN: r880 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/servlets.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2008-12-11 08:57:16 -0500 (Thu, 11 Dec 2008)
New Revision: 880
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/servlets/WebdavServlet.java
Log:
Fix MS IE WebDav issue for [JBPAPP-1493].
Fix error message when there is no request content.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/servlets/WebdavServlet.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/servlets/WebdavServlet.java 2008-12-11 04:51:09 UTC (rev 879)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/servlets/WebdavServlet.java 2008-12-11 13:57:16 UTC (rev 880)
@@ -45,6 +45,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import org.apache.catalina.Globals;
import org.apache.catalina.util.DOMWriter;
import org.apache.catalina.util.MD5Encoder;
import org.apache.catalina.util.RequestUtil;
@@ -320,6 +321,35 @@
/**
+ * Override the DefaultServlet implementation and only use the PathInfo. If
+ * the ServletPath is non-null, it will be because the WebDAV servlet has
+ * been mapped to a url other than /* to configure editing at different url
+ * than normal viewing.
+ *
+ * @param request The servlet request we are processing
+ */
+ protected String getRelativePath(HttpServletRequest request) {
+
+ // Are we being processed by a RequestDispatcher.include()?
+ if (request.getAttribute(Globals.INCLUDE_REQUEST_URI_ATTR) != null) {
+ String result = (String) request.getAttribute(
+ Globals.INCLUDE_PATH_INFO_ATTR);
+ if ((result == null) || (result.equals("")))
+ result = "/";
+ return (result);
+ }
+
+ // No, extract the desired path directly from the request
+ String result = request.getPathInfo();
+ if ((result == null) || (result.equals(""))) {
+ result = "/";
+ }
+ return (result);
+
+ }
+
+
+ /**
* OPTIONS Method.
*
* @param req The request
@@ -389,40 +419,42 @@
}
Node propNode = null;
-
- DocumentBuilder documentBuilder = getDocumentBuilder();
-
- try {
- Document document = documentBuilder.parse
- (new InputSource(req.getInputStream()));
-
- // Get the root element of the document
- Element rootElement = document.getDocumentElement();
- NodeList childList = rootElement.getChildNodes();
-
- for (int i=0; i < childList.getLength(); i++) {
- Node currentNode = childList.item(i);
- switch (currentNode.getNodeType()) {
- case Node.TEXT_NODE:
- break;
- case Node.ELEMENT_NODE:
- if (currentNode.getNodeName().endsWith("prop")) {
- type = FIND_BY_PROPERTY;
- propNode = currentNode;
+
+ if (req.getInputStream().available() > 0) {
+ DocumentBuilder documentBuilder = getDocumentBuilder();
+
+ try {
+ Document document = documentBuilder.parse
+ (new InputSource(req.getInputStream()));
+
+ // Get the root element of the document
+ Element rootElement = document.getDocumentElement();
+ NodeList childList = rootElement.getChildNodes();
+
+ for (int i=0; i < childList.getLength(); i++) {
+ Node currentNode = childList.item(i);
+ switch (currentNode.getNodeType()) {
+ case Node.TEXT_NODE:
+ break;
+ case Node.ELEMENT_NODE:
+ if (currentNode.getNodeName().endsWith("prop")) {
+ type = FIND_BY_PROPERTY;
+ propNode = currentNode;
+ }
+ if (currentNode.getNodeName().endsWith("propname")) {
+ type = FIND_PROPERTY_NAMES;
+ }
+ if (currentNode.getNodeName().endsWith("allprop")) {
+ type = FIND_ALL_PROP;
+ }
+ break;
}
- if (currentNode.getNodeName().endsWith("propname")) {
- type = FIND_PROPERTY_NAMES;
- }
- if (currentNode.getNodeName().endsWith("allprop")) {
- type = FIND_ALL_PROP;
- }
- break;
}
+ } catch (SAXException e) {
+ // Something went wrong - use the defaults.
+ } catch (IOException e) {
+ // Something went wrong - use the defaults.
}
- } catch (SAXException e) {
- // Most likely there was no content : we use the defaults.
- } catch (IOException e) {
- // Most likely there was no content : we use the defaults.
}
if (type == FIND_BY_PROPERTY) {
16 years
JBossWeb SVN: r879 - branches/JBOSSWEB_2_0_0_GA_CP01_JBPAPP-1492/src/share/classes/org/apache/catalina/servlets.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2008-12-10 23:51:09 -0500 (Wed, 10 Dec 2008)
New Revision: 879
Modified:
branches/JBOSSWEB_2_0_0_GA_CP01_JBPAPP-1492/src/share/classes/org/apache/catalina/servlets/WebdavServlet.java
Log:
"Fix MS IE WebDav issue for [JBPAPP-1492]."
Modified: branches/JBOSSWEB_2_0_0_GA_CP01_JBPAPP-1492/src/share/classes/org/apache/catalina/servlets/WebdavServlet.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP01_JBPAPP-1492/src/share/classes/org/apache/catalina/servlets/WebdavServlet.java 2008-12-11 04:23:44 UTC (rev 878)
+++ branches/JBOSSWEB_2_0_0_GA_CP01_JBPAPP-1492/src/share/classes/org/apache/catalina/servlets/WebdavServlet.java 2008-12-11 04:51:09 UTC (rev 879)
@@ -44,6 +44,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import org.apache.catalina.Globals;
import org.apache.catalina.util.DOMWriter;
import org.apache.catalina.util.MD5Encoder;
import org.apache.catalina.util.RequestUtil;
@@ -310,6 +311,35 @@
/**
+ * Override the DefaultServlet implementation and only use the PathInfo. If
+ * the ServletPath is non-null, it will be because the WebDAV servlet has
+ * been mapped to a url other than /* to configure editing at different url
+ * than normal viewing.
+ *
+ * @param request The servlet request we are processing
+ */
+ protected String getRelativePath(HttpServletRequest request) {
+
+ // Are we being processed by a RequestDispatcher.include()?
+ if (request.getAttribute(Globals.INCLUDE_REQUEST_URI_ATTR) != null) {
+ String result = (String) request.getAttribute(
+ Globals.INCLUDE_PATH_INFO_ATTR);
+ if ((result == null) || (result.equals("")))
+ result = "/";
+ return (result);
+ }
+
+ // No, extract the desired path directly from the request
+ String result = request.getPathInfo();
+ if ((result == null) || (result.equals(""))) {
+ result = "/";
+ }
+ return (result);
+
+ }
+
+
+ /**
* OPTIONS Method.
*
* @param req The request
@@ -379,40 +409,42 @@
}
Node propNode = null;
-
- DocumentBuilder documentBuilder = getDocumentBuilder();
-
- try {
- Document document = documentBuilder.parse
- (new InputSource(req.getInputStream()));
-
- // Get the root element of the document
- Element rootElement = document.getDocumentElement();
- NodeList childList = rootElement.getChildNodes();
-
- for (int i=0; i < childList.getLength(); i++) {
- Node currentNode = childList.item(i);
- switch (currentNode.getNodeType()) {
- case Node.TEXT_NODE:
- break;
- case Node.ELEMENT_NODE:
- if (currentNode.getNodeName().endsWith("prop")) {
- type = FIND_BY_PROPERTY;
- propNode = currentNode;
+
+ if (req.getInputStream().available() > 0) {
+ DocumentBuilder documentBuilder = getDocumentBuilder();
+
+ try {
+ Document document = documentBuilder.parse
+ (new InputSource(req.getInputStream()));
+
+ // Get the root element of the document
+ Element rootElement = document.getDocumentElement();
+ NodeList childList = rootElement.getChildNodes();
+
+ for (int i=0; i < childList.getLength(); i++) {
+ Node currentNode = childList.item(i);
+ switch (currentNode.getNodeType()) {
+ case Node.TEXT_NODE:
+ break;
+ case Node.ELEMENT_NODE:
+ if (currentNode.getNodeName().endsWith("prop")) {
+ type = FIND_BY_PROPERTY;
+ propNode = currentNode;
+ }
+ if (currentNode.getNodeName().endsWith("propname")) {
+ type = FIND_PROPERTY_NAMES;
+ }
+ if (currentNode.getNodeName().endsWith("allprop")) {
+ type = FIND_ALL_PROP;
+ }
+ break;
}
- if (currentNode.getNodeName().endsWith("propname")) {
- type = FIND_PROPERTY_NAMES;
- }
- if (currentNode.getNodeName().endsWith("allprop")) {
- type = FIND_ALL_PROP;
- }
- break;
}
+ } catch (SAXException e) {
+ // Something went wrong - use the defaults.
+ } catch (IOException e) {
+ // Something went wrong - use the defaults.
}
- } catch (SAXException e) {
- // Most likely there was no content : we use the defaults.
- } catch (IOException e) {
- // Most likely there was no content : we use the defaults.
}
if (type == FIND_BY_PROPERTY) {
16 years