jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r732746 - in /jackrabbit/branches/1.5: ./ jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/ jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/ jackrabbit-webapp/src/main/webapp/ jackrabbit-webapp/src/main/webapp...
Date Thu, 08 Jan 2009 16:21:09 GMT
Author: jukka
Date: Thu Jan  8 08:21:08 2009
New Revision: 732746

URL: http://svn.apache.org/viewvc?rev=732746&view=rev
Log:
1.5: Merged revisions 732703, 732715, 732716 and 732719 (JCR-1926, JCR-1925 and JCR-1929). Ignored other revisions.

Modified:
    jackrabbit/branches/1.5/   (props changed)
    jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Text.java
    jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/TextTest.java
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/error.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/exists.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/missing.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/notexists.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/reconfigure.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/running.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/success.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/error/repository.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/header.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/local.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/populate.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/remote.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/search.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/swr.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/troubleshooting.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/webdav-jcr.jsp
    jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/webdav-simple.jsp

Propchange: jackrabbit/branches/1.5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan  8 08:21:08 2009
@@ -1,2 +1,2 @@
 /jackrabbit/branches/1.3:631261
-/jackrabbit/trunk:703899-704158,704165,704167,704324,704358,704361,704864,704933,704939,705010,705033,705243,705496,705522,705579,705925,705932,705934,705937-705938,705961,706242,706273,706285-706286,706562,706606,706649,706655,706660,706697,706918,707303-707304,707307,707310,707630,708206,708598,708609,708613,708619,708634,708840,708863,708909,708929,708943,709115,709142,709207,709211,710047,711238,711566-711567,711595,711841-711843,712984-712985,713037,713059,713065,713072,713076,713162,713214,713956,713958,713964,713971,713975,714034,718218,718249-718250,718371,718376,718566,718632,718981,719225,719282,719575-719577,719579,719585-719586,719588,719592,720455,720484,720492,720524,720533,720540,720673,720679,720687,720784,720940,720969,721186,721191,721194,721235,721387-721389,721470,721495,722068-722069,722463,722465,722467,722470,722825,723281,723346,723728,723784,724300,724387,725292,727376,727388,727390,727395,727397,727402,727492,727701,728022,731896,731934,731941,73234
 7
+/jackrabbit/trunk:703899-704158,704165,704167,704324,704358,704361,704864,704933,704939,705010,705033,705243,705496,705522,705579,705925,705932,705934,705937-705938,705961,706242,706273,706285-706286,706562,706606,706649,706655,706660,706697,706918,707303-707304,707307,707310,707630,708206,708598,708609,708613,708619,708634,708840,708863,708909,708929,708943,709115,709142,709207,709211,710047,711238,711566-711567,711595,711841-711843,712984-712985,713037,713059,713065,713072,713076,713162,713214,713956,713958,713964,713971,713975,714034,718218,718249-718250,718371,718376,718566,718632,718981,719225,719282,719575-719577,719579,719585-719586,719588,719592,720455,720484,720492,720524,720533,720540,720673,720679,720687,720784,720940,720969,721186,721191,721194,721235,721387-721389,721470,721495,722068-722069,722463,722465,722467,722470,722825,723281,723346,723728,723784,724300,724387,725292,727376,727388,727390,727395,727397,727402,727492,727701,728022,731896,731934,731941,73234
 7,732678,732686,732689,732693,732703,732715-732716,732719

Modified: jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Text.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Text.java?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Text.java (original)
+++ jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Text.java Thu Jan  8 08:21:08 2009
@@ -402,15 +402,19 @@
         ByteArrayOutputStream out = new ByteArrayOutputStream(string.length());
         for (int i = 0; i < string.length(); i++) {
             char c = string.charAt(i);
-            if (c == escape) {
+            if (c != escape) {
+                out.write(c);
+            } else if (i + 2 < string.length()) {
                 try {
                     out.write(Integer.parseInt(string.substring(i + 1, i + 3), 16));
                 } catch (NumberFormatException e) {
-                    throw new IllegalArgumentException();
+                    throw new IllegalArgumentException(
+                            "Escape sequence is not hexadecimal: " + string);
                 }
                 i += 2;
             } else {
-                out.write(c);
+                throw new IllegalArgumentException(
+                        "Escape sequence is too short: " + string);
             }
         }
 

Modified: jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/TextTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/TextTest.java?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/TextTest.java (original)
+++ jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/TextTest.java Thu Jan  8 08:21:08 2009
@@ -143,4 +143,23 @@
             assertEquals(strs[1], Text.getName(strs[0], '='));
         }
     }
