incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r793064 - /sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
Date Fri, 10 Jul 2009 18:20:31 GMT
Author: fmeschbe
Date: Fri Jul 10 18:20:31 2009
New Revision: 793064

URL: http://svn.apache.org/viewvc?rev=793064&view=rev
Log:
SLING-1045 Apply XHTML patch by Andreas Amstutz (thanks)

Modified:
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java?rev=793064&r1=793063&r2=793064&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
Fri Jul 10 18:20:31 2009
@@ -79,7 +79,12 @@
 
     private void printProlog(PrintWriter pw, boolean isIncluded) {
         if ( !isIncluded ) {
-            pw.println("<html><body>");
+            pw.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
+            pw.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"");
+            pw.println("    \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">");
+            pw.println("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">");
+            pw.println("<head><meta http-equiv=\"content-type\" content=\"text/html;
charset=utf-8\" /></head>");
+            pw.println("<body>");
         }
     }
 
@@ -99,12 +104,14 @@
     @SuppressWarnings("unchecked")
     private void render(PrintWriter pw, Resource r, Map map) {
         pw.println("<h2>Resource properties</h2>");
+        pw.println("<p>");
         final Iterator<Map.Entry> pi = map.entrySet().iterator();
         while ( pi.hasNext() ) {
             final Map.Entry p = pi.next();
             printPropertyValue(pw, p.getKey().toString(), p.getValue());
             pw.println();
         }
+        pw.println("</p>");
     }
 
     private void render(PrintWriter pw, Resource r, String value) {
@@ -129,7 +136,7 @@
             pw.print(value.toString());
         }
 
-        pw.print("</b><br/>");
+        pw.print("</b><br />");
     }
 
 }



Mime
View raw message