You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xang-cvs@xml.apache.org by md...@locus.apache.org on 2000/09/13 20:42:40 UTC
cvs commit: xml-xang/java/src/org/apache/xang/util ServletUtil.java
mdierken 00/09/13 11:42:36
Modified: java/src/org/apache/xang/util ServletUtil.java
Log:
Fix getRealPath() to look for lastIndexOf the '.' character.
Revision Changes Path
1.3 +4 -2 xml-xang/java/src/org/apache/xang/util/ServletUtil.java
Index: ServletUtil.java
===================================================================
RCS file: /home/cvs/xml-xang/java/src/org/apache/xang/util/ServletUtil.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ServletUtil.java 2000/08/15 15:11:02 1.2
+++ ServletUtil.java 2000/09/13 18:42:35 1.3
@@ -15,17 +15,19 @@
String realPath=null;
path = context.getRequest().getServletPath();
-
+
// detect odd Servlet API behavior
if (null == context.getServletContext().getRealPath(path))
{
int pos;
+
// We'll have to parse stuff out.
path = context.getRequest().getPathInfo();
path = context.getRequest().getRealPath(path);
+
if (path != null)
{
- pos = path.indexOf(".");
+ pos = path.lastIndexOf(".");
if (pos >= 0)
{
while (pos < path.length() &&