+
+    /**
+     * @see <a href="https://issues.apache.org/jira/browse/JCR-1926">JCR-1926</a>
+     */
+    public void testUnescapeWithInvalidInput() {
+        assertInvalidUnescape("%");   // too short
+        assertInvalidUnescape("%%");  // too short
+        assertInvalidUnescape("%%%"); // not a number
+    }
+
+    private void assertInvalidUnescape(String string) {
+        try {
+            Text.unescape(string);
+        } catch (IllegalArgumentException expected) {
+        } catch (RuntimeException unexpected) {
+            fail("Text.unescape(" + string + "): " + unexpected.getMessage());
+        }
+    }
+
 }

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/error.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/error.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/error.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/error.jsp Thu Jan  8 08:21:08 2009
@@ -13,11 +13,11 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "Content Repository Error");
 %><jsp:include page="../header.jsp"/>
 <p>
   Some error occurred during setup. See the log files for details.
 </p>
-<p><a href="<%= request.getContextPath() %>/admin">back</a></p>
+<p><a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/admin">back</a></p>
 <jsp:include page="../footer.jsp"/>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/exists.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/exists.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/exists.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/exists.jsp Thu Jan  8 08:21:08 2009
@@ -13,7 +13,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "Content Repository Exists");
 %><jsp:include page="../header.jsp"/>
 <p>The repository home directory or configuration already exists.</p>
@@ -24,5 +24,5 @@
 <p>
 Please specify a correct location or choose to reuse an existing repository.
 </p>
-<p><a href="<%= request.getContextPath() %>/admin">back</a></p>
+<p><a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/admin">back</a></p>
 <jsp:include page="../footer.jsp"/>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/missing.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/missing.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/missing.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/missing.jsp Thu Jan  8 08:21:08 2009
@@ -13,7 +13,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "Content Repository Setup");
 %><jsp:include page="../header.jsp"/>
 <p>
@@ -27,7 +27,7 @@
 </p>
 
 <h3>Create a new content repository</h3>
-<form action="<%= request.getContextPath() %>/admin" method="POST">
+<form action="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/admin" method="POST">
   <input type="hidden" name="mode" value="new"/>
   <p>
     Use this form to create a new content repository in the given directory.
@@ -44,7 +44,7 @@
 </form>
 
 <h3>Use an existing content repository</h3>
-<form action="<%= request.getContextPath() %>/admin" method="POST">
+<form action="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/admin" method="POST">
   <input type="hidden" name="mode" value="existing"/>
   <p>
     Use this form to access an existing content repository in the given

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/notexists.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/notexists.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/notexists.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/notexists.jsp Thu Jan  8 08:21:08 2009
@@ -13,7 +13,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "Content Repository Not Found");
 %><jsp:include page="../header.jsp"/>
 <p>The repository home directory or configuration do not exists.</p>
@@ -24,5 +24,5 @@
 <p>
 Please specify a correct location or choose to create a new repository.
 </p>
-<p><a href="<%= request.getContextPath() %>/admin">back</a></p>
+<p><a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/admin">back</a></p>
 <jsp:include page="../footer.jsp"/>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/reconfigure.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/reconfigure.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/reconfigure.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/reconfigure.jsp Thu Jan  8 08:21:08 2009
@@ -13,7 +13,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "Content Repository Already Running");
 %><jsp:include page="../header.jsp"/>
 <p>Your repository is already properly configured an running.</p>
@@ -21,5 +21,5 @@
 Your changes were discarded. To reconfigure or reinstall the repository modify
 the respective configuration files or remove them.
 </p>
-<p><a href="<%= request.getContextPath() %>/">home</a></p>
+<p><a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/">home</a></p>
 <jsp:include page="../footer.jsp"/>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/running.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/running.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/running.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/running.jsp Thu Jan  8 08:21:08 2009
@@ -13,7 +13,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "Content Repository Ready");
 %><jsp:include page="../header.jsp"/>
 <p>Your repository is properly configured an running.</p>
@@ -21,5 +21,5 @@
 To reconfigure or reinstall the repository modify the respective configuration
 files or remove them.
 </p>
-<p><a href="<%= request.getContextPath() %>/">home</a></p>
+<p><a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/">home</a></p>
 <jsp:include page="../footer.jsp"/>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/success.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/success.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/success.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/bootstrap/success.jsp Thu Jan  8 08:21:08 2009
@@ -13,7 +13,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "Content Repository Ready");
 %><jsp:include page="../header.jsp"/>
 <p>Your repository is now properly configured an running.</p>
@@ -21,5 +21,5 @@
 To reconfigure or reinstall the repository modify the respective configuration
 files or remove them.
 <p>
-<p><a href="<%= request.getContextPath() %>/">home</a></p>
+<p><a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/">home</a></p>
 <jsp:include page="../footer.jsp"/>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/error/repository.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/error/repository.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/error/repository.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/error/repository.jsp Thu Jan  8 08:21:08 2009
@@ -13,17 +13,20 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%@ page isErrorPage="true" %><%
+--%><%@ page isErrorPage="true"
+             import="org.apache.jackrabbit.util.Text,
+                     java.io.StringWriter,
+                     java.io.PrintWriter"%><%
 request.setAttribute("title", "Repository Error");
 %><jsp:include page="../header.jsp"/>
 <p>
   The content repository operation failed with the following
   <%= exception.getClass().getSimpleName() %> error:
 </p>
