Author: alexsmirnov
Date: 2008-04-10 21:19:44 -0400 (Thu, 10 Apr 2008)
New Revision: 7749
Added:
trunk/framework/test/src/main/java/META-INF/
trunk/framework/test/src/main/java/META-INF/MANIFEST.MF
trunk/samples/seamEAR/primary-source/src/main/java/org/
trunk/samples/seamEAR/primary-source/src/main/java/org/richfaces/
trunk/samples/seamEAR/primary-source/src/main/java/org/richfaces/demo/
trunk/samples/seamEAR/primary-source/src/main/java/org/richfaces/demo/SeamUtil.java
trunk/samples/seamEAR/projects/logging/java/
trunk/samples/seamEAR/projects/logging/java/META-INF/
trunk/samples/seamEAR/projects/logging/java/META-INF/MANIFEST.MF
trunk/samples/seamEAR/projects/logging/java/org/
trunk/samples/seamEAR/projects/logging/java/org/richfaces/
trunk/samples/seamEAR/projects/logging/java/org/richfaces/demo/
trunk/samples/seamEAR/projects/logging/java/org/richfaces/demo/Log.java
trunk/samples/seamEAR/projects/logging/src/
trunk/samples/seamEAR/projects/logging/src/main/
trunk/test-applications/qa/Performance
trunk/test-applications/qa/Test
trunk/ui/columns/src/main/java/META-INF/
trunk/ui/columns/src/main/java/META-INF/MANIFEST.MF
trunk/ui/combobox/src/main/java/META-INF/
trunk/ui/combobox/src/main/java/META-INF/MANIFEST.MF
trunk/ui/componentControl/src/main/java/META-INF/
trunk/ui/componentControl/src/main/java/META-INF/MANIFEST.MF
trunk/ui/contextMenu/src/main/java/META-INF/
trunk/ui/contextMenu/src/main/java/META-INF/MANIFEST.MF
trunk/ui/fileUpload/src/main/java/META-INF/
trunk/ui/fileUpload/src/main/java/META-INF/MANIFEST.MF
trunk/ui/functions/src/main/java/META-INF/
trunk/ui/functions/src/main/java/META-INF/MANIFEST.MF
trunk/ui/inplaceInput/src/main/java/META-INF/
trunk/ui/inplaceInput/src/main/java/META-INF/MANIFEST.MF
trunk/ui/inplaceSelect/src/main/java/META-INF/
trunk/ui/inplaceSelect/src/main/java/META-INF/MANIFEST.MF
trunk/ui/pickList/src/main/java/META-INF/
trunk/ui/pickList/src/main/java/META-INF/MANIFEST.MF
trunk/ui/progressBAR/src/main/java/META-INF/
trunk/ui/progressBAR/src/main/java/META-INF/MANIFEST.MF
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ConfigurableXMLFilter.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/NamespaceMappings.java
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java
Log:
Fix problem in the NEKO filter with two or more parameters in URL
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ConfigurableXMLFilter.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ConfigurableXMLFilter.java 2008-04-10
23:36:53 UTC (rev 7748)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ConfigurableXMLFilter.java 2008-04-11
01:19:44 UTC (rev 7749)
@@ -136,24 +136,25 @@
private class NekoParserConfig extends ParserConfig {
protected HtmlParser createParser(String mime) {
- NekkoParser parser;
- try {
- synchronized (_xhtmlParsersPool) {
- parser = (NekkoParser) _xhtmlParsersPool.pop();
+ NekkoParser parser;
+ try {
+ synchronized (_xhtmlParsersPool) {
+ parser = (NekkoParser) _xhtmlParsersPool.pop();
+ }
+ } catch (EmptyStackException e) {
+ parser = new NekkoParser();
+ parser.setPublicId(getPublicid());
+ parser.setSystemid(getSystemid());
+ parser.setNamespace(getNamespace());
+ // If tidy not handle all requests, disable reorganising
+ // of html
+ // parser.setMoveElements(isForcexml());
+ parser.init();
+ }
+ parser.setMime(mime);
+ // TODO - set header scripts/styles filter.
+ return parser;
}
- } catch (EmptyStackException e) {
- parser = new NekkoParser();
- parser.setPublicId(getPublicid());
- parser.setSystemid(getSystemid());
- parser.setNamespace(getNamespace());
- // If tidy not handle all requests, disable reorganising
- // of html
- // parser.setMoveElements(isForcexml());
- parser.init();
- }
- // TODO - set header scripts/styles filter.
- return parser;
- }
boolean storeParser(HtmlParser parser) {
if (null != parser && parser instanceof NekkoParser) {
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java 2008-04-10
23:36:53 UTC (rev 7748)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java 2008-04-11
01:19:44 UTC (rev 7749)
@@ -36,6 +36,7 @@
import javax.xml.parsers.ParserConfigurationException;
import org.ajax4jsf.application.AjaxViewHandler;
+import org.ajax4jsf.webapp.BaseXMLFilter;
import org.ajax4jsf.webapp.HtmlParser;
import org.ajax4jsf.xml.serializer.Method;
import org.ajax4jsf.xml.serializer.OutputPropertiesFactory;
@@ -108,6 +109,12 @@
private String _outputEncoding;
+ private Serializer _XHTMLserializer;
+
+ private Serializer _XMLserialiser;
+
+ private Serializer _HTMLserialiser;
+
/**
*
*/
@@ -121,10 +128,12 @@
_parser = new HtmlSAXParser(getHtmlConfig());
Properties properties = OutputPropertiesFactory
.getDefaultMethodProperties(Method.XHTML);
- // Properties properties =
- // OutputPropertiesFactory.getDefaultMethodProperties(Method.XML);
- // properties.put("encoding",_encoding);
- _serializer = SerializerFactory.getSerializer(properties);
+ _XHTMLserializer = SerializerFactory.getSerializer(properties);
+ properties = OutputPropertiesFactory.getDefaultMethodProperties(Method.XML);
+ _XMLserialiser = SerializerFactory.getSerializer(properties);
+ properties = OutputPropertiesFactory.getDefaultMethodProperties(Method.HTML);
+ _HTMLserialiser = SerializerFactory.getSerializer(properties);
+ _serializer = _HTMLserialiser;
// serializer.setOutputStream(output);
// _parser.setContentHandler(serializer.asContentHandler());
viewStateParser = new DOMFragmentParser();
@@ -168,7 +177,10 @@
_userStyles = null;
_viewState = null;
_parser.reset();
- _serializer.reset();
+ _XMLserialiser.reset();
+ _HTMLserialiser.reset();
+ _XHTMLserializer.reset();
+ _serializer = _HTMLserialiser;
}
/*
@@ -772,6 +784,18 @@
}
public boolean setMime(String mimeType) {
+ if(null != mimeType) {
+ if(mimeType.startsWith(BaseXMLFilter.TEXT_HTML)){
+ _serializer = _HTMLserialiser;
+ } else if (mimeType.startsWith(BaseXMLFilter.APPLICATION_XHTML_XML)) {
+ _serializer = _XHTMLserializer;
+ } else if (mimeType.startsWith("text/xml")) {
+ _serializer = _XMLserialiser;
+ } else {
+ return false;
+ }
+ return true;
+ }
return false;
}
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/NamespaceMappings.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/NamespaceMappings.java 2008-04-10
23:36:53 UTC (rev 7748)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/NamespaceMappings.java 2008-04-11
01:19:44 UTC (rev 7749)
@@ -221,8 +221,10 @@
Stack stack;
if ((stack = (Stack) m_namespaces.get(prefix)) != null)
{
- stack.pop();
- return true;
+ if (!stack.isEmpty()) {
+ stack.pop();
+ }
+ return true;
}
return false;
}
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java 2008-04-10
23:36:53 UTC (rev 7748)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java 2008-04-11
01:19:44 UTC (rev 7749)
@@ -1326,7 +1326,7 @@
// Since
http://www.ietf.org/rfc/rfc2396.txt refers to the URI grammar as
// not allowing quotes in the URI proper syntax, nor in the fragment
// identifier, we believe that it's OK to double escape quotes.
- else if (ch == '"')
+ else if (ch == '"' || ch == '<' || ch ==
'>' || ch == '&')
{
// If the character is a '%' number number, try to avoid
double-escaping.
// There is a question if this is legal behavior.
@@ -1346,11 +1346,18 @@
// Mike Kay encodes this as ", so he may know something I
don't?
- if (doURLEscaping)
- writer.write("%22");
- else
- writer.write("""); // we have to escape this, I
guess.
+ if (doURLEscaping){
+ writer.write('%');
+ writer.write(makeHHString(ch));
+ } else {
+ int pos = accumDefaultEntity(writer, ch, i, chars, end, false,
true);
+ if (i != pos)
+ {
+ i = pos - 1;
+ }
+// writer.write("""); // we have to escape this, I
guess.
+ }
// We have written out any clean characters, then the escaped '%'
and now we
// We now we reset the next possible clean character.
cleanStart = i + 1;
Added: trunk/framework/test/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/framework/test/src/main/java/META-INF/MANIFEST.MF (rev
0)
+++ trunk/framework/test/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC (rev
7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/framework/test/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/samples/seamEAR/primary-source/src/main/java/org/richfaces/demo/SeamUtil.java
===================================================================
--- trunk/samples/seamEAR/primary-source/src/main/java/org/richfaces/demo/SeamUtil.java
(rev 0)
+++
trunk/samples/seamEAR/primary-source/src/main/java/org/richfaces/demo/SeamUtil.java 2008-04-11
01:19:44 UTC (rev 7749)
@@ -0,0 +1,5 @@
+package org.richfaces.demo;
+
+public class SeamUtil {
+
+}
Property changes on:
trunk/samples/seamEAR/primary-source/src/main/java/org/richfaces/demo/SeamUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamEAR/projects/logging/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/samples/seamEAR/projects/logging/java/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/samples/seamEAR/projects/logging/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44
UTC (rev 7749)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
Property changes on: trunk/samples/seamEAR/projects/logging/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamEAR/projects/logging/java/org/richfaces/demo/Log.java
===================================================================
--- trunk/samples/seamEAR/projects/logging/java/org/richfaces/demo/Log.java
(rev 0)
+++ trunk/samples/seamEAR/projects/logging/java/org/richfaces/demo/Log.java 2008-04-11
01:19:44 UTC (rev 7749)
@@ -0,0 +1,5 @@
+package org.richfaces.demo;
+
+public class Log {
+
+}
Property changes on:
trunk/samples/seamEAR/projects/logging/java/org/richfaces/demo/Log.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/test-applications/qa/Performance
===================================================================
Added: trunk/test-applications/qa/Test
===================================================================
Added: trunk/ui/columns/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/columns/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ trunk/ui/columns/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC (rev
7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/columns/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/combobox/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/combobox/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ trunk/ui/combobox/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC (rev
7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/combobox/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/componentControl/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/componentControl/src/main/java/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/ui/componentControl/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC
(rev 7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/componentControl/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/contextMenu/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/contextMenu/src/main/java/META-INF/MANIFEST.MF (rev
0)
+++ trunk/ui/contextMenu/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC (rev
7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/contextMenu/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/fileUpload/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/fileUpload/src/main/java/META-INF/MANIFEST.MF (rev
0)
+++ trunk/ui/fileUpload/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC (rev
7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/fileUpload/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/functions/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/functions/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ trunk/ui/functions/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC (rev
7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/functions/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/inplaceInput/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/inplaceInput/src/main/java/META-INF/MANIFEST.MF (rev
0)
+++ trunk/ui/inplaceInput/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC (rev
7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/inplaceInput/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/inplaceSelect/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/META-INF/MANIFEST.MF (rev
0)
+++ trunk/ui/inplaceSelect/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC (rev
7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/inplaceSelect/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/pickList/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/pickList/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ trunk/ui/pickList/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC (rev
7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/pickList/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/progressBAR/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/progressBAR/src/main/java/META-INF/MANIFEST.MF (rev
0)
+++ trunk/ui/progressBAR/src/main/java/META-INF/MANIFEST.MF 2008-04-11 01:19:44 UTC (rev
7749)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/progressBAR/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain