Author: remy.maucherat(a)jboss.com
Date: 2010-01-13 09:36:21 -0500 (Wed, 13 Jan 2010)
New Revision: 1354
Modified:
trunk/java/org/apache/catalina/realm/JNDIRealm.java
trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
trunk/webapps/docs/changelog.xml
Log:
- Two minor ports.
Modified: trunk/java/org/apache/catalina/realm/JNDIRealm.java
===================================================================
--- trunk/java/org/apache/catalina/realm/JNDIRealm.java 2010-01-07 14:32:03 UTC (rev
1353)
+++ trunk/java/org/apache/catalina/realm/JNDIRealm.java 2010-01-13 14:36:21 UTC (rev
1354)
@@ -1884,8 +1884,12 @@
User user = getUser(context, username);
- return new GenericPrincipal(this, user.username, user.password ,
- getRoles(context, user));
+ if (user != null) {
+ return new GenericPrincipal(this, user.username, user.password ,
+ getRoles(context, user));
+ } else {
+ return null;
+ }
}
/**
Modified: trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/JspDocumentParser.java 2010-01-07 14:32:03 UTC
(rev 1353)
+++ trunk/java/org/apache/jasper/compiler/JspDocumentParser.java 2010-01-13 14:36:21 UTC
(rev 1354)
@@ -110,6 +110,8 @@
// Flag set to delay incrmenting tagDependentNesting until jsp:body
// is first encountered
private boolean tagDependentPending = false;
+ // Tag being parsed that should have an empty body
+ private Node tagEmptyBody = null;
/*
* Constructor
@@ -269,6 +271,8 @@
AttributesImpl nonTaglibAttrs = null;
AttributesImpl nonTaglibXmlnsAttrs = null;
+ checkEmptyBody();
+
processChars();
checkPrefixes(uri, qName, attrs);
@@ -429,9 +433,10 @@
if (scriptlessBodyNode == null
&&
bodyType.equalsIgnoreCase(TagInfo.BODY_CONTENT_SCRIPTLESS)) {
scriptlessBodyNode = node;
- }
- else if (TagInfo.BODY_CONTENT_TAG_DEPENDENT.equalsIgnoreCase(bodyType))
{
+ } else if (TagInfo.BODY_CONTENT_TAG_DEPENDENT.equalsIgnoreCase(bodyType))
{
tagDependentPending = true;
+ } else if (TagInfo.BODY_CONTENT_EMPTY.equals(bodyType)) {
+ tagEmptyBody = node;
}
}
}
@@ -455,8 +460,9 @@
*
* @throws SAXException
*/
- public void characters(char[] buf, int offset, int len) {
-
+ public void characters(char[] buf, int offset, int len)
+ throws SAXException {
+ checkEmptyBody();
if (charBuffer == null) {
charBuffer = new StringBuilder();
}
@@ -614,6 +620,10 @@
public void endElement(String uri, String localName, String qName)
throws SAXException {
+ if (tagEmptyBody != null) {
+ tagEmptyBody = null;
+ }
+
processChars();
if (directivesOnly &&
@@ -703,6 +713,7 @@
*/
public void startCDATA() throws SAXException {
+ checkEmptyBody();
processChars(); // Flush char buffer and remove white spaces
startMark = new Mark(ctxt, path, locator.getLineNumber(),
locator.getColumnNumber());
@@ -1389,6 +1400,14 @@
return "";
}
+ private void checkEmptyBody() throws SAXException {
+ if (tagEmptyBody != null) {
+ throw new SAXParseException(Localizer.getMessage(
+ "jasper.error.emptybodycontent.nonempty",
+ tagEmptyBody.qName), locator);
+ }
+ }
+
/*
* Gets SAXParser.
*
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-01-07 14:32:03 UTC (rev 1353)
+++ trunk/webapps/docs/changelog.xml 2010-01-13 14:36:21 UTC (rev 1354)
@@ -16,7 +16,25 @@
<body>
-<section name="JBoss Web 3.0.0.CR1 (remm)">
+<section name="JBoss Web 3.0.0.Beta2 (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <bug>48516</bug>: Possible NPE in JNDI realm. (markt)
+ </fix>
+ </changelog>
+ </subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ <bug>47977</bug>: Check empty body in tags. (markt)
+ </fix>
+
+ </changelog>
+ </subsection>
+</section>
+
+<section name="JBoss Web 3.0.0.Beta1 (remm)">
<subsection name="General">
<changelog>
<update>
Show replies by date