You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/10/27 07:40:48 UTC
svn commit: r328795 - in /beehive/trunk/netui: ant/ external/tomcat/5.5.x/
src/tomcat-common/ src/tomcat-common/5.0.x/ src/tomcat-common/5.5.x/
src/tomcat-server/ src/tomcat-server/5.0.x/ src/tomcat-server/5.5.x/
src/tomcat-server/5.5.x/org/apache/beeh...
Author: rich
Date: Wed Oct 26 22:40:27 2005
New Revision: 328795
URL: http://svn.apache.org/viewcvs?rev=328795&view=rev
Log:
This is a contribution from Abdessattar Sassi to give us a Tomcat 5.5.x ServletContainerAdapter. I modified this to leave the 5.0.x one in the tree, with this new one as a peer. Eventually both of these will move to another location in the tree, where they can be released independently from the rest of the code.
Thank you Abdessattar!
tests: bvt in netui, drt in netui/test/webapps/tomcat against both 5.0.28 and 5.5.9 (WinXP)
BB: same (linux)
Added:
beehive/trunk/netui/external/tomcat/5.5.x/
beehive/trunk/netui/external/tomcat/5.5.x/catalina.jar (with props)
beehive/trunk/netui/external/tomcat/5.5.x/tomcat-coyote.jar (with props)
beehive/trunk/netui/src/tomcat-common/5.5.x/
- copied from r328783, beehive/trunk/netui/src/tomcat-common/5.0.x/
beehive/trunk/netui/src/tomcat-server/5.5.x/
- copied from r328783, beehive/trunk/netui/src/tomcat-server/5.0.x/
beehive/trunk/netui/src/tomcat-webapp/5.5.x/
- copied from r328783, beehive/trunk/netui/src/tomcat-webapp/5.0.x/
Modified:
beehive/trunk/netui/ant/netui.properties
beehive/trunk/netui/src/tomcat-common/5.0.x/build.xml
beehive/trunk/netui/src/tomcat-common/5.5.x/build.xml
beehive/trunk/netui/src/tomcat-common/build.xml
beehive/trunk/netui/src/tomcat-server/5.0.x/build.xml
beehive/trunk/netui/src/tomcat-server/5.5.x/build.xml
beehive/trunk/netui/src/tomcat-server/5.5.x/org/apache/beehive/netui/tomcat/PageflowHelperImpl.java
beehive/trunk/netui/src/tomcat-server/5.5.x/org/apache/beehive/netui/tomcat/PageflowValve.java
beehive/trunk/netui/src/tomcat-server/build.xml
beehive/trunk/netui/src/tomcat-webapp/5.0.x/build.xml
beehive/trunk/netui/src/tomcat-webapp/5.5.x/build.xml
beehive/trunk/netui/src/tomcat-webapp/build.xml
beehive/trunk/netui/test/webapps/tomcat/build.xml
beehive/trunk/netui/test/webapps/tomcat/testRecorder/tests/Login.xml
beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/META-INF/context.xml
beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/login/loggedIn.jsp
beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/login/success.jsp
Modified: beehive/trunk/netui/ant/netui.properties
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/ant/netui.properties?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/ant/netui.properties (original)
+++ beehive/trunk/netui/ant/netui.properties Wed Oct 26 22:40:27 2005
@@ -36,10 +36,12 @@
jsf-api.jar=${myfaces.dir}/myfaces-jsf-api.jar
#
-# Tomcat properties. These JARs are used to compile the Tomcat 5.0.x ServletContextAdapter.
+# Tomcat properties. These JARs are used to compile the Tomcat ServletContainerAdapter(s).
#
catalina.5.0.x.jar=${tomcat.lib.dir}/5.0.x/catalina.jar
coyote.5.0.x.jar=${tomcat.lib.dir}/5.0.x/tomcat-coyote.jar
+catalina.5.5.x.jar=${tomcat.lib.dir}/5.5.x/catalina.jar
+coyote.5.5.x.jar=${tomcat.lib.dir}/5.5.x/tomcat-coyote.jar
#
# XDoclet properties. These JARs are used by the Page Flow XDoclet compiler (compiler-xdoclet module)
@@ -61,6 +63,9 @@
netui-tomcat-common.5.0.x.jar.name=beehive-netui-tomcat-common-5.0.x.jar
netui-tomcat-server.5.0.x.jar.name=beehive-netui-tomcat-server-5.0.x.jar
netui-tomcat-webapp.5.0.x.jar.name=beehive-netui-tomcat-webapp-5.0.x.jar
+netui-tomcat-common.5.5.x.jar.name=beehive-netui-tomcat-common-5.5.x.jar
+netui-tomcat-server.5.5.x.jar.name=beehive-netui-tomcat-server-5.5.x.jar
+netui-tomcat-webapp.5.5.x.jar.name=beehive-netui-tomcat-webapp-5.5.x.jar
# NetUI TLD Names
netui-tags-simple.tld.name=beehive-netui-tags-simple.tld
Added: beehive/trunk/netui/external/tomcat/5.5.x/catalina.jar
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/external/tomcat/5.5.x/catalina.jar?rev=328795&view=auto
==============================================================================
Binary file - no diff available.
Propchange: beehive/trunk/netui/external/tomcat/5.5.x/catalina.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: beehive/trunk/netui/external/tomcat/5.5.x/tomcat-coyote.jar
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/external/tomcat/5.5.x/tomcat-coyote.jar?rev=328795&view=auto
==============================================================================
Binary file - no diff available.
Propchange: beehive/trunk/netui/external/tomcat/5.5.x/tomcat-coyote.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: beehive/trunk/netui/src/tomcat-common/5.0.x/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-common/5.0.x/build.xml?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-common/5.0.x/build.xml (original)
+++ beehive/trunk/netui/src/tomcat-common/5.0.x/build.xml Wed Oct 26 22:40:27 2005
@@ -5,6 +5,7 @@
<import file="../../../netui-imports.xml"/>
<property name="module.dir" location="${src.dir}/${module.name}/5.0.x"/>
+ <property name="module.classes.dir" location="${classes.dir}/${module.name}/5.0.x"/>
<path id="module.classpath">
<path refid="servlet.dependency.path"/>
</path>
@@ -15,10 +16,10 @@
<echo>module classpath: ${classpath}</echo>
<echo>debug: ${compile.debug}</echo>
- <mkdir dir="${classes.dir}/${module.name}"/>
+ <mkdir dir="${module.classes.dir}"/>
<javac srcdir="${module.dir}"
- destdir="${classes.dir}/${module.name}"
+ destdir="${module.classes.dir}"
classpathref="module.classpath"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
@@ -26,15 +27,15 @@
source="${compile.source}">
<include name="**/*.java"/>
</javac>
- <copy todir="${classes.dir}/${module.name}">
+ <copy todir="${module.classes.dir}">
<fileset dir="${module.dir}" includes="**/*.properties"/>
</copy>
- <jar jarfile="${build.lib.dir}/${netui-tomcat-common.5.0.x.jar.name}" basedir="${classes.dir}/${module.name}"/>
+ <jar jarfile="${build.lib.dir}/${netui-tomcat-common.5.0.x.jar.name}" basedir="${module.classes.dir}"/>
</target>
<target name="clean">
- <delete dir="${classes.dir}/${module.name}"/>
+ <delete dir="${module.classes.dir}"/>
<delete dir="${build.lib.dir}/${netui-tomcat-common.5.0.x.jar.name}"/>
</target>
Modified: beehive/trunk/netui/src/tomcat-common/5.5.x/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-common/5.5.x/build.xml?rev=328795&r1=328783&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-common/5.5.x/build.xml (original)
+++ beehive/trunk/netui/src/tomcat-common/5.5.x/build.xml Wed Oct 26 22:40:27 2005
@@ -4,7 +4,8 @@
<import file="../../../netui-imports.xml"/>
- <property name="module.dir" location="${src.dir}/${module.name}/5.0.x"/>
+ <property name="module.dir" location="${src.dir}/${module.name}/5.5.x"/>
+ <property name="module.classes.dir" location="${classes.dir}/${module.name}/5.5.x"/>
<path id="module.classpath">
<path refid="servlet.dependency.path"/>
</path>
@@ -15,10 +16,10 @@
<echo>module classpath: ${classpath}</echo>
<echo>debug: ${compile.debug}</echo>
- <mkdir dir="${classes.dir}/${module.name}"/>
+ <mkdir dir="${module.classes.dir}"/>
<javac srcdir="${module.dir}"
- destdir="${classes.dir}/${module.name}"
+ destdir="${module.classes.dir}"
classpathref="module.classpath"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
@@ -26,16 +27,16 @@
source="${compile.source}">
<include name="**/*.java"/>
</javac>
- <copy todir="${classes.dir}/${module.name}">
+ <copy todir="${module.classes.dir}">
<fileset dir="${module.dir}" includes="**/*.properties"/>
</copy>
- <jar jarfile="${build.lib.dir}/${netui-tomcat-common.5.0.x.jar.name}" basedir="${classes.dir}/${module.name}"/>
+ <jar jarfile="${build.lib.dir}/${netui-tomcat-common.5.5.x.jar.name}" basedir="${module.classes.dir}"/>
</target>
<target name="clean">
- <delete dir="${classes.dir}/${module.name}"/>
- <delete dir="${build.lib.dir}/${netui-tomcat-common.5.0.x.jar.name}"/>
+ <delete dir="${module.classes.dir}"/>
+ <delete dir="${build.lib.dir}/${netui-tomcat-common.5.5.x.jar.name}"/>
</target>
</project>
Modified: beehive/trunk/netui/src/tomcat-common/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-common/build.xml?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-common/build.xml (original)
+++ beehive/trunk/netui/src/tomcat-common/build.xml Wed Oct 26 22:40:27 2005
@@ -11,10 +11,16 @@
<ant antfile="build.xml" target="build" dir="${module.dir}/5.0.x" inheritAll="false">
<property name="module.name" value="${module.name}"/>
</ant>
+ <ant antfile="build.xml" target="build" dir="${module.dir}/5.5.x" inheritAll="false">
+ <property name="module.name" value="${module.name}"/>
+ </ant>
</target>
<target name="clean">
<ant antfile="build.xml" target="clean" dir="${module.dir}/5.0.x" inheritAll="false">
+ <property name="module.name" value="${module.name}"/>
+ </ant>
+ <ant antfile="build.xml" target="clean" dir="${module.dir}/5.5.x" inheritAll="false">
<property name="module.name" value="${module.name}"/>
</ant>
</target>
Modified: beehive/trunk/netui/src/tomcat-server/5.0.x/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-server/5.0.x/build.xml?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-server/5.0.x/build.xml (original)
+++ beehive/trunk/netui/src/tomcat-server/5.0.x/build.xml Wed Oct 26 22:40:27 2005
@@ -5,6 +5,7 @@
<import file="../../../netui-imports.xml"/>
<property name="module.dir" location="${src.dir}/${module.name}/5.0.x"/>
+ <property name="module.classes.dir" location="${classes.dir}/${module.name}/5.0.x"/>
<path id="module.classpath">
<path refid="servlet.dependency.path"/>
<path refid="log4j.dependency.path"/>
@@ -20,10 +21,10 @@
<echo>module classpath: ${classpath}</echo>
<echo>debug: ${compile.debug}</echo>
- <mkdir dir="${classes.dir}/${module.name}"/>
+ <mkdir dir="${module.classes.dir}"/>
<javac srcdir="${module.dir}"
- destdir="${classes.dir}/${module.name}"
+ destdir="${module.classes.dir}"
classpathref="module.classpath"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
@@ -31,16 +32,16 @@
source="${compile.source}">
<include name="**/*.java"/>
</javac>
- <copy todir="${classes.dir}/${module.name}">
+ <copy todir="${module.classes.dir}">
<fileset dir="${module.dir}" includes="**/*.properties"/>
<fileset dir="${module.dir}" includes="**/mbeans-descriptors.xml"/>
</copy>
- <jar jarfile="${build.lib.dir}/${netui-tomcat-server.5.0.x.jar.name}" basedir="${classes.dir}/${module.name}"/>
+ <jar jarfile="${build.lib.dir}/${netui-tomcat-server.5.0.x.jar.name}" basedir="${module.classes.dir}"/>
</target>
<target name="clean">
- <delete dir="${classes.dir}/${module.name}"/>
+ <delete dir="${module.classes.dir}"/>
<delete dir="${build.lib.dir}/${netui-tomcat-server.5.0.x.jar.name}"/>
</target>
Modified: beehive/trunk/netui/src/tomcat-server/5.5.x/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-server/5.5.x/build.xml?rev=328795&r1=328783&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-server/5.5.x/build.xml (original)
+++ beehive/trunk/netui/src/tomcat-server/5.5.x/build.xml Wed Oct 26 22:40:27 2005
@@ -4,14 +4,15 @@
<import file="../../../netui-imports.xml"/>
- <property name="module.dir" location="${src.dir}/${module.name}/5.0.x"/>
+ <property name="module.dir" location="${src.dir}/${module.name}/5.5.x"/>
+ <property name="module.classes.dir" location="${classes.dir}/${module.name}/5.5.x"/>
<path id="module.classpath">
<path refid="servlet.dependency.path"/>
<path refid="log4j.dependency.path"/>
<path refid="commons-logging.dependency.path"/>
- <pathelement location="${build.lib.dir}/beehive-netui-tomcat-common-5.0.x.jar"/>
- <pathelement location="${catalina.5.0.x.jar}"/>
- <pathelement location="${coyote.5.0.x.jar}"/>
+ <pathelement location="${build.lib.dir}/beehive-netui-tomcat-common-5.5.x.jar"/>
+ <pathelement location="${catalina.5.5.x.jar}"/>
+ <pathelement location="${coyote.5.5.x.jar}"/>
</path>
<target name="build">
@@ -20,28 +21,28 @@
<echo>module classpath: ${classpath}</echo>
<echo>debug: ${compile.debug}</echo>
- <mkdir dir="${classes.dir}/${module.name}"/>
+ <mkdir dir="${module.classes.dir}"/>
<javac srcdir="${module.dir}"
- destdir="${classes.dir}/${module.name}"
+ destdir="${module.classes.dir}"
classpathref="module.classpath"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
- source="${compile.source}">
+ source="${compile.source}">
<include name="**/*.java"/>
</javac>
- <copy todir="${classes.dir}/${module.name}">
+ <copy todir="${module.classes.dir}">
<fileset dir="${module.dir}" includes="**/*.properties"/>
<fileset dir="${module.dir}" includes="**/mbeans-descriptors.xml"/>
</copy>
- <jar jarfile="${build.lib.dir}/${netui-tomcat-server.5.0.x.jar.name}" basedir="${classes.dir}/${module.name}"/>
+ <jar jarfile="${build.lib.dir}/${netui-tomcat-server.5.5.x.jar.name}" basedir="${module.classes.dir}"/>
</target>
<target name="clean">
- <delete dir="${classes.dir}/${module.name}"/>
- <delete dir="${build.lib.dir}/${netui-tomcat-server.5.0.x.jar.name}"/>
+ <delete dir="${module.classes.dir}"/>
+ <delete dir="${build.lib.dir}/${netui-tomcat-server.5.5.x.jar.name}"/>
</target>
</project>
Modified: beehive/trunk/netui/src/tomcat-server/5.5.x/org/apache/beehive/netui/tomcat/PageflowHelperImpl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-server/5.5.x/org/apache/beehive/netui/tomcat/PageflowHelperImpl.java?rev=328795&r1=328783&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-server/5.5.x/org/apache/beehive/netui/tomcat/PageflowHelperImpl.java (original)
+++ beehive/trunk/netui/src/tomcat-server/5.5.x/org/apache/beehive/netui/tomcat/PageflowHelperImpl.java Wed Oct 26 22:40:27 2005
@@ -17,11 +17,14 @@
*/
package org.apache.beehive.netui.tomcat;
-import org.apache.catalina.*;
+import org.apache.catalina.Context;
+import org.apache.catalina.Service;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
import org.apache.catalina.deploy.SecurityConstraint;
import org.apache.catalina.deploy.SecurityCollection;
import org.apache.catalina.authenticator.Constants;
-import org.apache.coyote.tomcat5.CoyoteConnector;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -32,8 +35,8 @@
public class PageflowHelperImpl implements PageflowHelper
{
- private HttpRequest _request = null;
- private HttpResponse _response = null;
+ private Request _request = null;
+ private Response _response = null;
private PageflowValve _valve = null;
public void login( String username, String password, HttpServletRequest request )
@@ -132,42 +135,37 @@
{
int port = -1;
Connector conn = _request.getConnector();
- if ( conn instanceof CoyoteConnector )
+ if ( !conn.getSecure() )
{
- CoyoteConnector cc = (CoyoteConnector)conn;
- if ( !cc.getSecure() )
+ // this is the regular connector, so use it's port
+ port = conn.getPort();
+ }
+ else
+ {
+ // look for a non-secure connector on this service with our port as the redirectPort
+ Service svc = conn.getService();
+ Connector[] connectors = svc.findConnectors();
+ for ( int i=0; i<connectors.length; i++ )
{
- // this is the regular connector, so use it's port
- port = cc.getPort();
+ if (connectors[i] != conn && !connectors[i].getSecure()
+ && connectors[i].getRedirectPort() == conn.getPort())
+ {
+ port = connectors[i].getPort();
+ break;
+ }
}
- else
+
+ if ( port == -1 )
{
- // look for a non-secure connector on this service with our port as the redirectPort
- Service svc = cc.getService();
- Connector[] connectors = svc.findConnectors();
+ // last resort, just use the first non-secure connector we find
for ( int i=0; i<connectors.length; i++ )
{
- if ( connectors[i] != cc && connectors[i] instanceof CoyoteConnector &&
- !connectors[i].getSecure() && connectors[i].getRedirectPort() == cc.getPort() )
+ if (connectors[i] != conn && !connectors[i].getSecure())
{
- port = ((CoyoteConnector)connectors[i]).getPort();
+ port = connectors[i].getPort();
break;
}
}
-
- if ( port == -1 )
- {
- // last resort, just use the first non-secure connector we find
- for ( int i=0; i<connectors.length; i++ )
- {
- if ( connectors[i] != cc && connectors[i] instanceof CoyoteConnector &&
- !connectors[i].getSecure() )
- {
- port = ((CoyoteConnector)connectors[i]).getPort();
- break;
- }
- }
- }
}
}
return port;
@@ -177,23 +175,14 @@
{
int port = -1;
Connector conn = _request.getConnector();
- if ( conn instanceof CoyoteConnector )
+ if ( conn.getSecure() )
{
- CoyoteConnector cc = (CoyoteConnector)conn;
- if ( cc.getSecure() )
- {
- // this is the secure connector, so use it's port
- port = cc.getPort();
- }
- else
- {
- // use the redirect port specified in the connector configuration
- port = cc.getRedirectPort();
- }
+ // this is the secure connector, so use it's port
+ port = conn.getPort();
}
else
{
- // use the redirect port specified in the connector configuration, even if not a coyote connector
+ // use the redirect port specified in the connector configuration
port = conn.getRedirectPort();
}
return port;
@@ -268,7 +257,7 @@
return lastDot != -1 ? filename.substring( lastDot + 1 ) : "";
}
- void initRequest( HttpRequest request, HttpResponse response, PageflowValve valve )
+ void initRequest( Request request, Response response, PageflowValve valve )
{
_request = request;
_response = response;
Modified: beehive/trunk/netui/src/tomcat-server/5.5.x/org/apache/beehive/netui/tomcat/PageflowValve.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-server/5.5.x/org/apache/beehive/netui/tomcat/PageflowValve.java?rev=328795&r1=328783&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-server/5.5.x/org/apache/beehive/netui/tomcat/PageflowValve.java (original)
+++ beehive/trunk/netui/src/tomcat-server/5.5.x/org/apache/beehive/netui/tomcat/PageflowValve.java Wed Oct 26 22:40:27 2005
@@ -17,7 +17,10 @@
*/
package org.apache.beehive.netui.tomcat;
-import org.apache.catalina.*;
+import org.apache.catalina.Context;
+import org.apache.catalina.Session;
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
import org.apache.catalina.deploy.SecurityConstraint;
import org.apache.catalina.authenticator.BasicAuthenticator;
import org.apache.catalina.authenticator.Constants;
@@ -29,6 +32,8 @@
import javax.security.auth.login.FailedLoginException;
import java.io.IOException;
import java.security.Principal;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* Tomcat valve implementation to give the netui pageflow infrastructure access to tomcat
@@ -38,49 +43,58 @@
*/
public class PageflowValve extends BasicAuthenticator
{
- public void invoke(Request request, Response response, ValveContext valveContext)
+ private static Log log = LogFactory.getLog(PageflowValve.class);
+
+ public String getInfo() {
+ return info;
+ }
+ /**
+ * Descriptive information about this implementation.
+ */
+ protected static final String info =
+ "org.apache.beehive.netui.tomcat.PageFlowValve/1.0";
+
+ public void invoke(Request request, Response response)
throws IOException, ServletException
{
- // If this is not an HTTP request and response, just pass them on
- if (!(request instanceof HttpRequest) ||
- !(response instanceof HttpResponse)) {
- valveContext.invokeNext(request, response);
- return;
- }
-
// NOTE: this code copied from org.apache.catalina.authenticator.AuthenticatorBase.invoke()
// Have we got a cached authenticated Principal to put in the request?
if (cache) {
- Principal principal =
- ((HttpServletRequest) request.getRequest()).getUserPrincipal();
+ Principal principal = request.getUserPrincipal();
if (principal == null) {
- Session session = getSession((HttpRequest)request);
+ Session session = request.getSessionInternal(false);
if (session != null) {
principal = session.getPrincipal();
if (principal != null) {
- if (debug >= 1)
- log("We have cached auth type " +
- session.getAuthType() +
- " for principal " +
- session.getPrincipal());
- ((HttpRequest)request).setAuthType(session.getAuthType());
- ((HttpRequest)request).setUserPrincipal(principal);
+ if (log.isDebugEnabled())
+ log.debug("We have cached auth type "
+ + session.getAuthType() + " for principal "
+ + session.getPrincipal());
+ request.setAuthType(session.getAuthType());
+ request.setUserPrincipal(principal);
}
}
}
}
// initialize pageflow helper
+ if (log.isDebugEnabled()) {
+ log.debug("PageFlowValve initializing request property with the helper.");
+ }
HttpServletRequest hreq =
(HttpServletRequest) request.getRequest();
PageflowHelper helper = new PageflowHelperImpl();
- ((PageflowHelperImpl)helper).initRequest( (HttpRequest)request, (HttpResponse)response, this );
+ ((PageflowHelperImpl)helper).initRequest( request, response, this );
hreq.setAttribute( PageflowHelper.PAGEFLOW_HELPER_KEY, helper );
- valveContext.invokeNext(request, response);
+ // Any and all specified constraints have been satisfied
+ if (log.isDebugEnabled()) {
+ log.debug("PageflowValve successfully invoked. Now calling Tomcat AuthenticatorBase...");
+ }
+ super.invoke(request, response);
}
- void login( String username, String password, HttpRequest request, HttpResponse response )
+ void login( String username, String password, Request request, Response response )
throws LoginException
{
// Note: if the login is not successful, we don't reset the current principal (if there is one).
@@ -95,7 +109,7 @@
throw new FailedLoginException( "Page Flow login failed: " + username ); // TODO: I18N
}
- void logout( boolean invalidateSessions, HttpRequest request, HttpResponse response )
+ void logout( boolean invalidateSessions, Request request, Response response )
{
if ( invalidateSessions )
{
@@ -122,7 +136,7 @@
* @param constraint The SecurityConstraint to check against
* @return <code>true</code> if a redirect occurred.
*/
- public boolean checkSecurity( HttpRequest request, HttpResponse response, SecurityConstraint constraint )
+ public boolean checkSecurity( Request request, Response response, SecurityConstraint constraint )
throws IOException
{
// The tomcat version of this returns false if the user was redirected, so we want the opposite of that.
Modified: beehive/trunk/netui/src/tomcat-server/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-server/build.xml?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-server/build.xml (original)
+++ beehive/trunk/netui/src/tomcat-server/build.xml Wed Oct 26 22:40:27 2005
@@ -11,10 +11,16 @@
<ant antfile="build.xml" target="build" dir="${module.dir}/5.0.x" inheritAll="false">
<property name="module.name" value="${module.name}"/>
</ant>
+ <ant antfile="build.xml" target="build" dir="${module.dir}/5.5.x" inheritAll="false">
+ <property name="module.name" value="${module.name}"/>
+ </ant>
</target>
<target name="clean">
<ant antfile="build.xml" target="clean" dir="${module.dir}/5.0.x" inheritAll="false">
+ <property name="module.name" value="${module.name}"/>
+ </ant>
+ <ant antfile="build.xml" target="clean" dir="${module.dir}/5.5.x" inheritAll="false">
<property name="module.name" value="${module.name}"/>
</ant>
</target>
Modified: beehive/trunk/netui/src/tomcat-webapp/5.0.x/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-webapp/5.0.x/build.xml?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-webapp/5.0.x/build.xml (original)
+++ beehive/trunk/netui/src/tomcat-webapp/5.0.x/build.xml Wed Oct 26 22:40:27 2005
@@ -5,6 +5,7 @@
<import file="../../../netui-imports.xml"/>
<property name="module.dir" location="${src.dir}/${module.name}/5.0.x"/>
+ <property name="module.classes.dir" location="${classes.dir}/${module.name}/5.0.x"/>
<path id="module.classpath">
<path refid="servlet.dependency.path"/>
<pathelement path="${build.lib.dir}/beehive-netui-tomcat-common-5.0.x.jar"/>
@@ -19,10 +20,10 @@
<echo>module classpath: ${classpath}</echo>
<echo>debug: ${compile.debug}</echo>
- <mkdir dir="${classes.dir}/${module.name}"/>
+ <mkdir dir="${module.classes.dir}"/>
<javac srcdir="${module.dir}"
- destdir="${classes.dir}/${module.name}"
+ destdir="${module.classes.dir}"
classpathref="module.classpath"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
@@ -30,16 +31,16 @@
source="${compile.source}">
<include name="**/*.java"/>
</javac>
- <copy todir="${classes.dir}/${module.name}">
+ <copy todir="${module.classes.dir}">
<fileset dir="${module.dir}" includes="**/*.properties"/>
<fileset dir="${module.dir}" includes="META-INF/**"/>
</copy>
- <jar jarfile="${build.lib.dir}/${netui-tomcat-webapp.5.0.x.jar.name}" basedir="${classes.dir}/${module.name}"/>
+ <jar jarfile="${build.lib.dir}/${netui-tomcat-webapp.5.0.x.jar.name}" basedir="${module.classes.dir}"/>
</target>
<target name="clean">
- <delete dir="${classes.dir}/${module.name}"/>
+ <delete dir="${module.classes.dir}"/>
<delete dir="${build.lib.dir}/${netui-tomcat-webapp.5.0.x.jar.name}"/>
</target>
Modified: beehive/trunk/netui/src/tomcat-webapp/5.5.x/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-webapp/5.5.x/build.xml?rev=328795&r1=328783&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-webapp/5.5.x/build.xml (original)
+++ beehive/trunk/netui/src/tomcat-webapp/5.5.x/build.xml Wed Oct 26 22:40:27 2005
@@ -4,10 +4,11 @@
<import file="../../../netui-imports.xml"/>
- <property name="module.dir" location="${src.dir}/${module.name}/5.0.x"/>
+ <property name="module.dir" location="${src.dir}/${module.name}/5.5.x"/>
+ <property name="module.classes.dir" location="${classes.dir}/${module.name}/5.5.x"/>
<path id="module.classpath">
<path refid="servlet.dependency.path"/>
- <pathelement path="${build.lib.dir}/beehive-netui-tomcat-common-5.0.x.jar"/>
+ <pathelement path="${build.lib.dir}/beehive-netui-tomcat-common-5.5.x.jar"/>
<pathelement path="${classes.dir}/scoping"/>
<pathelement path="${classes.dir}/util"/>
<pathelement path="${classes.dir}/pageflow"/>
@@ -19,10 +20,10 @@
<echo>module classpath: ${classpath}</echo>
<echo>debug: ${compile.debug}</echo>
- <mkdir dir="${classes.dir}/${module.name}"/>
+ <mkdir dir="${module.classes.dir}"/>
<javac srcdir="${module.dir}"
- destdir="${classes.dir}/${module.name}"
+ destdir="${module.classes.dir}"
classpathref="module.classpath"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
@@ -30,17 +31,17 @@
source="${compile.source}">
<include name="**/*.java"/>
</javac>
- <copy todir="${classes.dir}/${module.name}">
+ <copy todir="${module.classes.dir}">
<fileset dir="${module.dir}" includes="**/*.properties"/>
<fileset dir="${module.dir}" includes="META-INF/**"/>
</copy>
- <jar jarfile="${build.lib.dir}/${netui-tomcat-webapp.5.0.x.jar.name}" basedir="${classes.dir}/${module.name}"/>
+ <jar jarfile="${build.lib.dir}/${netui-tomcat-webapp.5.5.x.jar.name}" basedir="${module.classes.dir}"/>
</target>
<target name="clean">
- <delete dir="${classes.dir}/${module.name}"/>
- <delete dir="${build.lib.dir}/${netui-tomcat-webapp.5.0.x.jar.name}"/>
+ <delete dir="${module.classes.dir}"/>
+ <delete dir="${build.lib.dir}/${netui-tomcat-webapp.5.5.x.jar.name}"/>
</target>
</project>
Modified: beehive/trunk/netui/src/tomcat-webapp/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tomcat-webapp/build.xml?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/src/tomcat-webapp/build.xml (original)
+++ beehive/trunk/netui/src/tomcat-webapp/build.xml Wed Oct 26 22:40:27 2005
@@ -11,10 +11,16 @@
<ant antfile="build.xml" target="build" dir="${module.dir}/5.0.x" inheritAll="false">
<property name="module.name" value="${module.name}"/>
</ant>
+ <ant antfile="build.xml" target="build" dir="${module.dir}/5.5.x" inheritAll="false">
+ <property name="module.name" value="${module.name}"/>
+ </ant>
</target>
<target name="clean">
<ant antfile="build.xml" target="clean" dir="${module.dir}/5.0.x" inheritAll="false">
+ <property name="module.name" value="${module.name}"/>
+ </ant>
+ <ant antfile="build.xml" target="clean" dir="${module.dir}/5.5.x" inheritAll="false">
<property name="module.name" value="${module.name}"/>
</ant>
</target>
Modified: beehive/trunk/netui/test/webapps/tomcat/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/tomcat/build.xml?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/tomcat/build.xml (original)
+++ beehive/trunk/netui/test/webapps/tomcat/build.xml Wed Oct 26 22:40:27 2005
@@ -23,6 +23,11 @@
<antcall target="build.internal"/>
</target>
+ <target name="build.tomcat5.5.x">
+ <property name="tomcat.webapp.jar" value="${netui-tomcat-webapp.5.5.x.jar.name}"/>
+ <antcall target="build.internal"/>
+ </target>
+
<target name="build.internal">
<echo message="--------------------------------------------------"/>
<echo message="| NetUI tomcatWeb DRT webapp build starting |"/>
Modified: beehive/trunk/netui/test/webapps/tomcat/testRecorder/tests/Login.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/tomcat/testRecorder/tests/Login.xml?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/tomcat/testRecorder/tests/Login.xml (original)
+++ beehive/trunk/netui/test/webapps/tomcat/testRecorder/tests/Login.xml Wed Oct 26 22:40:27 2005
@@ -416,7 +416,7 @@
<body>
<h3>/login/Controller.jpf</h3>
- Logged in as: <b>GenericPrincipal[tomcat(tomcat,)]</b>
+ Logged in as: <b>tomcat</b>
<br/>
<br/>
@@ -500,7 +500,7 @@
Success!
<br/>
<br/>
- Logged in as: <b>GenericPrincipal[tomcat(tomcat,)]</b>
+ Logged in as: <b>tomcat</b>
<br/>
<br/>
@@ -586,7 +586,7 @@
Success!
<br/>
<br/>
- Logged in as: <b>null</b>
+ Logged in as: <b></b>
<br/>
<br/>
Modified: beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/META-INF/context.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/META-INF/context.xml?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/META-INF/context.xml (original)
+++ beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/META-INF/context.xml Wed Oct 26 22:40:27 2005
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<Context path="/tomcatWeb" debug="0" reloadable="true" crossContext="true">
<Valve className="org.apache.beehive.netui.tomcat.PageflowValve" debug="0" />
</Context>
Modified: beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/login/loggedIn.jsp
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/login/loggedIn.jsp?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/login/loggedIn.jsp (original)
+++ beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/login/loggedIn.jsp Wed Oct 26 22:40:27 2005
@@ -11,7 +11,7 @@
<netui:body>
<h3>${pageFlow.URI}</h3>
- Logged in as: <b><%= request.getUserPrincipal() %></b>
+ Logged in as: <b>${pageContext.request.userPrincipal.name}</b>
<br/>
<br/>
Modified: beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/login/success.jsp
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/login/success.jsp?rev=328795&r1=328794&r2=328795&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/login/success.jsp (original)
+++ beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/login/success.jsp Wed Oct 26 22:40:27 2005
@@ -13,7 +13,7 @@
Success!
<br/>
<br/>
- Logged in as: <b><%= request.getUserPrincipal() %></b>
+ Logged in as: <b>${pageContext.request.userPrincipal.name}</b>
<br/>
<br/>