You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by be...@locus.apache.org on 2000/07/03 10:54:06 UTC
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core RequestImpl.java
bergsten 00/07/03 01:54:04
Modified: src/share/org/apache/tomcat/core RequestImpl.java
Log:
Headers were not set after a redirect. Fixed by letting handleStatus() call
resetBuffer() instead of reset()
Revision Changes Path
1.53 +24 -22 jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java
Index: RequestImpl.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- RequestImpl.java 2000/06/29 18:01:30 1.52
+++ RequestImpl.java 2000/07/03 08:54:01 1.53
@@ -78,6 +78,7 @@
* @author Jason Hunter [jch@eng.sun.com]
* @author Harish Prabandham
* @author Alex Cruikshank [alex@epitonic.com]
+ * @author Hans Bergsten [hans@gefionsoftware.com]
*/
public class RequestImpl implements Request {
@@ -102,7 +103,7 @@
// Need to distinguish between null pathTranslated and
// lazy-computed pathTranlsated
protected boolean pathTranslatedIsSet=false;
-
+
protected Hashtable parameters = new Hashtable();
protected int contentLength = -1;
protected String contentType = null;
@@ -115,7 +116,7 @@
// active roles for the current user
protected String userRoles[];
protected String reqRoles[];
-
+
// Request
protected Response response;
protected HttpServletRequest requestFacade;
@@ -159,7 +160,7 @@
Request top;
Request parent;
Request child;
-
+
protected static StringManager sm =
StringManager.getManager("org.apache.tomcat.core");
@@ -206,7 +207,7 @@
/** Return the server name. If none was set,
* extract it from the host header.
- *
+ *
*/
public String getServerName() {
if(serverName!=null) return serverName;
@@ -253,7 +254,7 @@
return null;
}
}
-
+
public String[] getParameterValues(String name) {
handleParameters();
return (String[])parameters.get(name);
@@ -326,7 +327,7 @@
public String getPathInfo() {
return pathInfo;
}
-
+
public void setRemoteUser(String s) {
remoteUser=s;
// this is set by an auth module
@@ -344,14 +345,14 @@
}
public boolean isSecure() {
- // The adapter is responsible for providing this information
+ // The adapter is responsible for providing this information
return getScheme().equalsIgnoreCase("HTTPS");
}
-
+
public void setUserPrincipal( Principal p ) {
principal=p;
}
-
+
/** Return the principal - the adapter will set it
*/
public Principal getUserPrincipal() {
@@ -359,7 +360,7 @@
if( principal == null ) {
principal=new SimplePrincipal( getRemoteUser() );
}
- return principal;
+ return principal;
}
public void setRequiredRoles( String roles[] ) {
@@ -460,16 +461,16 @@
// if not null, it is validated by the session module
return serverSession;
}
-
+
if( ! create ) return null;
-
+
// context.log("RequestImpl: created new session!");
contextM.doNewSessionRequest( this, response );
if ( serverSession == null ) {
context.log("RequestImpl: no session created!");
return null;
}
-
+
reqSessionId = serverSession.getId();
response.setSessionId( reqSessionId );
@@ -492,7 +493,7 @@
}
return (Cookie)cookies.elementAt(idx);
}
-
+
public Cookie[] getCookies() {
int count=getCookieCount();
Cookie[] cookieArray = new Cookie[ count ];
@@ -589,10 +590,10 @@
if( value != null )
return value;
- // allow access to FacadeManager for servlets
+ // allow access to FacadeManager for servlets
// ( this way you don't need to deal with init ).
if( name.equals(FacadeManager.FACADE_ATTRIBUTE)) {
- return context.getAttribute( name );
+ return context.getAttribute( name );
}
return null;
}
@@ -629,7 +630,7 @@
public Request getChild() {
return child;
}
-
+
public void setChild( Request req ) {
child=req;
}
@@ -652,7 +653,7 @@
}
return top;
}
-
+
// -------------------- Facade for MimeHeaders
public Enumeration getHeaders(String name) {
// Vector v = reqA.getMimeHeaders().getHeadersVector(name);
@@ -719,6 +720,7 @@
pathTranslated=null;
pathInfo=null;
pathTranslatedIsSet=false;
+ sessionIdSource = null;
// XXX a request need to override those if it cares
// about security
@@ -756,7 +758,7 @@
bBuffer=buf;
}
-
+
public ServletInputStream getInputStream() throws IOException {
return in;
}
@@ -838,12 +840,12 @@
public String getLocalHost() {
return localHost;
}
-
+
public void setLocalHost(String host) {
this.localHost = host;
}
-
+
public String toString() {
StringBuffer sb=new StringBuffer();
sb.append( "R( ");
@@ -881,7 +883,7 @@
public static final int ACC_POST_SERVICE=4;
public static final int ACC_IN_OUT=5;
public static final int ACC_OUT_COUNT=6;
-
+
public static final int ACCOUNTS=7;
long accTable[]=new long[ACCOUNTS];
Re: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core
RequestImpl.java
Posted by Hans Bergsten <ha...@gefionsoftware.com>.
bergsten@locus.apache.org wrote:
>
> bergsten 00/07/03 01:54:04
>
> Modified: src/share/org/apache/tomcat/core RequestImpl.java
> Log:
> Headers were not set after a redirect. Fixed by letting handleStatus() call
> resetBuffer() instead of reset()
Sorry, wrong comment (too late ;-) This is what it should say:
URL rewriting didn't work if an instance that previously had been used
with a cookie based session ID was used to handle a new request without
session ID. Fixed by resetting sessionIdSource in recycle()
> [...]
> @@ -719,6 +720,7 @@
> pathTranslated=null;
> pathInfo=null;
> pathTranslatedIsSet=false;
> + sessionIdSource = null;
--
Hans Bergsten hans@gefionsoftware.com
Gefion Software http://www.gefionsoftware.com