Author: jalkanen
Date: Tue Oct 21 13:00:06 2008
New Revision: 706738
URL: http://svn.apache.org/viewvc?rev=706738&view=rev
Log: (empty)
Modified:
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/util/AllTests.java
Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog?rev=706738&r1=706737&r2=706738&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog Tue Oct 21 13:00:06
2008
@@ -1,3 +1,11 @@
+2008-10-21 Janne Jalkanen <[EMAIL PROTECTED]>
+
+ * 2.8.1-svn-1
+
+ * [JSPWIKI-348] OC4J compatibility, thanks to Lutz Tietze.
+
+ * [JSPWIKI-389] Wrong mixed quotes in SecurityConfig.jsp corrected.
+
2008-10-17 Janne Jalkanen <[EMAIL PROTECTED]>
* 2.8.0-rc-2.
Modified:
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java?rev=706738&r1=706737&r2=706738&view=diff
==============================================================================
---
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
(original)
+++
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
Tue Oct 21 13:00:06 2008
@@ -57,7 +57,7 @@
* <p>
* If the POSTFIX is empty, it is not added to the version string.
*/
- private static final String POSTFIX = "";
+ private static final String POSTFIX = "svn";
/** The JSPWiki major version. */
public static final int VERSION = 2;
@@ -66,7 +66,7 @@
public static final int REVISION = 8;
/** The minor revision. */
- public static final int MINORREVISION = 0;
+ public static final int MINORREVISION = 1;
/** The build number/identifier. This is a String as opposed to an
integer, just
* so that people can add other identifiers to it. The build number is
incremented
@@ -77,7 +77,7 @@
* <p>
* If the build identifier is empty, it is not added.
*/
- public static final String BUILD = "";
+ public static final String BUILD = "1";
/**
* This is the generic version string you should use
Modified:
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java?rev=706738&r1=706737&r2=706738&view=diff
==============================================================================
---
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
(original)
+++
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
Tue Oct 21 13:00:06 2008
@@ -20,9 +20,7 @@
*/
package com.ecyrd.jspwiki.ui;
-import java.io.CharArrayWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
+import java.io.*;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
@@ -36,6 +34,7 @@
import com.ecyrd.jspwiki.event.WikiEventManager;
import com.ecyrd.jspwiki.event.WikiPageEvent;
import com.ecyrd.jspwiki.url.DefaultURLConstructor;
+import com.ecyrd.jspwiki.util.UtilJ2eeCompat;
import com.ecyrd.jspwiki.util.WatchDog;
/**
@@ -69,7 +68,16 @@
*/
public class WikiJSPFilter extends WikiServletFilter
{
+ private Boolean m_useOutputStream;
+
/** [EMAIL PROTECTED] */
+ public void init( FilterConfig config ) throws ServletException
+ {
+ super.init( config );
+ ServletContext context = config.getServletContext();
+ m_useOutputStream = UtilJ2eeCompat.useOutputStream(
context.getServerInfo() );
+ }
+
public void doFilter( ServletRequest request,
ServletResponse response,
FilterChain chain )
@@ -81,8 +89,19 @@
NDC.push(
m_engine.getApplicationName()+":"+((HttpServletRequest)request).getRequestURI()
);
w.enterState("Filtering for URL
"+((HttpServletRequest)request).getRequestURI(), 90 );
-
- HttpServletResponseWrapper responseWrapper = new
MyServletResponseWrapper( (HttpServletResponse)response );
+ HttpServletResponseWrapper responseWrapper;
+
+ if( m_useOutputStream )
+ {
+ log.debug( "Using ByteArrayResponseWrapper" );
+ responseWrapper = new ByteArrayResponseWrapper(
(HttpServletResponse)response );
+ }
+ else
+ {
+ log.debug( "Using MyServletResponseWrapper" );
+ responseWrapper = new MyServletResponseWrapper(
(HttpServletResponse)response );
+
+ }
// fire PAGE_REQUESTED event
String pagename = DefaultURLConstructor.parsePageFromURL(
@@ -284,6 +303,75 @@
}
}
+ /**
+ * Response wrapper for application servers which do not work with
CharArrayWriter
+ * Currently only OC4J
+ */
+ private static class ByteArrayResponseWrapper
+ extends HttpServletResponseWrapper
+ {
+ private ByteArrayOutputStream m_output;
+ private HttpServletResponse m_response;
+
+ /**
+ * How large the initial buffer should be. This should be tuned to
achieve
+ * a balance in speed and memory consumption.
+ */
+ private static final int INIT_BUFFER_SIZE = 4096;
+
+ public ByteArrayResponseWrapper( HttpServletResponse r )
+ {
+ super(r);
+ m_output = new ByteArrayOutputStream( INIT_BUFFER_SIZE );
+ m_response = r;
+ }
+
+ /**
+ * Returns a writer for output; this wraps the internal buffer
+ * into a PrintWriter.
+ */
+ public PrintWriter getWriter()
+ {
+ return new PrintWriter( getOutputStream(), true );
+ }
+
+ public ServletOutputStream getOutputStream()
+ {
+ return new MyServletOutputStream( m_output );
+ }
+
+ static class MyServletOutputStream extends ServletOutputStream
+ {
+ private DataOutputStream m_stream;
+
+ public MyServletOutputStream( OutputStream aOutput )
+ {
+ super();
+ m_stream = new DataOutputStream( aOutput );
+ }
+
+ public void write( int aInt ) throws IOException
+ {
+ m_stream.write( aInt );
+ }
+ }
+
+ /**
+ * Returns whatever was written so far into the Writer.
+ */
+ public String toString()
+ {
+ try
+ {
+ return m_output.toString( m_response.getCharacterEncoding() );
+ }
+ catch( UnsupportedEncodingException e )
+ {
+ log.error( ByteArrayResponseWrapper.class + " Unsupported
Encoding", e );
+ return null;
+ }
+ }
+ }
// events processing
.......................................................
Modified:
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/util/AllTests.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/util/AllTests.java?rev=706738&r1=706737&r2=706738&view=diff
==============================================================================
---
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/util/AllTests.java
(original)
+++
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/util/AllTests.java
Tue Oct 21 13:00:06 2008
@@ -23,6 +23,7 @@
suite.addTest( SerializerTest.suite() );
suite.addTest( TextUtilTest.suite() );
suite.addTest( TimedCounterListTest.suite() );
+ suite.addTest( UtilJ2eeCompatTest.suite() );
return suite;
}