-<blockquote><%= exception.getMessage() %></blockquote>
+<blockquote><%= Text.encodeIllegalXMLCharacters(exception.getMessage()) %></blockquote>
 <p>
   See the
-  <a href="<%= request.getContextPath() %>/troubleshooting.jsp">troubleshooting page</a>
+  <a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/troubleshooting.jsp">troubleshooting page</a>
   for ideas on how to resolve this issue.
 </p>
 
@@ -31,5 +34,9 @@
 <p>
   Below is the full exception stack trace associated with this error:
 </p>
-<pre><% exception.printStackTrace(new java.io.PrintWriter(out)); %></pre>
+<%
+StringWriter buffer = new StringWriter();
+exception.printStackTrace(new PrintWriter(buffer));
+%>
+<pre><%= Text.encodeIllegalXMLCharacters(buffer.toString()) %></pre>
 <jsp:include page="../footer.jsp"/>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/header.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/header.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/header.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/header.jsp Thu Jan  8 08:21:08 2009
@@ -14,30 +14,37 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 --%>
+<%@page import="org.apache.jackrabbit.util.Text"%>
+<%
+String title =
+    Text.encodeIllegalXMLCharacters(request.getAttribute("title").toString());
+String context =
+    Text.encodeIllegalXMLCharacters(request.getContextPath());
+%>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
           "http://www.w3.org/TR/html4/loose.dtd">
 <html>
   <head>
-    <title><%= request.getAttribute("title") %></title>
+    <title><%= title %></title>
     <link rel="stylesheet"
-          href="<%= request.getContextPath() %>/css/default.css"
+          href="<%= context %>/css/default.css"
           type="text/css"/>
     <link rel="shortcut icon"
-          href="<%= request.getContextPath() %>/images/favicon.ico"
+          href="<%= context %>/images/favicon.ico"
           type="image/vnd.microsoft.icon" />
   </head>
   <body>
     <div id="page">
       <div id="banner">
         <p id="jcr">
-          <a href="<%= request.getContextPath() %>/">
-            <img src="<%= request.getContextPath() %>/images/jlogo.gif"
+          <a href="<%= context %>/">
+            <img src="<%= context %>/images/jlogo.gif"
                  alt="Apache Jackrabbit" height="100" width="336"/>
           </a>
         </p>
         <p id="asf">
           <a href="http://www.apache.org/">
-            <img src="<%= request.getContextPath() %>/images/asf-logo.gif"
+            <img src="<%= context %>/images/asf-logo.gif"
                  alt="Apache Software Foundation" height="100" width="387"/>
           </a>
         </p>
@@ -46,26 +53,26 @@
         <ul>
           <li>Jackrabbit JCR Server
             <ul>
-              <li><a href="<%= request.getContextPath() %>/">Welcome</a></li>
-              <li><a href="<%= request.getContextPath() %>/webdav-simple.jsp">Standard WebDAV</a></li>
-              <li><a href="<%= request.getContextPath() %>/webdav-jcr.jsp">JCR WebDAV</a></li>
-              <li><a href="<%= request.getContextPath() %>/remote.jsp">Remote access</a></li>
-              <li><a href="<%= request.getContextPath() %>/local.jsp">Local access</a></li>
-              <li><a href="<%= request.getContextPath() %>/troubleshooting.jsp">Troubleshooting</a></li>
-              <li><a href="<%= request.getContextPath() %>/about.jsp">About Jackrabbit</a></li>
+              <li><a href="<%= context %>/">Welcome</a></li>
+              <li><a href="<%= context %>/webdav-simple.jsp">Standard WebDAV</a></li>
+              <li><a href="<%= context %>/webdav-jcr.jsp">JCR WebDAV</a></li>
+              <li><a href="<%= context %>/remote.jsp">Remote access</a></li>
+              <li><a href="<%= context %>/local.jsp">Local access</a></li>
+              <li><a href="<%= context %>/troubleshooting.jsp">Troubleshooting</a></li>
+              <li><a href="<%= context %>/about.jsp">About Jackrabbit</a></li>
             </ul>
           </li>
           <li>Default workspace
             <ul>
-              <li><a href="<%= request.getContextPath() %>/repository/default/">Browse</a></li>
-              <li><a href="<%= request.getContextPath() %>/search.jsp">Search</a></li>
-              <li><a href="<%= request.getContextPath() %>/populate.jsp">Populate</a></li>
+              <li><a href="<%= context %>/repository/default/">Browse</a></li>
+              <li><a href="<%= context %>/search.jsp">Search</a></li>
+              <li><a href="<%= context %>/populate.jsp">Populate</a></li>
             </ul>
           </li>
           <li>Apache Jackrabbit
             <ul>
               <li><a href="http://jackrabbit.apache.org/">Apache Jackrabbit</a></li>
-              <li><a href="http://jackrabbit.apache.org/api/1.4/">Jackrabbit API</a></li>
+              <li><a href="http://jackrabbit.apache.org/api/1.5/">Jackrabbit API</a></li>
               <li><a href="http://wiki.apache.org/jackrabbit/FrontPage">Jackrabbit Wiki</a></li>
             </ul>
           </li>
@@ -79,4 +86,4 @@
         </ul>
       </div>
       <div id="content">
-        <h2><%= request.getAttribute("title") %></h2>
+        <h2><%= title %></h2>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/local.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/local.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/local.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/local.jsp Thu Jan  8 08:21:08 2009
@@ -13,7 +13,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "Local Repository Access");
 %><jsp:include page="header.jsp"/>
 <p>
@@ -73,7 +73,7 @@
 
 ServletContext context = ...; // <em>context of your servlet</em>
 ServletContext jackrabbit =
-    context.getContext("<em><%= request.getContextPath() %></em>");
+    context.getContext("<em><%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %></em>");
 Repository repository = (Repository)
     context.getAttribute(Repository.<b>class</b>.getName()).
 </pre>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/populate.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/populate.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/populate.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/populate.jsp Thu Jan  8 08:21:08 2009
@@ -16,6 +16,7 @@
 --%><%@ page import="javax.jcr.Repository,
                  javax.jcr.Session,
                  org.apache.jackrabbit.j2ee.RepositoryAccessServlet,
+                 org.apache.jackrabbit.util.Text,
                  javax.jcr.SimpleCredentials,
                    java.util.Iterator,
                    java.net.URL,
@@ -51,7 +52,7 @@
         jcrSession = rep.login(new SimpleCredentials("user", "".toCharArray()));
         wspName = jcrSession.getWorkspace().getName();
     } catch (Throwable e) {
-        %>Error while accessing the repository: <font color="red"><%= e.getMessage() %></font><br><%
+        %>Error while accessing the repository: <font color="red"><%= Text.encodeIllegalXMLCharacters(e.getMessage()) %></font><br><%
         %>Check the configuration or use the <a href="admin/">easy setup</a> wizard.<%
         return;
     }
@@ -79,10 +80,10 @@
 if (seedWord != null && numDocs > 0 && filetypes.size() > 0) { %>
 <html>
 <head>
-<title>Welcome to Apache Jackrabbit - Populate workspace: <%= wspName %></title>
-<link rel="shortcut icon" href="<%= request.getContextPath() %>/images/favicon.ico" type="image/vnd.microsoft.icon">
+<title>Welcome to Apache Jackrabbit - Populate workspace: <%= Text.encodeIllegalXMLCharacters(wspName) %></title>
+<link rel="shortcut icon" href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/images/favicon.ico" type="image/vnd.microsoft.icon">
 <style type="text/css" media="all">
-      @import url("<%= request.getContextPath() %>/css/default.css");
+      @import url("<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/css/default.css");
 </style>
 <script><!--
 function draw() {
@@ -90,13 +91,13 @@
         document.write('<table cellspacing="0" cellpadding="0" style="border-color:' + this.borderColor + '; border-width:' + this.borderWidth + '; border-style:' + this.borderStyle + '">');
         document.write('<tr><td>');
         document.write('<table border="0" cellspacing="0" cellpadding="0" style="">');
-        document.write('<tr><td style="background-color:' + this.barColor +'"><img src="<%= request.getContextPath() %>/images/0.gif" id="' + this.id + 'barFG" width="0" height="' + this.height + '"/></td>');
-        document.write('<td><img src="<%= request.getContextPath() %>/images/0.gif" id="' + this.id + 'barBG" width="' + this.width + '" height="' + this.height + '"/></td></tr>');
+        document.write('<tr><td style="background-color:' + this.barColor +'"><img src="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/images/0.gif" id="' + this.id + 'barFG" width="0" height="' + this.height + '"/></td>');
+        document.write('<td><img src="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/images/0.gif" id="' + this.id + 'barBG" width="' + this.width + '" height="' + this.height + '"/></td></tr>');
         document.write('</table>');
         document.write('</tr></td>');
         document.write('</table>');
         document.write('<table>');
-        document.write('<tr><td><img src="<%= request.getContextPath() %>/images/0.gif" width="' + this.width + '" height="0"/></td></tr>');
+        document.write('<tr><td><img src="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/images/0.gif" width="' + this.width + '" height="0"/></td></tr>');
         document.write('<tr><td align="center"><span id="' + this.id + 'barValue">0%</span></td></tr>');
         document.write('<tr><td align="center"><span id="' + this.id + 'barInfo">&nbsp;</span></td></tr>');
         document.write('</table>');
@@ -139,7 +140,7 @@
 </head>
   <body>
   <div style="background: white; border: 1px solid black; padding: 50px; width: 510px; margin: 50px auto;">
-  <h2>Populate workspace: "<%= wspName %>"</h2><br>
+  <h2>Populate workspace: "<%= Text.encodeIllegalXMLCharacters(wspName) %>"</h2><br>
     <p>Overall progress</p>
     <script>var pb = new ProgressBar(<%= numDocs %>, 500, 30);pb.draw();</script>
     
@@ -194,7 +195,7 @@
                                         InputStream in = con.getInputStream();
                                         try {
                                             synchronized (fOut) {
-                                                fOut.println("<script>dp.inform(0, '" + info + "')</script>");
+                                                fOut.println("<script>dp.inform(0, '" + Text.encodeIllegalXMLCharacters(info) + "')</script>");
                                                 fOut.flush();
                                             }
                                             int length = con.getContentLength();
@@ -266,7 +267,7 @@
 </p>
     <form method="POST">
       <table>
-      <tr><td>Seed word:</td><td><input name="seed" type="text" size="30" value="<%= seedWord == null ? "download" : seedWord %>"/></td></tr>
+      <tr><td>Seed word:</td><td><input name="seed" type="text" size="30" value="<%= seedWord == null ? "download" : Text.encodeIllegalXMLCharacters(seedWord) %>"/></td></tr>
       <tr><td>Number of documents:</td><td><input name="num" type="text" size="30" value="<%= numDocs == 0 ? 100 : numDocs %>"/></td></tr>
       <tr valign="top"><td>Document types:</td><td><input name="filetype" type="checkbox" value="pdf" <%= filetypes.contains("pdf") ? "checked" : "" %>/> Adobe Acrobat PDF<br/><input name="filetype" type="checkbox" value="rtf" <%= filetypes.contains("rtf") ? "checked" : "" %>/> Rich Text Format<br/><input name="filetype" type="checkbox" value="doc" <%= filetypes.contains("doc") ? "checked" : "" %>/> Microsoft Word<br/><input name="filetype" type="checkbox" value="ppt" <%= filetypes.contains("ppt") ? "checked" : "" %>/> Microsoft PowerPoint<br/><input name="filetype" type="checkbox" value="xls" <%= filetypes.contains("xls") ? "checked" : "" %>/> Microsoft Excel<br/></td></tr>
       <tr><td>&nbsp;</td><td><input type="submit" value="Populate!"/></td></tr>
@@ -399,7 +400,7 @@
                         double s = 1000d * (double) read / (double) length;
                         out.println("<script>" + varName + ".inform(" +
                                 Math.min((int) Math.ceil(s), 1000) +
-                                ", '" + fileName + "')</script>");
+                                ", '" + Text.encodeIllegalXMLCharacters(fileName) + "')</script>");
                         out.flush();
                     }
                     nextReport += (16 * 1024);

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/remote.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/remote.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/remote.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/remote.jsp Thu Jan  8 08:21:08 2009
@@ -13,13 +13,14 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "Remote Repository Access");
 
 URI uri = new URI(request.getRequestURL().toString());
 String base =
     uri.getScheme() + "://" + uri.getHost() + ":" + uri.getPort()
     + request.getContextPath();
+base = Text.encodeIllegalXMLCharacters(base);
 %><jsp:include page="header.jsp"/>
 <p>
   The content repository within this web application is made available

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/search.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/search.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/search.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/search.jsp Thu Jan  8 08:21:08 2009
@@ -15,6 +15,7 @@
   limitations under the License.
 --%><%@ page import="javax.jcr.Repository,
                    org.apache.jackrabbit.j2ee.RepositoryAccessServlet,
+                   org.apache.jackrabbit.util.Text,
                    javax.jcr.Session,
                    javax.jcr.SimpleCredentials,
                    java.util.Calendar,
@@ -40,7 +41,7 @@
         rep = RepositoryAccessServlet.getRepository(pageContext.getServletContext());
         jcrSession = rep.login(new SimpleCredentials("anonymous", "".toCharArray()));
     } catch (Throwable e) {
-        %>Error while accessing the repository: <font color="red"><%= e.getMessage() %></font><br><%
+        %>Error while accessing the repository: <font color="red"><%= Text.encodeIllegalXMLCharacters(e.getMessage()) %></font><br><%
         %>Check the configuration or use the <a href="admin/">easy setup</a> wizard.<%
         return;
     }
@@ -72,9 +73,9 @@
             if (q.startsWith("related:")) {
                 String path = q.substring("related:".length());
                 stmt = "//element(*, nt:file)[rep:similar(jcr:content, '" + path + "/jcr:content')]/rep:excerpt(.)";
-                queryTerms = "similar to <b>" + path + "</b>";
+                queryTerms = "similar to <b>" + Text.encodeIllegalXMLCharacters(path) + "</b>";
             } else {
-                queryTerms = "for <b>" + q + "</b>";
+                queryTerms = "for <b>" + Text.encodeIllegalXMLCharacters(q) + "</b>";
                 q = q.replaceAll("'", "''");
                 stmt = "//element(*, nt:file)[jcr:contains(jcr:content, '" + q + "')]/rep:excerpt(.)";
             }
@@ -131,30 +132,41 @@
 
 <form name="gs" method="GET">
   <p>
-    <input type="text" name="q" size="41" maxlength="2048" value="<%= q %>" title="Search">
+    <input type="text" name="q" size="41" maxlength="2048" value="<%= Text.encodeIllegalXMLCharacters(q) %>" title="Search">
     <input type=submit value="Search"><br><br>
   </p>
 </form>
 <% if (rows != null && rows.getSize() == 0) { %>
-  <%
-      if (suggestedQuery != null) {
-        %><p><font class="p" color="#cc0000">Did you mean: </font><a href="search.jsp?q=<%= suggestedQuery %>" class="p"><b><i><%= suggestedQuery %></i></b></a>&nbsp;&nbsp;<br></p><%
-      }
-  %>
-  <p/>Your search - <b><%= q %></b> - did not match any documents.
+<%     if (suggestedQuery != null) { %>
+<p><font class="p" color="#cc0000">Did you mean:</font>
+  <a href="search.jsp?q=<%= Text.encodeIllegalXMLCharacters(suggestedQuery) %>" class="p">
+    <b><i><%= Text.encodeIllegalXMLCharacters(suggestedQuery) %></i></b>
+  </a><br>
+</p>
+<%     } %>
+  <p/>Your search - <b><%= Text.encodeIllegalXMLCharacters(q) %></b> - did not match any documents.
   <br/><br/>Suggestions:
-  <ul><li>Make sure all words are spelled correctly.</li><li>Try different keywords.</li><li>Try more general keywords.</li><li>Try fewer keywords.</li></ul>
+  <ul>
+    <li>Make sure all words are spelled correctly.</li>
+    <li>Try different keywords.</li>
+    <li>Try more general keywords.</li>
+    <li>Try fewer keywords.</li>
+  </ul>
   <%
     } else if (rows != null) {
   %>
   <table border=0 cellpadding=0 cellspacing=0 width=100% class="t bt">
-    <tr><td><font size=-1>Results <b><%= from + 1 %></b> - <b><%= to %></b> of about <b><%= totalResults %></b> <%= queryTerms %>. (<b><%= executedIn %></b> seconds)&nbsp;</font></td></tr>
+    <tr>
+      <td><font size=-1>Results <b><%= from + 1 %></b> - <b><%= to %></b> of about <b><%= totalResults %></b> <%= queryTerms %>. (<b><%= executedIn %></b> seconds)&nbsp;</font></td></tr>
   </table>
-  <%
-      if (suggestedQuery != null) {
-        %><p><font class="p" color="#cc0000">Did you mean: </font><a href="search.jsp?q=<%= suggestedQuery %>" class="p"><b><i><%= suggestedQuery %></i></b></a>&nbsp;&nbsp;<br></p><%
-      }
-  %>
+<% if (suggestedQuery != null) { %>
+  <p>
+    <font class="p" color="#cc0000">Did you mean:</font>
+    <a href="search.jsp?q=<%= Text.encodeIllegalXMLCharacters(suggestedQuery) %>" class="p">
+      <b><i><%= Text.encodeIllegalXMLCharacters(suggestedQuery) %></i></b>
+    </a><br>
+  </p>
+<% } %>
   <div>
     <%
       while (rows.hasNext() && rows.getPosition() < to) {
@@ -169,10 +181,10 @@
           DateFormat df = SimpleDateFormat.getDateInstance(SimpleDateFormat.LONG);
           String lastModified = df.format(resource.getProperty("jcr:lastModified").getDate().getTime());
     %>
-    <h6><a href="<%= request.getContextPath() %>/repository/<%= wspName %><%= file.getPath() %>" class=l><%= file.getName() %></a></h6>
+    <h6><a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath() + "/repository/" + wspName + file.getPath()) %>" class=l><%= Text.encodeIllegalXMLCharacters(file.getName()) %></a></h6>
       <table border=0 cellpadding=0 cellspacing=0>
         <tr><td><font><%= r.getValue("rep:excerpt(jcr:content)").getString() %>
-          <%= file.getPath() %> - <%= size %> - <%= lastModified %> - <nobr><a href="<%= request.getContextPath() %>/search.jsp?q=related:<%= URLEncoder.encode(file.getPath(), "UTF-8") %>">Similar pages</a></nobr></font></td>
+          <%= Text.encodeIllegalXMLCharacters(file.getPath()) %> - <%= size %> - <%= lastModified %> - <nobr><a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/search.jsp?q=related:<%= Text.encodeIllegalXMLCharacters(URLEncoder.encode(file.getPath(), "UTF-8")) %>">Similar pages</a></nobr></font></td>
         </tr>
       </table>
     <%
@@ -190,7 +202,7 @@
         <td><font size=-1>Result&nbsp;Page:&nbsp;
         <%
         if (currentPageIndex != ((Long) indexes.get(0)).longValue()) {
-            %><td nowrap align=right><a href=search.jsp?q=<%= q %>&start=<%= (currentPageIndex - 1) * 10 %>>Previous</a><%
+            %><td nowrap align=right><a href=search.jsp?q=<%= Text.encodeIllegalXMLCharacters(q) %>&start=<%= (currentPageIndex - 1) * 10 %>>Previous</a><%
         } else {
             %><td nowrap ><font size=-1><%
         }
@@ -199,11 +211,11 @@
             if (pageIdx == currentPageIndex) {
                 %><td nowrap><font size=-1><%= pageIdx + 1 %><%
             } else {
-                %><td nowrap><font size=-1><a href=search.jsp?q=<%= q %>&start=<%= pageIdx * 10 %>><%= pageIdx + 1 %></a><%
+                %><td nowrap><font size=-1><a href=search.jsp?q=<%= Text.encodeIllegalXMLCharacters(q) %>&start=<%= pageIdx * 10 %>><%= pageIdx + 1 %></a><%
             }
         }
         if (currentPageIndex < (maxPage - 1)) {
-            %><td nowrap><font size=-1><a href=search.jsp?q=<%= q %>&start=<%= (currentPageIndex + 1) * 10 %>>Next</a><%
+            %><td nowrap><font size=-1><a href=search.jsp?q=<%= Text.encodeIllegalXMLCharacters(q) %>&start=<%= (currentPageIndex + 1) * 10 %>>Next</a><%
         } else {
             %><td nowrap ><%
         }
