Re: [Bug 58095] Empty script tag results in generated jsp having a self-closing script tag, which is invalid and results in rendering issues

2015-08-17 Thread Kevin Hale Boyes
On 17 August 2015 at 15:43, Christopher Schultz 
ch...@christopherschultz.net wrote:


 If you want to propose this patch, please attach it to the BZ issue
 directly, rather than replying to the message on the dev list.


Do I need to re-open the bug?


Re: [Bug 58095] Empty script tag results in generated jsp having a self-closing script tag, which is invalid and results in rendering issues

2015-08-17 Thread Kevin Hale Boyes
On 6 July 2015 at 14:15, bugzi...@apache.org wrote:

 Mark Thomas ma...@apache.org changed:

What|Removed |Added

 
  Resolution|--- |INVALID
  Status|NEW |RESOLVED

 --- Comment #4 from Mark Thomas ma...@apache.org ---
 JSP documents have to be well-formed XML. If you use tags from another
 namespace then there is an assumption that they follow the rules for XML.
 If
 they don't then you'll need to work-around it. The approach Chris suggests
 is
 probably the easiest in this case but you can also use CDATA blocks if you
 wish.


I was discussing this over on the user mailing list (
http://mail-archives.apache.org/mod_mbox/tomcat-users/201508.mbox/%3ccadaechwxdqy50jgdzfo43fzeox6zvkab27zejamvmrhjwyu...@mail.gmail.com%3E)
and have put together a patch which addresses the issue.

Since an empty body is valid XML, the patch changes Generator so that it
outputs empty bodies instead of self closing tags.

I've attached the patch to the email so that others can get an idea of what
I'm doing.
The file 58095a.txt is the actual patch.  It needed changes to one of the
test cases that assumed self-closing tags as part of what it was testing.
I've also attached 58095b.txt (which doesn't necessarily need to be
committed) that exercises the change in the JSP examples webapp.

If there is interest then I can re-open this bug and attach the patch
properly.

Thanks for your consideration.
Kevin.
Index: java/org/apache/jasper/compiler/Generator.java
===
--- java/org/apache/jasper/compiler/Generator.java  (revision 1696322)
+++ java/org/apache/jasper/compiler/Generator.java  (working copy)
@@ -1926,21 +1926,18 @@
 }
 }
 
-if (n.getBody() != null) {
-out.println(\););
+// Close the begin tag
+out.println(\););
 
-// Visit tag body
-visitBody(n);
+// Visit tag body
+visitBody(n);
 
-/*
- * Write end tag
- */
-out.printin(out.write(\/);
-out.print(n.getQName());
-out.println(\););
-} else {
-out.println(/\););
-}
+/*
+ * Write end tag
+ */
+out.printin(out.write(\/);
+out.print(n.getQName());
+out.println(\););
 
 n.setEndJavaLine(out.getJavaLine());
 }
Index: test/org/apache/jasper/compiler/TestParser.java
===
--- test/org/apache/jasper/compiler/TestParser.java (revision 1696322)
+++ test/org/apache/jasper/compiler/TestParser.java (working copy)
@@ -279,24 +279,24 @@
 // NOTE: The expected values must themselves be \ escaped below
 Assert.assertTrue(result, result.contains(01a\\?resize01a));
 Assert.assertTrue(result, result.contains(01bx\\?resize01b));
-Assert.assertTrue(result, result.contains(set 
data-value=\02a?resize02a\/));
-Assert.assertTrue(result, result.contains(set 
data-value=\02bx?resize02b\/));
-Assert.assertTrue(result, result.contains(set 
data-value=\03a\\?resize03a\/));
-Assert.assertTrue(result, result.contains(set 
data-value=\03bx\\?resize03b\/));
+Assert.assertTrue(result, result.contains(set 
data-value=\02a?resize02a\/set));
+Assert.assertTrue(result, result.contains(set 
data-value=\02bx?resize02b\/set));
+Assert.assertTrue(result, result.contains(set 
data-value=\03a\\?resize03a\/set));
+Assert.assertTrue(result, result.contains(set 
data-value=\03bx\\?resize03b\/set));
 Assert.assertTrue(result, result.contains(04a\\?resize04a/));
 Assert.assertTrue(result, result.contains(04bx\\?resize04b/));
-Assert.assertTrue(result, result.contains(set 
data-value=\05a\\$${amp;\/));
-Assert.assertTrue(result, result.contains(set 
data-value=\05b\\$${amp;2\/));
-Assert.assertTrue(result, result.contains(set 
data-value=\05c\\##{gt;hellolt;\/));
-Assert.assertTrue(result, result.contains(05x:set 
data-value=\\/));
-Assert.assertTrue(result, result.contains(set 
xmlns:foo=\urn:06a\\bar\\baz\/));
-Assert.assertTrue(result, result.contains(07a:set 
data-value=\\\?resize\/));
-Assert.assertTrue(result, result.contains(07b:set 
data-content=\\\?resize=.+\/));
-Assert.assertTrue(result, result.contains(07c:set 
data-content=\\\?resize=.+\/));
-Assert.assertTrue(result, result.contains(07d:set 
data-content=\false\/));
-Assert.assertTrue(result, result.contains(07e:set 
data-content=\false\/));
-

SVN checkout errors

2015-06-16 Thread Kevin Hale Boyes
I'm trying to check out trunk but am getting errors.

$ svn co http://svn.apache.org/repos/asf/tomcat/trunk tomcat-trunk
svn: E175002: Unable to connect to a repository at URL '
http://svn.apache.org/repos/asf/tomcat/trunk'
svn: E175002: Server sent unexpected return value (500 Internal Server
Error) in response to OPTIONS request for '
http://svn.apache.org/repos/asf/tomcat/trunk'

but

$ svn co http://svn.apache.org/repos/asf/tomcat/tc8.0.x/trunk tomcat8.0.x

was successful.


Am I doing something wrong?

Thanks,
Kevin.


Re: SVN checkout errors

2015-06-16 Thread Kevin Hale Boyes
And now it's working.  Not sure what was wrong but thanks for your help.

On 16 June 2015 at 09:52, Mark Thomas ma...@apache.org wrote:

 On 16/06/2015 16:33, Kevin Hale Boyes wrote:
  I'm trying to check out trunk but am getting errors.
 
  $ svn co http://svn.apache.org/repos/asf/tomcat/trunk tomcat-trunk
  svn: E175002: Unable to connect to a repository at URL '
  http://svn.apache.org/repos/asf/tomcat/trunk'
  svn: E175002: Server sent unexpected return value (500 Internal Server
  Error) in response to OPTIONS request for '
  http://svn.apache.org/repos/asf/tomcat/trunk'
 
  but
 
  $ svn co http://svn.apache.org/repos/asf/tomcat/tc8.0.x/trunk
 tomcat8.0.x
 
  was successful.
 
 
  Am I doing something wrong?

 Nope. If you can check out 8.0.x/trunk you should be able to check out
 trunk. It is all one big repo and the permissions are at the /tomcat level.

 Mark


 -
 To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: dev-h...@tomcat.apache.org