@@ -217,11 +229,11 @@
 
     <br clear=all><br>
     <table>
-      <tr><td><br><form method=GET action=<%= request.getContextPath() %>/search.jsp>
-          <font size=-1><input type=text name=q size=31 maxlength=2048 value="<%= q %>" title="Search"> <input type=submit value="Search">
+      <tr><td><br><form method=GET action=<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/search.jsp>
+          <font size=-1><input type=text name=q size=31 maxlength=2048 value="<%= Text.encodeIllegalXMLCharacters(q) %>" title="Search"> <input type=submit value="Search">
           </font></form>
         <br><font size=-1>
-        <a href="<%= request.getContextPath() %>/swr.jsp?q=<%= q %>&swrnum=<%= rows.getSize() %>">Search&nbsp;within&nbsp;results</a> | <a href="http://issues.apache.org/jira/browse/JCR" target=_blank>Dissatisfied? Help us improve</a></font><br>
+        <a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/swr.jsp?q=<%= Text.encodeIllegalXMLCharacters(q) %>&swrnum=<%= rows.getSize() %>">Search&nbsp;within&nbsp;results</a> | <a href="http://issues.apache.org/jira/browse/JCR" target=_blank>Dissatisfied? Help us improve</a></font><br>
         <br>
       </td></tr>
     </table>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/swr.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/swr.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/swr.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/swr.jsp Thu Jan  8 08:21:08 2009
@@ -16,6 +16,7 @@
 --%><%@ page import="javax.jcr.Repository,
                  javax.jcr.Session,
                  org.apache.jackrabbit.j2ee.RepositoryAccessServlet,
+                 org.apache.jackrabbit.util.Text,
                  javax.jcr.SimpleCredentials,
                    java.util.Calendar,
                    java.text.NumberFormat"
@@ -26,7 +27,7 @@
         rep = RepositoryAccessServlet.getRepository(pageContext.getServletContext());
         jcrSession = rep.login(new SimpleCredentials("anonymous", "".toCharArray()));
     } catch (Throwable e) {
-        %>Error while accessing the repository: <font color="red"><%= e.getMessage() %></font><br><%
+        %>Error while accessing the repository: <font color="red"><%= Text.encodeIllegalXMLCharacters(e.getMessage()) %></font><br><%
         %>Check the configuration or use the <a href="admin/">easy setup</a> wizard.<%
         return;
     }
@@ -47,12 +48,12 @@
         %><jsp:include page="header.jsp"/>
     <form name=f action="search.jsp">
       <table border=0 cellpadding=0 cellspacing=0 width=100%>
-        <tr><table border=0 width=100%><tr><td><br>There were about <b><%= numResults %></b> results for <b><%= q %></b>.<br>
+        <tr><table border=0 width=100%><tr><td><br>There were about <b><%= numResults %></b> results for <b><%= Text.encodeIllegalXMLCharacters(q) %></b>.<br>
         Use the search box below to search within these results.<br><br></td></tr></table>
         </td></tr>
         <tr><td valign=middle>
         <table border=0 width=100%><tr><td>
-        <INPUT type=hidden name=q value="<%= q %>">
+        <INPUT type=hidden name=q value="<%= Text.encodeIllegalXMLCharacters(q) %>">
         <INPUT type=text name=as_q size=31 maxlength=256 value="">
         <INPUT type=submit VALUE="Search&nbsp;within&nbsp;results">
         </td></tr></table>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/troubleshooting.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/troubleshooting.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/troubleshooting.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/troubleshooting.jsp Thu Jan  8 08:21:08 2009
@@ -13,7 +13,9 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text,
+                    java.io.StringWriter,
+                    java.io.PrintWriter"%><%
 request.setAttribute("title", "Troubleshooting");
 %><jsp:include page="header.jsp"/>
 <p>
@@ -29,7 +31,7 @@
   </li>
   <li>
     Is the repository up and running? Try browsing the
-    <a href="<%= request.getContextPath() %>/repository/default/">default workspace</a>
+    <a href="<%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %>/repository/default/">default workspace</a>
     to check if you can still see any content in the repository. You will
     see an error message if the repository is not available.
   </li>
@@ -87,7 +89,7 @@
 <h2>Environment information</h2>
 <p>
   This instance of the Jackrabbit JCR Server is running in
-  a <em><%= application.getServerInfo() %></em> servlet container
+  a <em><%= Text.encodeIllegalXMLCharacters(application.getServerInfo()) %></em> servlet container
   that supports the Java Servlet API version
   <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %>.
 </p>
@@ -95,5 +97,9 @@
   Details of the Java and operating system environment are included in
   the system properties shown below:
 </p>
-<pre><% System.getProperties().list(new java.io.PrintWriter(out)); %></pre>
+<%
+StringWriter buffer = new StringWriter();
+System.getProperties().list(new PrintWriter(buffer));
+%>
+<pre><%= Text.encodeIllegalXMLCharacters(buffer.toString()) %></pre>
 <jsp:include page="footer.jsp"/>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/webdav-jcr.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/webdav-jcr.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/webdav-jcr.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/webdav-jcr.jsp Thu Jan  8 08:21:08 2009
@@ -18,7 +18,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "JCR WebDAV Server");
 
 URI uri = new URI(request.getRequestURL().toString());
@@ -26,6 +26,7 @@
     uri.getScheme() + "://" + uri.getHost() + ":" + uri.getPort()
     + request.getContextPath()
     + JCRWebdavServerServlet.getPathPrefix(pageContext.getServletContext());
+href = Text.encodeIllegalXMLCharacters(href);
 String shref = href + "/default/jcr:root";
 %><jsp:include page="header.jsp"/>
 <p>
@@ -74,8 +75,8 @@
 
 <h3>Configuration</h3>
 <ul>
-  <li>Context Path: <%= request.getContextPath() %></li>
-  <li>Resource Path Prefix: <%= JCRWebdavServerServlet.getPathPrefix(pageContext.getServletContext()) %></li>
+  <li>Context Path: <%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %></li>
+  <li>Resource Path Prefix: <%= Text.encodeIllegalXMLCharacters(JCRWebdavServerServlet.getPathPrefix(pageContext.getServletContext())) %></li>
   <li>Workspace Name: <i>optional</i> (available workspaces are mapped as resources)</li>
   <li>Additional servlet configuration: see <i>/WEB-INF/web.xml</i></li>
 </ul>

Modified: jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/webdav-simple.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/webdav-simple.jsp?rev=732746&r1=732745&r2=732746&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/webdav-simple.jsp (original)
+++ jackrabbit/branches/1.5/jackrabbit-webapp/src/main/webapp/webdav-simple.jsp Thu Jan  8 08:21:08 2009
@@ -15,7 +15,7 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
---%><%
+--%><%@page import="org.apache.jackrabbit.util.Text"%><%
 request.setAttribute("title", "Standard WebDAV Server");
 
 URI uri = new URI(request.getRequestURL().toString());
@@ -24,6 +24,7 @@
     + request.getContextPath()
     + SimpleWebdavServlet.getPathPrefix(pageContext.getServletContext())
     + "/default/";
+href = Text.encodeIllegalXMLCharacters(href);
 %><jsp:include page="header.jsp"/>
 
 <p>
@@ -76,8 +77,8 @@
 
 <h3>Configuration</h3>
 <ul>
-    <li>Context path: <%= request.getContextPath() %></li>
-    <li>Resource path prefix: <%= SimpleWebdavServlet.getPathPrefix(pageContext.getServletContext()) %></li>
+    <li>Context path: <%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %></li>
+    <li>Resource path prefix: <%= Text.encodeIllegalXMLCharacters(SimpleWebdavServlet.getPathPrefix(pageContext.getServletContext())) %></li>
     <li>Servlet configuration: see <i>/WEB-INF/web.xml</i></li>
     <li>WebDAV specific resource configuration: see <i>/WEB-INF/config.xml</i></li>
 </ul>



Mime
View raw message