Re: Tag files not pooling

2003-11-12 Thread Ryan Lubke
The JSP 2.0 specification states that these must not be cached.

See section 7.1.5.



On Wed, 2003-11-12 at 10:48, jakarta wrote:
 Is tomcat 5 going to suport tag file pooling as well as tag pooling.
 When looking at some generated code I notice that it was currently only
 pooling tags not tag files?
 
 Thanks,
 
 john
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Ryan Lubke [EMAIL PROTECTED]
Sun Microsystems, Inc.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit:jakarta-servletapi-5/jsr154/src/share/javax/servlet/http HttpUtils.java

2002-12-13 Thread Ryan Lubke
Yes it should.  That's twice I've done that now.  

On Fri, 2002-12-13 at 12:56, Jason Hunter wrote:
 Shouldn't that be amp; instead?
 
 -jh-
 
 [EMAIL PROTECTED] wrote:
  
  jfarcand2002/12/13 08:47:29
  
Modified:jsr154/src/share/javax/servlet/http HttpUtils.java
Log:
Doclets bombs when processing this file (minor fix)
  
Submitted by: Ryan Lubke
  
Revision  ChangesPath
1.3   +1 -1  
jakarta-servletapi-5/jsr154/src/share/javax/servlet/http/HttpUtils.java
  
Index: HttpUtils.java
===
RCS file: 
/home/cvs/jakarta-servletapi-5/jsr154/src/share/javax/servlet/http/HttpUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HttpUtils.java15 Oct 2002 21:39:44 -  1.2
+++ HttpUtils.java13 Dec 2002 16:47:28 -  1.3
@@ -104,7 +104,7 @@
  * The query string should be in the form of a string
  * packaged by the GET or POST method, that is, it
  * should have key-value pairs in the form ikey=value/i,
- * with each pair separated from the next by a  character.
+ * with each pair separated from the next by a apos character.
  *
  * pA key can appear more than once in the query string
  * with different values. However, the key appears only once in
  
  
  
  
  --
  To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
-- 
Ryan Lubke [EMAIL PROTECTED]
Sun Microsystems, Inc.


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: cvs commit:jakarta-servletapi-5/jsr154/src/share/javax/servlet/http HttpUtils.java

2002-12-13 Thread Ryan Lubke
You still missed the terminating ';' :)

On Fri, 2002-12-13 at 13:01, [EMAIL PROTECTED] wrote:
 jfarcand2002/12/13 10:01:54
 
   Modified:jsr154/src/share/javax/servlet/http HttpUtils.java
   Log:
   amp instead (thanks Jason).
   
   Revision  ChangesPath
   1.4   +1 -1  
jakarta-servletapi-5/jsr154/src/share/javax/servlet/http/HttpUtils.java
   
   Index: HttpUtils.java
   ===
   RCS file: 
/home/cvs/jakarta-servletapi-5/jsr154/src/share/javax/servlet/http/HttpUtils.java,v
   retrieving revision 1.3
   retrieving revision 1.4
   diff -u -r1.3 -r1.4
   --- HttpUtils.java  13 Dec 2002 16:47:28 -  1.3
   +++ HttpUtils.java  13 Dec 2002 18:01:54 -  1.4
   @@ -104,7 +104,7 @@
 * The query string should be in the form of a string
 * packaged by the GET or POST method, that is, it
 * should have key-value pairs in the form ikey=value/i,
   - * with each pair separated from the next by a apos character.
   + * with each pair separated from the next by a amp character.
 *
 * pA key can appear more than once in the query string
 * with different values. However, the key appears only once in 
   
   
   
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
-- 
Ryan Lubke [EMAIL PROTECTED]
Sun Microsystems, Inc.


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




[PATCH][JASPER2] Simple patch for one of the resource errormessages.

2002-11-20 Thread Ryan Lubke
I think that the following error message is incorrect:

 - Scripting elements ( %@, %!, %=, % ) are disallowed here.

Since directives (%@) are not scripting elements.

I've attached a patch to correct the messages.properties.




Index: messages.properties
===
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
retrieving revision 1.60
diff -u -r1.60 messages.properties
--- messages.properties	16 Nov 2002 04:20:10 -	1.60
+++ messages.properties	20 Nov 2002 23:47:23 -
@@ -266,7 +266,7 @@
 jsp.error.empty.body.not.allowed=Empty body not allowed for {0}
 jsp.error.jspbody.required=Must use jsp:body to specify tag body for {0} if jsp:attribute is used.
 jsp.error.jspbody.emptybody.only=The {0} tag can only have jsp:attribute in its body.
-jsp.error.no.scriptlets=Scripting elements ( %@, %!, %=, % ) are disallowed here.
+jsp.error.no.scriptlets=Scripting elements ( %!, %=, % ) are disallowed here.
 jsp.error.internal.unexpected_node_type=Internal Error: Unexpected node type encountered
 jsp.error.tld.fn.invalid.signature=Invalid syntax for function signature in TLD.  Tag Library: {0}, Function: {1}
 jsp.error.tld.fn.duplicate.name=Duplicate function name {0} in tag library {1}


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


Re: cvs commit:jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtimePageContextImpl.java

2002-11-06 Thread Ryan Lubke
 of these.
}
   -
   +
return this.expressionEvaluator;
}

public void handlePageException(Exception ex)
   -throws IOException, ServletException 
   +throws IOException, ServletException
{
   // Should never be called since handleException() called with a
   // Throwable in the generated servlet.
   @@ -553,7 +554,7 @@
}

public void handlePageException(Throwable t)
   -throws IOException, ServletException 
   +throws IOException, ServletException
{
   if (t == null) throw new NullPointerException(null Throwable);

   @@ -563,9 +564,11 @@
   // Do not set the javax.servlet.error.exception attribute here
   // (instead, set in the generated servlet code for the error page)
   // in order to prevent the ErrorReportValve, which is invoked as
   -   // part of forwarding the request to the error page, from 
   +   // part of forwarding the request to the error page, from
   // throwing it if the response has not been committed (the response
   // will have been committed if the error page is a JSP page).
   +Object 
origException=request.getAttribute(javax.servlet.error.exception);
   +
   request.setAttribute(javax.servlet.jsp.jspException, t);
   request.setAttribute(javax.servlet.error.status_code,
   new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
   @@ -578,6 +581,19 @@
} catch (IllegalStateException ise) {
include(errorPageURL);
}
   +// The error page could be inside an include.
   +
   +Object 
newException=request.getAttribute(javax.servlet.error.exception);
   +
   +if( (newException!= null)  (newException==origException) ) {
   +request.removeAttribute(javax.servlet.error.exception);
   +}
   +
   +// now clear the error code - to prevent double handling.
   +request.removeAttribute(javax.servlet.error.status_code);
   +request.removeAttribute(javax.servlet.error.request_uri);
   +request.removeAttribute(javax.servlet.error.status_code);
   +request.removeAttribute(javax.servlet.jsp.jspException);

   } else {
// Otherwise throw the exception wrapped inside a ServletException.
   @@ -601,19 +617,19 @@
/**
 * VariableResolver interface
 */
   -public Object resolveVariable( String pName, Object pContext ) 
   +public Object resolveVariable( String pName, Object pContext )
throws ELException
{
// Note: pContext will be going away.
try {
   -return PageContextImpl.variableResolver.resolveVariable( 
   +return PageContextImpl.variableResolver.resolveVariable(
pName, this );
}
catch( org.apache.jasper.runtime.el.jstl.ELException e ) {
throw new ELException( e );
}
}
   -
   +
/**
 * Proprietary method to evaluate EL expressions.
 * XXX - This method should go away once the EL interpreter moves
   @@ -627,16 +643,16 @@
 * @param defaultPrefix Default prefix for this evaluation
 * @return The result of the evaluation
 */
   -public static Object proprietaryEvaluate( String expression, 
   +public static Object proprietaryEvaluate( String expression,
Class expectedType, PageContext pageContext,
   ProtectedFunctionMapper functionMap, String defaultPrefix )
throws ELException
{
   java.util.HashMap funcMap =
   (functionMap == null)? null: functionMap.getFnMap();
   -   
   +
try {
   -return PageContextImpl.proprietaryEvaluator.evaluate( unknown, 
   +return PageContextImpl.proprietaryEvaluator.evaluate( unknown,
expression, expectedType, null, pageContext,
   funcMap, defaultPrefix );
}
   @@ -654,7 +670,7 @@
return null;
}
}
   -
   +
/*
 * fields
 */
   
   
   
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
 For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
-- 
Ryan Lubke [EMAIL PROTECTED]
Sun Microsystems, Inc.


--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




Re: cvs commit:jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtimePageContextImpl.java

2002-11-06 Thread Ryan Lubke
 
   +// no need to synchronize - not a big deal even if we create
// two of these.
}
   -
   +
return this.expressionEvaluator;
}

public void handlePageException(Exception ex)
   -throws IOException, ServletException 
   +throws IOException, ServletException
{
   // Should never be called since handleException() called with a
   // Throwable in the generated servlet.
   @@ -553,7 +554,7 @@
}

public void handlePageException(Throwable t)
   -throws IOException, ServletException 
   +throws IOException, ServletException
{
   if (t == null) throw new NullPointerException(null Throwable);

   @@ -563,9 +564,11 @@
   // Do not set the javax.servlet.error.exception attribute here
   // (instead, set in the generated servlet code for the error page)
   // in order to prevent the ErrorReportValve, which is invoked as
   -   // part of forwarding the request to the error page, from 
   +   // part of forwarding the request to the error page, from
   // throwing it if the response has not been committed (the response
   // will have been committed if the error page is a JSP page).
   +Object 
origException=request.getAttribute(javax.servlet.error.exception);
   +
   request.setAttribute(javax.servlet.jsp.jspException, t);
   request.setAttribute(javax.servlet.error.status_code,
   new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
   @@ -578,6 +581,19 @@
} catch (IllegalStateException ise) {
include(errorPageURL);
}
   +// The error page could be inside an include.
   +
   +Object 
newException=request.getAttribute(javax.servlet.error.exception);
   +
   +if( (newException!= null)  (newException==origException) ) {
   +request.removeAttribute(javax.servlet.error.exception);
   +}
   +
   +// now clear the error code - to prevent double handling.
   +request.removeAttribute(javax.servlet.error.status_code);
   +request.removeAttribute(javax.servlet.error.request_uri);
   +request.removeAttribute(javax.servlet.error.status_code);
   +request.removeAttribute(javax.servlet.jsp.jspException);

   } else {
// Otherwise throw the exception wrapped inside a ServletException.
   @@ -601,19 +617,19 @@
/**
 * VariableResolver interface
 */
   -public Object resolveVariable( String pName, Object pContext ) 
   +public Object resolveVariable( String pName, Object pContext )
throws ELException
{
// Note: pContext will be going away.
try {
   -return PageContextImpl.variableResolver.resolveVariable( 
   +return PageContextImpl.variableResolver.resolveVariable(
pName, this );
}
catch( org.apache.jasper.runtime.el.jstl.ELException e ) {
throw new ELException( e );
}
}
   -
   +
/**
 * Proprietary method to evaluate EL expressions.
 * XXX - This method should go away once the EL interpreter moves
   @@ -627,16 +643,16 @@
 * @param defaultPrefix Default prefix for this evaluation
 * @return The result of the evaluation
 */
   -public static Object proprietaryEvaluate( String expression, 
   +public static Object proprietaryEvaluate( String expression,
Class expectedType, PageContext pageContext,
   ProtectedFunctionMapper functionMap, String defaultPrefix )
throws ELException
{
   java.util.HashMap funcMap =
   (functionMap == null)? null: functionMap.getFnMap();
   -   
   +
try {
   -return PageContextImpl.proprietaryEvaluator.evaluate( unknown, 
   +return PageContextImpl.proprietaryEvaluator.evaluate( unknown,
expression, expectedType, null, pageContext,
   funcMap, defaultPrefix );
}
   @@ -654,7 +670,7 @@
return null;
}
}
   -
   +
/*
 * fields
 */
   
   
   
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
 For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
-- 
Ryan Lubke [EMAIL PROTECTED]
Sun Microsystems, Inc.


--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




[PATCH][jakarta-servletapi-5/jsr152] Documentation Patch

2002-10-10 Thread Ryan Lubke

Update to clarify return values of TagVariableInfo.

 - getClassName() will return java.lang.String if
   the variable-class element is not specified.

 - getDeclare() will return true if the declare
   element is not specified.

 - getScope() will return NESTED as the scope if
   scope is not specified.






Index: TagVariableInfo.java
===
RCS file: /home/cvs/jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/TagVariableInfo.java,v
retrieving revision 1.2
diff -u -r1.2 TagVariableInfo.java
--- TagVariableInfo.java	19 Aug 2002 16:29:51 -	1.2
+++ TagVariableInfo.java	10 Oct 2002 01:02:08 -
@@ -139,7 +139,8 @@
 /**
  * The body of the lt;variable-classgt; element.  
  *
- * @return The name of the class of the variable
+ * @return The name of the class of the variable or
+ * 'java.lang.String' if not defined in the TLD.
  */
 
 public String getClassName() {
@@ -149,7 +150,8 @@
 /**
  * The body of the lt;declaregt; element
  *
- * @return Whether the variable is to be declared or not
+ * @return Whether the variable is to be declared or not.
+ * If not defined in the TLD, 'true' will be returned.
  */
 
 public boolean getDeclare() {
@@ -159,7 +161,9 @@
 /**
  * The body of the lt;scopegt; element
  *
- * @return The scope to give the variable.
+ * @return The scope to give the variable.  NESTED
+ * scope will be returned if not defined in 
+ * the TLD.
  */
 
 public int getScope() {



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[PATCH][jakarta-servletapi-5/jsr152] Resubmit of documentation path.

2002-10-10 Thread Ryan Lubke

Please use the attached patch instead of the one I previously posted.

Changes

TagVariableInfo
  - getClassName() will return java.lang.String if
the variable-class element is not specified.

  - getDeclare() will return true if the declare
element is not specified.

  - getScope() will return NESTED as the scope if
scope is not specified.

TagLibraryInfo

  - Changed the directive from include to taglib in
description of getShortName().

  - Minor rewording of getReliableURN for clarity.



Thanks,

-rl



Index: TagLibraryInfo.java
===
RCS file: /home/cvs/jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/TagLibraryInfo.java,v
retrieving revision 1.3
diff -u -r1.3 TagLibraryInfo.java
--- TagLibraryInfo.java	20 Aug 2002 21:08:24 -	1.3
+++ TagLibraryInfo.java	10 Oct 2002 23:38:29 -
@@ -148,7 +148,7 @@
 /**
  * The preferred short name (prefix) as indicated in the TLD.
  * This may be used by authoring tools as the preferred prefix
- * to use when creating an include directive for this library.
+ * to use when creating an taglib directive for this library.
  *
  * @return the preferred short name for the library
  */
@@ -157,10 +157,9 @@
 }
 
 /**
- * The reliable URN indicated in the TLD.
+ * The reliable URN indicated in the TLD (the uri element).
  * This may be used by authoring tools as a global identifier
- * (the uri attribute) to use when creating a taglib directive
- * for this library.
+ * to use when creating a taglib directive for this library.
  *
  * @return a reliable URN to a TLD like this
  */
Index: TagVariableInfo.java
===
RCS file: /home/cvs/jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/TagVariableInfo.java,v
retrieving revision 1.2
diff -u -r1.2 TagVariableInfo.java
--- TagVariableInfo.java	19 Aug 2002 16:29:51 -	1.2
+++ TagVariableInfo.java	10 Oct 2002 23:38:30 -
@@ -139,7 +139,8 @@
 /**
  * The body of the lt;variable-classgt; element.  
  *
- * @return The name of the class of the variable
+ * @return The name of the class of the variable or
+ * 'java.lang.String' if not defined in the TLD.
  */
 
 public String getClassName() {
@@ -149,7 +150,8 @@
 /**
  * The body of the lt;declaregt; element
  *
- * @return Whether the variable is to be declared or not
+ * @return Whether the variable is to be declared or not.
+ * If not defined in the TLD, 'true' will be returned.
  */
 
 public boolean getDeclare() {
@@ -159,7 +161,9 @@
 /**
  * The body of the lt;scopegt; element
  *
- * @return The scope to give the variable.
+ * @return The scope to give the variable.  NESTED
+ * scope will be returned if not defined in 
+ * the TLD.
  */
 
 public int getScope() {



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


Re: cvs commit:jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtimePageContextImpl.java

2002-09-30 Thread Ryan Lubke

Jan,

Think it would make more sense if the message was soemthing like
Name or attribute value was null?



On Mon, 2002-09-30 at 19:58, [EMAIL PROTECTED] wrote:
 luehe   2002/09/30 16:58:58
 
   Modified:jasper2/src/share/org/apache/jasper/runtime
 PageContextImpl.java
   Log:
   Fixed 13140: Compliance issue - PageContext.setAttribute, under
   certain circumstances, fails to throw an NPE when the value provided
   is null
   
   Revision  ChangesPath
   1.23  +16 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
   
   Index: PageContextImpl.java
   ===
   RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
   retrieving revision 1.22
   retrieving revision 1.23
   diff -u -r1.22 -r1.23
   --- PageContextImpl.java30 Sep 2002 23:45:03 -  1.22
   +++ PageContextImpl.java30 Sep 2002 23:58:58 -  1.23
   @@ -232,11 +232,16 @@
}

public Object getAttribute(String name) {
   +
   +   if (name == null) throw new NullPointerException(Null name);
   return attributes.get(name);
}


public Object getAttribute(String name, int scope) {
   +
   +   if (name == null) throw new NullPointerException(Null name);
   +
   switch (scope) {
   case PAGE_SCOPE:
   return attributes.get(name);
   @@ -261,11 +266,19 @@


public void setAttribute(String name, Object attribute) {
   +
   +   if (name == null || attribute == null)
   +   throw new NullPointerException(Null name or attribute value);
   +
   attributes.put(name, attribute);
}


public void setAttribute(String name, Object o, int scope) {
   +
   +   if (name == null || o == null)
   +   throw new NullPointerException(Null name or attribute value);
   +
   switch (scope) {
   case PAGE_SCOPE:
   attributes.put(name, o);
   
   
   
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Spec question: RE BUG 12052

2002-08-29 Thread Ryan Lubke

On Thu, 2002-08-29 at 11:13, Craig R. McClanahan wrote:
 
 
 On Thu, 29 Aug 2002, Bill Barker wrote:
 
  FWIW, I agree that the 2.4 servlet-spec and the CGI-spec are out of sync
  here.  If I actually thought that any members of the JCP were subscribed to
  this list, I'd think to ask for clarification before 2.4 went final. :)
 
 
 The way to ask would be to send feedback to
 [EMAIL PROTECTED].

I've forwarded the thread to the spec lead for 2.4 and it has been
brought up to the expert group.  However, as Craig mentioned, the best
way to ask is using the email address he listed.





--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Spec question: RE BUG 12052

2002-08-28 Thread Ryan Lubke

On Wed, 2002-08-28 at 17:05, Ignacio J. Ortega wrote:
  De: Ryan Lubke [mailto:[EMAIL PROTECTED]]
  Enviado el: 28 de agosto de 2002 20:29
  Para: Tomcat Developers List
  Asunto: RE: Spec question: RE BUG 12052
  
  
  
   The port MUST be the one in the Host Header if one is 
  present,and should
   be present if the request is HTTP1.1 compliant, 
   
  What if the Host header is supplied, but the value is empty.  
  This seems
  legal per section 14.23 of the HTTP/1.1 RFC?
  
  
 
 1) For me after ( another ) reading of rfc2616, from the point you named
 and following the references given there, i've found that in 5.2 seems
 to say that a empty Host: header must be responded by 400 because empty
 it is not a valid Host name..

But an empty host header does have a meaning, i.e. the target resource
is being identified via an IP address and not a host name.

I'm reading this that if the host, probably a virtual host on the server
, can't be determined, then return the 400.  

 
 2) Checked Apache2 and it gives a 200 when issuing a GET / with empty
 Host:, at it replies a 200.
 
 I think your problem is related to issuing a 30X after a request with
 empty Host: header?, well it's really a border case...
 
 One never can assure if a Location header will have correct information,
 because is mandated to follow a filled Host hdr if present, sending a
 301 with a guessed Host name in the Location, shouldnt be the worst
 solution to the problem..
 
 I dont know how to make apache2 (anyone?) issue a unconditional redirect
 (301) after a request, but i suspect that if the Host Header is empty in
 such a request, it will try to form a correct Location header from the
 information it has at hand ( ServerName and his own local port), with
 Firewalls and NATs possibily an incorrect one? maybe..
 
 In a vote, i would vote to make Tomcat issue a 400 in case of a empty
 Host header..

Is this such a good idea?

Take a look at the following:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7441

Apache originally would return a 400 on an empty Host header.
The modified the behavior to what you're currently seeing.

The interpretation could be incorrect, but I would be more inclined
to follow a solid HTTP server implementation such as Apache.

 
 Saludos ,
 Ignacio J. Ortega
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: HTTP Host Request header and TC Connectors]

2002-08-28 Thread Ryan Lubke

On Wed, 2002-08-28 at 17:32, Bill Barker wrote:
 
 - Original Message -
 From: Ryan Lubke [EMAIL PROTECTED]
 To: tcdev [EMAIL PROTECTED]
 Sent: Wednesday, August 28, 2002 9:43 AM
 Subject: [Fwd: HTTP Host Request header and TC Connectors]
 
 
  By the way the quote was pulled from section 14.23 of RFC 2616.
 
  =
 
  Hi,
 
  Looking for a little input from the HTTP gurus here.
 
  Given the following:
 
 If the requested URI does not include an Internet host
  name for the service being requested, then the Host header
  field MUST be given with an empty value.
 
  So, I'm looking for other interpretations of what the above means.
 
  My interpretation at this point is the serviced targeted by the
  request URI is identified via an IP address vs a host name, that
  the Host request header will be sent but with an empty value.
 
  Does anyone agree/disagree?
 
  The reason I ask is that if an empty Host header is sent to Tomcat, and
  a redirect is sent back, the value of the Location header is useless,
  i.e.  http:///index.jsp.
 
 My reading of 14.23 says that this is exactly what should happen, since the
 only (valid) way that this could happen is if the user originally requested
 http:///.  Since the client was capable of resolving that request, it should
 be able to resolve the value of the Location header.

Actually, the client doesn't request http:///.  
Example below.

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET / HTTP/1.1
Host: 

HTTP/1.1 302 Moved Temporarily
Content-Type: text/html
Date: Wed, 28 Aug 2002 23:01:29 GMT
Transfer-Encoding: chunked
Location: http:///index.html
Server: Apache Tomcat/4.0.4 (HTTP/1.1 Connector)

Perhaps I missed your point.
 
 
  I'm trying to determine if this is a problem with the client
  implementation's interpretation of the spec, or a problem with Tomcat.
 
  Thanks,
 
  -rl
 
 
 
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




[Patch][Tomcat 4/5] Small issue with ErrorDispatcherValve

2002-08-13 Thread Ryan Lubke

Given the following:

web.xml with error-page entries for the following Exception types:

   - IllegalStateException
   - ServletException

If a Servlet generates a RuntimeException, it is wrapped by a
ServletException.  Since there is an entry for ServletException 
in the web.xml, the actual root cause (in this case, an
IllegalStateException) was never unwrapped, thus leading to unexpected
behavior.

I made a simple modification to the logic so that if the throwable
passed to the ErrorDispatcherValve is a ServletException, it will
attempt to get the root cause.  If the root cause is null, then proceed
with the error page lookup with the ServletException as the throwable 
object, otherwise, use the root cause for the error page lookup.

I've tested this using my own tests as well as those that Watchdog 4.0
has for this area as well, and all seems OK.

If I missed something here, please let me know.  I'm struggling to stay
awake here :)

-rl

PS.  I've attached some very simple patches for some javadoc warnings I
noticed during the build process.




Index: ErrorDispatcherValve.java
===
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves/ErrorDispatcherValve.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ErrorDispatcherValve.java
--- ErrorDispatcherValve.java	18 Jul 2002 16:47:42 -	1.1.1.1
+++ ErrorDispatcherValve.java	14 Aug 2002 03:04:47 -
@@ -212,20 +212,20 @@
  */
 protected void throwable(Request request, Response response,
  Throwable throwable) {
-
 Context context = request.getContext();
 if (context == null)
 return;
-
+
 Throwable realError = throwable;
-ErrorPage errorPage = findErrorPage(context, realError);
-if ((errorPage == null)  (realError instanceof ServletException)) {
+
+if (realError instanceof ServletException) {
 realError = ((ServletException) realError).getRootCause();
-if (realError != null)
-errorPage = findErrorPage(context, realError);
-else
+if (realError == null) {
 realError = throwable;
-}
+}
+} 
+
+ErrorPage errorPage = findErrorPage(context, realError);
 
 if (errorPage != null) {
 response.setAppCommitted(false);
@@ -237,7 +237,7 @@
 sreq.setAttribute(Globals.ERROR_MESSAGE_ATTR,
   throwable.getMessage());
 sreq.setAttribute(Globals.EXCEPTION_ATTR,
-  throwable);
+  realError);
 Wrapper wrapper = request.getWrapper();
 if (wrapper != null)
 sreq.setAttribute(Globals.SERVLET_NAME_ATTR,
@@ -246,7 +246,7 @@
 sreq.setAttribute(Globals.EXCEPTION_PAGE_ATTR,
   ((HttpServletRequest) sreq).getRequestURI());
 sreq.setAttribute(Globals.EXCEPTION_TYPE_ATTR,
-  throwable.getClass());
+  realError.getClass());
 if (custom(request, response, errorPage)) {
 try {
 sresp.flushBuffer();


Index: Node.java
===
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
retrieving revision 1.23
diff -u -r1.23 Node.java
--- Node.java	31 Jul 2002 21:42:27 -	1.23
+++ Node.java	14 Aug 2002 03:06:57 -
@@ -291,7 +291,7 @@
 	}
 
 	/**
-	 * @ return The enclosing root to this root.  Usually represents the
+	 * @return The enclosing root to this root.  Usually represents the
 	 * page that includes this one.
 	 */
 	public Root getParentRoot() {


Index: BodyContentImpl.java
===
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java,v
retrieving revision 1.4
diff -u -r1.4 BodyContentImpl.java
--- BodyContentImpl.java	10 Jun 2002 20:12:27 -	1.4
+++ BodyContentImpl.java	14 Aug 2002 03:07:57 -
@@ -518,7 +518,7 @@
  * Note: this is after evaluation!!  There are no scriptlets,
  * etc in this stream.
  *
- * @returns the value of this BodyJspWriter as a Reader
+ * @return the value of this BodyJspWriter as a Reader
  */
 public Reader getReader() {
 return new CharArrayReader (cb, 0, nextChar);
@@ -529,7 +529,7 @@
  * Note: this is after evaluation!!  There are no scriptlets,
  * etc in this stream.
  *
- * @returns the value of the BodyJspWriter as a String
+ * @return the value of the BodyJspWriter as a String
  */
 public String getString() {
 return new String(cb, 0, nextChar);



--
To unsubscribe, e-mail:   mailto:[EMAIL 

[Fwd: HEAD brach of jasper]

2002-06-27 Thread Ryan Lubke

Hi,

Has anyone been able to get any JSP's running on the HEAD brach of
tomcat 4 using jasper (not jasper2).

I consistently receive:


java.lang.NullPointerException
at
org.apache.jasper.compiler.TldLocationsCache.processJars(TldLocationsCache.java:203)
at
org.apache.jasper.compiler.TldLocationsCache.(TldLocationsCache.java:139)
at
org.apache.jasper.EmbededServletOptions.(EmbededServletOptions.java:414)
at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:128)

but looking at the line 203 of TldLocationsCache, I don't see why this
occurs.





--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




[PATCH - Jasper2] Minor compliance fix and some resource bundle keyfixes

2002-06-27 Thread Ryan Lubke

Hi.

Two fixes:


1.  JspDocumentParser -  Enforce the fact that relative taglib URI's
(those that start with /) are prefixed by urn:jsptld:.

See section 5.3.5 of the 1.2 spec, as well as the examples on
page 92.

I've added the failure message to messages.properties and
messages_es.properties.  Can someone point me to some online
tool that can do the necessary conversion for the
messages_ja.properties?

2.  During testing of the above patch using Watchdog, some resource 
bundle key lookups failed.  

I've corrected the keys in Validator.java based on those found in
the resource bundles.

Thanks,

-rl




Index: Validator.java
===
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
retrieving revision 1.10
diff -u -r1.10 Validator.java
--- Validator.java	20 Jun 2002 23:48:23 -	1.10
+++ Validator.java	27 Jun 2002 23:21:56 -
@@ -138,14 +138,14 @@
 
 		if (language.equals(attr)) {
 		if (languageSeen)
-			err.jspError(n, jsp.error.language.multiple);
+			err.jspError(n, jsp.error.page.multiple.language);
 		languageSeen = true;
 		if (!java.equalsIgnoreCase(value))
 			err.jspError(n, jsp.error.language.nonjava);
 		pageInfo.setLanguage(value);
 		} else if (extends.equals(attr)) {
 		if (extendsSeen)
-			err.jspError(n, jsp.error.extends.multiple);
+			err.jspError(n, jsp.error.page.multiple.extends);
 		extendsSeen = true;
 		pageInfo.setExtends(value);
 		/*
@@ -158,7 +158,7 @@
 			n.addImport(value);
 		} else if (contentType.equals(attr)) {
 		if (contentTypeSeen) 
-			err.jspError(n, jsp.error.contentType.multiple);
+			err.jspError(n, jsp.error.page.multiple.contenttypes);
 		contentTypeSeen = true;
 		pageInfo.setContentType(value);
 		} else if (session.equals(attr)) {
@@ -173,7 +173,7 @@
 			err.jspError(n, jsp.error.session.invalid);
 		} else if (buffer.equals(attr)) {
 		if (bufferSeen)
-			err.jspError(n, jsp.error.buffer.multiple);
+			err.jspError(n, jsp.error.page.multiple.buffer);
 		bufferSeen = true;
 
 		if (none.equalsIgnoreCase(value))
@@ -192,7 +192,7 @@
 		}
 		} else if (autoFlush.equals(attr)) {
 		if (autoFlushSeen)
-			err.jspError(n, jsp.error.autoFlush.multiple);
+			err.jspError(n, jsp.error.page.multiple.autoflush);
 		autoFlushSeen = true;
 		if (true.equalsIgnoreCase(value))
 			pageInfo.setAutoFlush(true);
@@ -202,7 +202,7 @@
 			err.jspError(n, jsp.error.autoFlush.invalid);
 		} else if (isthreadSafe.equals(attr)) {
 		if (isThreadSafeSeen)
-			err.jspError(n, jsp.error.isThreadSafe.multiple);
+			err.jspError(n, jsp.error.page.multiple.threadsafe);
 		isThreadSafeSeen = true;
 		if (true.equalsIgnoreCase(value))
 			pageInfo.setThreadSafe(true);
@@ -212,7 +212,7 @@
 			err.jspError(n, jsp.error.isThreadSafe.invalid);
 		} else if (isErrorPage.equals(attr)) {
 		if (isErrorPageSeen)
-			err.jspError(n, jsp.error.isErrorPage.multiple);
+			err.jspError(n, jsp.error.page.multiple.iserrorpage);
 		isErrorPageSeen = true;
 		if (true.equalsIgnoreCase(value))
 			pageInfo.setIsErrorPage(true);
@@ -222,7 +222,7 @@
 			err.jspError(n, jsp.error.isErrorPage.invalid);
 		} else if (errorPage.equals(attr)) {
 		if (errorPageSeen) 
-			err.jspError(n, jsp.error.errorPage.multiple);
+			err.jspError(n, jsp.error.page.multiple.errorpage);
 		errorPageSeen = true;
 		pageInfo.setErrorPage(value);
 		} else if (info.equals(attr)) {
@@ -231,7 +231,7 @@
 		infoSeen = true;
 		} else if (pageEncoding.equals(attr)) {
 		if (pageEncodingSeen) 
-			err.jspError(n, jsp.error.pageEncoding.multiple);
+			err.jspError(n, jsp.error.page.multiple.pageencoding);
 		pageEncodingSeen = true;
 		pageInfo.setPageEncoding(value);
 		}


Index: JspDocumentParser.java
===
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
retrieving revision 1.3
diff -u -r1.3 JspDocumentParser.java
--- JspDocumentParser.java	20 Jun 2002 23:02:16 -	1.3
+++ JspDocumentParser.java	27 Jun 2002 23:04:08 -
@@ -434,6 +434,15 @@
 
 		// get the uri
 		String uri = attrs.getValue(i);
+
+// make sure that a relative path is prefixed
+// with urn:jsptld:path
+if (uri.charAt(0) == '/') {
+throw new JasperException(
+err.getString(jsp.error.xml.taglib.uri.not_prefixed,
+  uri));
+}
+
 		if (uri.startsWith(URN_JSPTLD)) {
 		// uri value is of the form urn:jsptld:path
 		uri = uri.substring(URN_JSPTLD.length());


Index: messages_es.properties
===
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_es.properties,v
retrieving 

[Fwd: [PATCH - Jasper2] Minor compliance fix and some resourcebundle key fixes]

2002-06-27 Thread Ryan Lubke

Reposting messages.patch

-Forwarded Message-

From: Ryan Lubke [EMAIL PROTECTED]
To: tcdev [EMAIL PROTECTED]
Subject: [PATCH - Jasper2] Minor compliance fix and some resource bundle key fixes
Date: 27 Jun 2002 19:30:55 -0500

Hi.

Two fixes:


1.  JspDocumentParser -  Enforce the fact that relative taglib URI's
(those that start with /) are prefixed by urn:jsptld:.

See section 5.3.5 of the 1.2 spec, as well as the examples on
page 92.

I've added the failure message to messages.properties and
messages_es.properties.  Can someone point me to some online
tool that can do the necessary conversion for the
messages_ja.properties?

2.  During testing of the above patch using Watchdog, some resource 
bundle key lookups failed.  

I've corrected the keys in Validator.java based on those found in
the resource bundles.

Thanks,

-rl





Index: Validator.java
===
RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
retrieving revision 1.10
diff -u -r1.10 Validator.java
--- Validator.java  20 Jun 2002 23:48:23 -  1.10
+++ Validator.java  27 Jun 2002 23:21:56 -
@@ -138,14 +138,14 @@
 
if (language.equals(attr)) {
if (languageSeen)
-   err.jspError(n, jsp.error.language.multiple);
+   err.jspError(n, jsp.error.page.multiple.language);
languageSeen = true;
if (!java.equalsIgnoreCase(value))
err.jspError(n, jsp.error.language.nonjava);
pageInfo.setLanguage(value);
} else if (extends.equals(attr)) {
if (extendsSeen)
-   err.jspError(n, jsp.error.extends.multiple);
+   err.jspError(n, jsp.error.page.multiple.extends);
extendsSeen = true;
pageInfo.setExtends(value);
/*
@@ -158,7 +158,7 @@
n.addImport(value);
} else if (contentType.equals(attr)) {
if (contentTypeSeen) 
-   err.jspError(n, jsp.error.contentType.multiple);
+   err.jspError(n, jsp.error.page.multiple.contenttypes);
contentTypeSeen = true;
pageInfo.setContentType(value);
} else if (session.equals(attr)) {
@@ -173,7 +173,7 @@
err.jspError(n, jsp.error.session.invalid);
} else if (buffer.equals(attr)) {
if (bufferSeen)
-   err.jspError(n, jsp.error.buffer.multiple);
+   err.jspError(n, jsp.error.page.multiple.buffer);
bufferSeen = true;
 
if (none.equalsIgnoreCase(value))
@@ -192,7 +192,7 @@
}
} else if (autoFlush.equals(attr)) {
if (autoFlushSeen)
-   err.jspError(n, jsp.error.autoFlush.multiple);
+   err.jspError(n, jsp.error.page.multiple.autoflush);
autoFlushSeen = true;
if (true.equalsIgnoreCase(value))
pageInfo.setAutoFlush(true);
@@ -202,7 +202,7 @@
err.jspError(n, jsp.error.autoFlush.invalid);
} else if (isthreadSafe.equals(attr)) {
if (isThreadSafeSeen)
-   err.jspError(n, jsp.error.isThreadSafe.multiple);
+   err.jspError(n, jsp.error.page.multiple.threadsafe);
isThreadSafeSeen = true;
if (true.equalsIgnoreCase(value))
pageInfo.setThreadSafe(true);
@@ -212,7 +212,7 @@
err.jspError(n, jsp.error.isThreadSafe.invalid);
} else if (isErrorPage.equals(attr)) {
if (isErrorPageSeen)
-   err.jspError(n, jsp.error.isErrorPage.multiple);
+   err.jspError(n, jsp.error.page.multiple.iserrorpage);
isErrorPageSeen = true;
if (true.equalsIgnoreCase(value))
pageInfo.setIsErrorPage(true);
@@ -222,7 +222,7 @@
err.jspError(n, jsp.error.isErrorPage.invalid);
} else if (errorPage.equals(attr)) {
if (errorPageSeen) 
-   err.jspError(n, jsp.error.errorPage.multiple);
+   err.jspError(n, jsp.error.page.multiple.errorpage);
errorPageSeen = true;
pageInfo.setErrorPage(value);
} else if (info.equals(attr)) {
@@ -231,7 +231,7 @@
infoSeen = true;
} else if (pageEncoding.equals(attr)) {
if (pageEncodingSeen

Re: 5.0 proposal

2002-06-24 Thread Ryan Lubke


 
  Watchdog is an official TCK

Actually, Watchdog is not an official TCK (just wanted to make this
clear).  It's nothing more than a test suite that uses the same test
source.

However, I do agree that performance analysis in not the goal of
Watchdog.

-rl



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: watchdog, servletapi, karma

2002-06-12 Thread Ryan Lubke

Christopher,

You can send me the Watchdog patches and I'll look them over.

Thanks,

-rl

On Wed, 2002-06-12 at 12:01, Christopher K. St. John wrote:
 GOMEZ Henri wrote:
  
  No, I saw a problem here since servlet-api-4.0 is the OFFICIAL
  servlet 2.3/jsp1.2 API and may not change without (wide) notice.
  
 
  Yes, but there's a difference between changing the API (which
 is the job of the servlet spec jsr team) and fixing bugs in the
 implementation classes. I'd be perfectly happy if somebody else
 would just fix the bug, but nobody seems to be maintaining the
 code at the moment.
 
 
 -- 
 Christopher St. John [EMAIL PROTECTED]
 DistribuTopia http://www.distributopia.com
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




[Fwd: [PATCH] TC 4.0/Coyote locale parsing issue]

2002-03-27 Thread Ryan Lubke

Did some checking and the TC 4.0 HTTP/1.1 and HTTP/1.0 connectors have
the same problem (o.a.c.c.http and o.a.c.c.http10).

I've modified the connectors in question and ran the same set of tests
that I ran against Coyote and all seems well.  Locales with variants are
properly handled.

I've attached patches for all 3 connectors.

-rl

-Forwarded Message-

From: Ryan Lubke [EMAIL PROTECTED]
To: tcdev [EMAIL PROTECTED]
Subject: [PATCH] TC 4.0/Coyote locale parsing issue
Date: 25 Mar 2002 13:35:28 -0500

Hi,

When dealing with preferred locales from a client (Accept-Language), 
the CoyoteRequest class (org.apache.coyote.tomcat4) doesn't correctly
handle locales with variants (i.e. en-IE-EURO).
RFC 2616 states that the following for language-range of
Accept-Language:  
  language-range = ( ( 1*8ALPHA *( - 1*8ALPHA ) ) | * )

So it seems that variants coming in from a client are legal (provided
I've read the BNF properly)

The attached patch seems to correct the issue.

-rl





Index: CoyoteRequest.java
===
RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
retrieving revision 1.11
diff -u -r1.11 CoyoteRequest.java
--- CoyoteRequest.java  19 Mar 2002 20:34:41 -  1.11
+++ CoyoteRequest.java  25 Mar 2002 14:34:54 -
@@ -1987,17 +1987,27 @@
 // Extract the language and country for this entry
 String language = null;
 String country = null;
+String variant = null;
 int dash = entry.indexOf('-');
 if (dash  0) {
 language = entry;
 country = ;
+variant = ;
 } else {
 language = entry.substring(0, dash);
 country = entry.substring(dash + 1);
+int vDash = country.indexOf('-');
+if (vDash  0) {
+String cTemp = country.substring(0, vDash);
+variant = country.substring(vDash + 1);
+country = cTemp;
+} else {
+variant = ;
+}
 }
 
 // Add a new Locale to the list of Locales for this quality level
-Locale locale = new Locale(language, country);
+Locale locale = new Locale(language, country, variant);
 Double key = new Double(-quality);  // Reverse the order
 ArrayList values = (ArrayList) locales.get(key);
 if (values == null) {




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



Index: HttpProcessor.java
===
RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10/HttpProcessor.java,v
retrieving revision 1.8
diff -u -r1.8 HttpProcessor.java
--- HttpProcessor.java  18 Mar 2002 07:15:40 -  1.8
+++ HttpProcessor.java  27 Mar 2002 15:17:59 -
@@ -463,12 +463,19 @@
   while (le.hasMoreElements()) {
 String language = (String)le.nextElement();
 String country = ;
+String variant = ;
 int countryIndex = language.indexOf('-');
 if (countryIndex  -1) {
 country = language.substring(countryIndex + 1).trim();
 language = language.substring(0, countryIndex).trim();
+int vDash = country.indexOf(-);
+if (vDash  0) {
+String cTemp = country.substring(0, vDash);
+variant = country.substring(vDash + 1);
+country = cTemp;
+} 
 }
-request.addLocale(new Locale(language, country));
+request.addLocale(new Locale(language, country, variant));
   }
   }
 } else if (match.equals(cookie)) {


Index: HttpProcessor.java
===
RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
retrieving revision 1.45
diff -u -r1.45 HttpProcessor.java
--- HttpProcessor.java  18 Mar 2002 07:15:40 -  1.45
+++ HttpProcessor.java  27 Mar 2002 15:17:39 -
@@ -499,17 +499,27 @@
 // Extract the language and country for this entry
 String language = null;
 String country = null;
+String variant = null;
 int dash = entry.indexOf('-');
 if (dash  0) {
 language = entry;
 country = ;
+variant = ;
 } else {
 language = entry.substring(0, dash);
 country = entry.substring(dash + 1);
+int vDash = country.indexOf

[PATCH] TC 4.0/Coyote locale parsing issue

2002-03-25 Thread Ryan Lubke

Hi,

When dealing with preferred locales from a client (Accept-Language), 
the CoyoteRequest class (org.apache.coyote.tomcat4) doesn't correctly
handle locales with variants (i.e. en-IE-EURO).
RFC 2616 states that the following for language-range of
Accept-Language:  
  language-range = ( ( 1*8ALPHA *( - 1*8ALPHA ) ) | * )

So it seems that variants coming in from a client are legal (provided
I've read the BNF properly)

The attached patch seems to correct the issue.

-rl




Index: CoyoteRequest.java
===
RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
retrieving revision 1.11
diff -u -r1.11 CoyoteRequest.java
--- CoyoteRequest.java  19 Mar 2002 20:34:41 -  1.11
+++ CoyoteRequest.java  25 Mar 2002 14:34:54 -
@@ -1987,17 +1987,27 @@
 // Extract the language and country for this entry
 String language = null;
 String country = null;
+String variant = null;
 int dash = entry.indexOf('-');
 if (dash  0) {
 language = entry;
 country = ;
+variant = ;
 } else {
 language = entry.substring(0, dash);
 country = entry.substring(dash + 1);
+int vDash = country.indexOf('-');
+if (vDash  0) {
+String cTemp = country.substring(0, vDash);
+variant = country.substring(vDash + 1);
+country = cTemp;
+} else {
+variant = ;
+}
 }
 
 // Add a new Locale to the list of Locales for this quality level
-Locale locale = new Locale(language, country);
+Locale locale = new Locale(language, country, variant);
 Double key = new Double(-quality);  // Reverse the order
 ArrayList values = (ArrayList) locales.get(key);
 if (values == null) {



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


Re: Watchdog problems

2002-01-17 Thread Ryan Lubke

Hi,

I have an idea for a fix.  I'll have this implemented today.

-rl

On Thu, 2002-01-17 at 06:56, Remy Maucherat wrote:
  Hi,
 
  I have some problems to run the Watchdog tests on mod_webapp and I think
 there
  is a problem in watchdog:
  For example:
  +++
   [java] [gtest]  Unable to find the expected header:
 'Content-Type:
  text/plain' in the server's response.
   [java] [gtest]  The following headers were received:
   [java] [gtest] HEADER - Date: Thu, 17 Jan 2002 11:22:24
 GMT
   [java] [gtest] HEADER - Server: Apache/2.0.31-dev (Unix)
  mod_ssl/3.0a0 OpenSSL/0.9.6b
   [java] [gtest] HEADER - Connection: close
   [java] [gtest] HEADER - Content-Type: text/plain;
  charset=ISO-8859-1
   [java] [gtest]  FAIL GET /servlet-tests/Include_1Test HTTP/1.0
  +++
  I DO think that mod_webapp sends a valid Content-Type but watchdog does
 not like
  it!
 
  Any comments?
 
 I agree. ISO-8859-1 is the default encoding, but obviously it can be
 explicitely specified.
 Watchdog is rather not flexible, so I don't know how easy it would be to fix
 this.
 
 Remy
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: [VOTES] Tomcat 4.0.2 beta 1

2001-12-19 Thread Ryan Lubke

Hi,

Did you rebuild/redploy and test with the latest Watchdog?

-rl

On Wed, 2001-12-19 at 11:16, jean-frederic clere wrote:
 Hi,
 
 I have noted that 4 of the jsp tests fail:
 jsp-tests/jsp/tagext/TagSupport/positiveDoStartTagXML.jsp
 jsp-tests/jsp/tagext/TagSupport/positiveDoStartTag.jsp
 jsp-tests/jsp/tagext/TagSupport/positiveDoStartTagXML.jsp
 jsp-tests/jsp/tagext/TagSupport/positiveDoStartTag.jsp
 It sounds like a tag library is missing (in my test environment) the line where
 the exception comes from is
 TagLibraryInfo tlibInfo=tagInfo.getTagLibrary(); 
 From TestTag.java (of jakarta-watchdog-4.0).
 
 
 The WARP part needs a little review...
 
 
 Cheers
 
 Jean-frederic
 
 
 Remy Maucherat wrote:
  
  Hi,
  
  After some delay, I'd like to release the first beta of Tomcat 4.0.2 this
  week (the sooner, the better, so I plan to package the release as soon as
  this vote is considered approved). This release has already been approved,
  and although there are some issues which will need to be addressed before
  4.0.2 final is released, there is no open showstopper problems. A few
  additional fixes may be made before beta 1 is released.
  
  The list of changes and fixes is available at:
  http://cvs.apache.org/viewcvs.cgi/~checkout~/jakarta-tomcat-4.0/Attic/RELEAS
  E-NOTES-4.0.2-B1.txt?rev=1.1.2.4
  
  ballot
  [ ] +1: Make the release
  [ ] -1: I'm opposed to the release until the following issues are fixed:
  
  /ballot
  
  There is also a new feature that has been added in the HEAD branch which
  could be worth porting: the instance pooling for STM servlets. I wrote the
  code as an experiment, but it appears to be working very well (I didn't
  notice any thread safety issues during load testing).
  
  ballot
  [ ] +1: Add the feature to the 4.0 branch
  [ ] -1: Don't add the feature, because:
  
  /ballot
  
  Remy
  
  --
  To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




[PATCH] Tomcat 4.0 BUILDING.txt

2001-12-14 Thread Ryan Lubke

Hi,
After going through the exercise of building TC, I noticed
one issue with the instructions contained in BUILDING.txt.
The download URL referenced in the BUILDING.txt file to obtain
JAXP 1.1 is now stale.

Attached is a possible patch to update the BUILDING.txt
file.

NOTE:  This release of JAXP doesn't include a jaxp.jar, so 
the jaxp.jar variable within the build.properties isn't
really needed, but doesn't appear to affect the build process
if it's left in.




Index: BUILDING.txt
===
RCS file: /home/cvspublic/jakarta-tomcat-4.0/BUILDING.txt,v
retrieving revision 1.15
diff -u -r1.15 BUILDING.txt
--- BUILDING.txt2001/12/01 07:32:59 1.15
+++ BUILDING.txt2001/12/14 19:46:44
@@ -57,17 +57,18 @@
   available, which will be used to actually perform the build.
 
 
-(2) Download and Install the JAXP/1.1 Reference Implementation
+(2) Download and Install the Java XML Pack Binary Distribution
 
-* Download a binary distribution of JAXP 1.1 (Final Version) from:
+* Download a binary distribution of the Java XML Pack:
 
-http://java.sun.com/xml/download.html
+http://java.sun.com/xml/downloads/javaxmlpack.html
 
 * Unpack the binary distribution into a convenient location so that the
-  JAXP/1.1 release resides in its own directory (conventionally named
-  jaxp-1.1.  For the purposes of the remainder of this document, the
-  symbolic name ${jaxp.home} is used to refer to the full pathname of
-  the release directory.
+  Java XML Pack release resides in its own directory (the JAXP libraries
+  reside in the jaxp-1.1.3 subdirectory).  For the purposes of the 
+  remainder of this document, the symbolic name ${jaxp.home} is used 
+  to refer to the full pathname to the jaxp-1.1.3 subdirectory of the 
+  Java XML Pack release directory.
 
 * Make the xalan.jar file of this distribution available to Ant (so that
   it can be used with the style tag) by copying it to ${ant.home}/lib.



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[PATCH] Watchdog 4.0 -- New Filter tests + JSP web.xml fix for DTDreference

2001-12-03 Thread Ryan Lubke

Hello,

In the attached tarball are source and goldenfiles for some new
Filter tests.  Unpack the tarball in the src directory of Watchdog.
Also attached are patches for the servlet-gtest.xml and the web.xml for
the servlet tests.

Also attached is a patch for the jsp web.xml to correct the DTD
reference in the DOCTYPE element.

Comments welcome.

-rl




filter.tar.gz
Description: GNU Zip compressed data

Index: servlet-gtest.xml
===
RCS file: /home/cvspublic/jakarta-watchdog-4.0/src/conf/servlet-gtest.xml,v
retrieving revision 1.19
diff -u -r1.19 servlet-gtest.xml
--- servlet-gtest.xml   2001/07/20 23:07:56 1.19
+++ servlet-gtest.xml   2001/12/03 20:25:15
@@ -10,9 +10,27 @@
 
   !--  Watchdog Servlet tests  --
 
-  !-- javax_servlet_GenericServlet tests --
 
target name=gtestservlet-test
+
+  !-- javax_servlet_Filter tests --
+
+  gtest request=GET /servlet-tests/DoFilterTest HTTP/1.0
+ debug=0 host=${host} port=${port}
+ goldenFile=${wgdir}/javax_servlet/Filter/DoFilterTest.html
+ assertion=The doFilter method of the Filter is called by the container 
+each time a request/response pair is passed through the stack due to a client request 
+for the Servlet in the stack.  Java Servlet Specification v2.3, Sec. 14
+ testStrategy=Client attempts to access a servlet and the filter 
+configured for that servlet should be invoked.
+  /
+
+  gtest request=GET /servlet-tests/InitFilterConfigTest HTTP/1.0
+ debug=0 host=${host} port=${port}
+ goldenFile=${wgdir}/javax_servlet/Filter/InitFilterConfigTest.html
+ assertion=The container calls this method when the Filter is 
+instantiated and passes in a FilterConfig object. Java Servlet Specification v2.3, 
+Sec. 14
+ testStrategy=Client attempts to access a servlet and the filter 
+configured for that servlet.
+  /
+
+  !-- javax_servlet_GenericServlet tests --
+
   gtest request=GET /servlet-tests/DestroyTest HTTP/1.0
debug=0 host=${host} port=${port}  
returnCode=200


Index: web.xml
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/web.xml,v
retrieving revision 1.3
diff -u -r1.3 web.xml
--- web.xml 2000/12/22 18:59:14 1.3
+++ web.xml 2001/12/03 20:25:43
@@ -1,27 +1,85 @@
 ?xml version=1.0 encoding=ISO-8859-1?
 
 !DOCTYPE web-app
-PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
-http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;
+PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
+http://java.sun.com/dtd/web-app_2_3.dtd;
 
 web-app
 context-param
-   param-name
-   OS
-   /param-name
-   param-value
-   ULTRASPARC
-   /param-value
+   param-name
+   OS
+   /param-name
+   param-value
+   ULTRASPARC
+   /param-value
 /context-param
 context-param
-   param-name
-   EDITOR
-   /param-name
-   param-value
-   VI
-   /param-value
+   param-name
+   EDITOR
+   /param-name
+   param-value
+   VI
+   /param-value
 /context-param
 
+!-- Filters --
+filter
+filter-name
+ServletMappedDoFilter_Filter
+/filter-name
+display-name
+ServletMappedDoFilter_Filter
+/display-name
+filter-class
+tests.javax_servlet.Filter.DoFilter_Filter
+/filter-class
+init-param
+param-name
+attribute
+/param-name
+param-value
+tests.javax_servlet.Filter.DoFilter_Filter.SERVLET_MAPPED
+/param-value
+/init-param
+/filter
+filter
+filter-name
+ServletMappedInitFilter_Filter
+/filter-name
+display-name
+ServletMappedInitFilter_Filter
+/display-name
+filter-class
+tests.javax_servlet.Filter.InitFilter_Filter
+/filter-class
+init-param
+param-name
+attribute
+/param-name
+param-value
+tests.javax_servlet.Filter.InitFilter_Filter.SERVLET_MAPPED
+/param-value
+/init-param
+ /filter
+ filter-mapping
+ filter-name
+ ServletMappedDoFilter_Filter
+ /filter-name
+ servlet-name
+ DoFilterTest
+ /servlet-name
+ /filter-mapping
+ filter-mapping
+ filter-name
+ ServletMappedInitFilter_Filter
+ /filter-name
+ servlet-name
+ InitFilterConfigTest
+/servlet-name
+ /filter-mapping
+
+  !-- END 

[PATCH] Watchdog-4.0 -- New Tests tests.javax_servlet.Error

2001-11-30 Thread Ryan Lubke

New tests for verification of error page handling by the container.

The tests validate the use of dynamic and static resources as error
pages and validate that the appropriate request parameters are set
depending on the circumstances when the error resource is dynamic.

The attached .gz file can be untarred in the root directory of the
watchdog distribution and all new files will be put into the proper
directories.  Also attached are patches to the servlet-tests web
application's web.xml, and the servlet-gtest.xml file.

Comments are welcome.

-rl



javax_servlet_Error.tar.gz
Description: GNU Zip compressed data

Index: servlet-gtest.xml
===
RCS file: /home/cvspublic/jakarta-watchdog-4.0/src/conf/servlet-gtest.xml,v
retrieving revision 1.19
diff -u -r1.19 servlet-gtest.xml
--- servlet-gtest.xml   2001/07/20 23:07:56 1.19
+++ servlet-gtest.xml   2001/11/30 20:23:12
@@ -586,6 +586,49 @@
debug=0 host=${host} port=${port}

goldenFile=${wgdir}/javax_servlet/UnavailableException/UnavailableException_Constructor2Test.html
 /
 
+  !-- javax_servlet_Error tests --
+
+gtest request=GET /servlet-tests/ServletToServletErrorPageTest HTTP/1.0
+debug=0 host=${host} port=${port}
+goldenfile=${wgdir}/javax_servlet/Error/ServletToServletErrorPageTest.html
+testName=ServletToServletErrorPageTest
+assertion=Servlet error handlers can be installed for specific Exception 
+types.
+testStrategy=The target servlet will generage a 
+java.lang.ArithmeticException.  The Servlet error page should display non-null values 
+for status_code, exception_type, message, exception, request_uri, and servlet_name
+/
+
+gtest request=GET /servlet-tests/ServletToServletError501PageTest HTTP/1.0
+debug=0 host=${host} port=${port}
+
+goldenfile=${wgdir}/javax_servlet/Error/ServletToServletError501PageTest.html
+testName=ServletToServletError501PageTest
+assertion=Servlet error handlers can be installed for specific HTTP status 
+codes.
+testStrategy=The target servlet will class HttpServletResponse.sendError( 
+int status, String message ).  The Servlet error page should display non-null values 
+for status_code, message, request_uri, and servlet_name
+/
+
+gtest request=GET /servlet-tests/ServletToJSPErrorPageTest HTTP/1.0
+debug=0 host=${host} port=${port}
+goldenfile=${wgdir}/javax_servlet/Error/ServletToJSPErrorPageTest.html
+testName=ServletToJSPErrorPageTest
+assertion=JSP error handlers can be installed for specific Exception types.
+testStrategy=The target servlet will generage a 
+java.lang.ArrayIndexOutOfBoundsException.  The JSP error page should display non-null 
+values for status_code, exception_type, message, exception, request_uri, and 
+servlet_name
+/
+
+
+gtest request=GET /servlet-tests/ServletToJSPError502PageTest HTTP/1.0
+debug=0 host=${host} port=${port}
+goldenfile=${wgdir}/javax_servlet/Error/ServletToJSPError502PageTest.html
+testName=ServletToJSPError502PageTest
+assertion=JSP error handlers can be installed for specific HTTP status 
+codes.
+testStrategy=The target servlet will generage a 
+java.lang.ArrayIndexOutOfBoundsException.  The JSP error page should display non-null 
+values for status_code, message, request_uri, and servlet_name
+/
+
+
+gtest request=GET /servlet-tests/ServletToHTMLErrorPageTest HTTP/1.0
+debug=0 host=${host} port=${port}
+goldenfile=${wgdir}/javax_servlet/Error/ServletToHTMLErrorPageTest.html
+testName=ServletToHTMLErrorPageTest
+assertion=Static HTML page error handlers can be installed for specific 
+Exception types.
+testStrategy=The target servlet will generage a 
+java.lang.NumberFormatException.  The static HTML error page should be returned to 
+the client.
+/
 
   !-- javax_servlet_http_Cookie tests --
 


Index: web.xml
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/web.xml,v
retrieving revision 1.3
diff -u -r1.3 web.xml
--- web.xml 2000/12/22 18:59:14 1.3
+++ web.xml 2001/11/30 20:23:35
@@ -242,6 +242,71 @@
/servlet-class
   /servlet
 
+  !-- Error --
+
+  servlet
+servlet-name
+ServletToServletErrorPageTest
+/servlet-name
+servlet-class
+tests.javax_servlet.Error.ServletToServletErrorPageTestServlet
+/servlet-class
+  /servlet
+
+  servlet
+servlet-name
+ServletToServletError501PageTest
+/servlet-name
+servlet-class
+tests.javax_servlet.Error.ServletToServletError501PageTestServlet
+/servlet-class
+  /servlet
+
+  servlet
+servlet-name
+JSPErrorPage
+/servlet-name
+jsp-file
+/tests/javax_servlet/Error/JSPErrorPage.jsp
+/jsp-file

[PATCH] Watchdog-4.0 - Correction/cleanup of jsp_precompile tests

2001-11-29 Thread Ryan Lubke

I've cleaned up the jsp_precompile tests in Watchdog-4.0 in response to
Bug 5169.

- removed the goldenfile checks in the jsp-gtest.xml for those
  precompile tests that used them.
- removed commented and invalid tests from that section
- added new functionality to GTest to assert cases where no
  response body is expected from the server (precompile tests
  are such a case).
- cleanup the assertion and test strategy text

The following goldenfiles should be removed from the repository.
${wgdir}/misc/precompilation/response.html
${wgdir}/misc/precompilation/no_parameter.html



Index: GTest.java
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/tools/org/apache/tomcat/task/GTest.java,v
retrieving revision 1.3
diff -u -r1.3 GTest.java
--- GTest.java  2001/09/28 04:09:56 1.3
+++ GTest.java  2001/11/29 23:31:03
@@ -29,6 +29,7 @@
 // Expected response
 boolean magnitude=true;
 boolean exactMatch=false;
+boolean expectResponseBody=true;
 // Match the body against a golden file
 String goldenFile;
 // Match the body against a string
@@ -163,6 +164,19 @@
exactMatch=Boolean.valueOf( exact ).booleanValue();
 }
 
+/**
+ * codesetExpectResponseBody/code will indicate
+ * whether or not a response body is expected from the
+ * server for a particular test.  In some cases, no
+ * body should be returned to the client.  This allows
+ * that assertion.
+ *
+ * @param b a codeboolean/code value
+ */
+public void setExpectResponseBody( boolean b ) {
+expectResponseBody = b;
+}
+
 /** Set the port as int - different name to avoid confusing ant
  */
 public void setPortInt(int i) {
@@ -356,7 +370,7 @@

if( responseMatch != null ) {
// check if we got the string we wanted
-   if( responseBody == null ) {
+   if( responseBody == null  expectResponseBody ) {
System.out.println(ERROR: got no response, expecting  + 
responseMatch);
return false;
}
@@ -366,6 +380,11 @@
System.out.println(responseBody );
}
}
+
+if ( !expectResponseBody  responseBody != null ) {
+System.out.println( ERROR: Received a response body from the server where 
+none was expected );
+return false;
+}
 
// compare the body
if( goldenFile==null) return responseStatus;


Index: jsp-gtest.xml
===
RCS file: /home/cvspublic/jakarta-watchdog-4.0/src/conf/jsp-gtest.xml,v
retrieving revision 1.9
diff -u -r1.9 jsp-gtest.xml
--- jsp-gtest.xml   2001/08/09 17:35:13 1.9
+++ jsp-gtest.xml   2001/11/29 23:39:02
@@ -15,63 +15,38 @@
 !-- Precompilation tests --
   gtest request=GET 
/jsp-tests/jsp/misc/precompilation/precompile.jsp?jsp_precompile HTTP/1.0
debug=0 host=${host} port =${port}
+   expectResponseBody=false
returncode=200
-  testName=precompile.jsp 
-  assertion=Test that the request is not sent to the JSP 
-  testStrategy=No HTML page received when jsp_precompile has no value
-   /
+  testName=precompileNoValueTest 
+  assertion=If the jsp_precompile request parameter has no value, the 
+request will not be delivered to the target JSP page. JavaServer Pages Specification 
+v1.2, Sec. 8.4.2 
+  testStrategy=Validate that no response body is returned when 
+jsp_precompile has no value
+ /
 
-  gtest request=GET 
/jsp-tests/jsp/misc/precompilation/precompile.jsp?jsp_precompile=falseamp;test=insignificant
 HTTP/1.0
-   debug=0 host=${host} port =${port}
-   goldenFile=${wgdir}/misc/precompilation/response.html
-  testName=precompile.jsp 
-  assertion=Test that the request is forwarded properly when 
jsp_precompile=false
-  testStrategy=The value of variable passed in the request is displayed if 
the request goes to the JSP
-   /
-
   gtest request=GET 
/jsp-tests/jsp/misc/precompilation/precompile.jsp?jsp_precompile=false HTTP/1.0
-   debug=0 host=${host} port =${port}
-   goldenFile=${wgdir}/misc/precompilation/no_parameter.html
-  testName=precompile.jsp 
-  assertion=Test that the request is forwarded properly when 
jsp_precompile=false
-  testStrategy=The request should be processed 
-   /
-
-!--
-  gtest request=GET 
/jsp-tests/jsp/misc/precompilation/precompile.jsp?jsp_precompile=%22false%22 HTTP/1.0
debug=0 host=${host} port =${port}
-   goldenFile=${wgdir}/misc/precompilation/no_parameter.html
-  testName=precompile.jsp 
-  assertion=Test that the request is forwarded properly when 
jsp_precompile=%22false%22
-  testStrategy=The request should be processed 
-   /
---
+   

[PATCH] Tomcat 4.0 -- Spelling correction in JspServlet class

2001-11-28 Thread Ryan Lubke

Simple spelling correction in org.apache.jasper.servlet.JspServlet




Index: JspServlet.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/servlet/JspServlet.java,v
retrieving revision 1.23
diff -u -r1.23 JspServlet.java
--- JspServlet.java 2001/11/26 22:55:43 1.23
+++ JspServlet.java 2001/11/28 17:20:56
@@ -424,7 +424,7 @@
 else if (value.equals(false))
 return (false);// ?jsp_precompile=false
 else
-throw new ServletException(Cannott have request parameter  +
+throw new ServletException(Cannot have request parameter  +
Constants.PRECOMPILE +  set to  +
value);
 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[PATCH] Proposed Fix for Bugzilla 5169

2001-11-28 Thread Ryan Lubke

Synopsis of 5169:

   JavaServer Pages Specification 1.2, Section JSP.8.4.2:

   The jsp_precompile parameter may have no value, or may
   have the values true or false.  In all cases, the 
   request should not be delivered to the JSP page.

   With Tomcat, if the jsp_precompile parameter is false, the 
   request is delivered to the target JSP page.  This is a 
   violation of the spec.

The issue seems to lie in org/apache/jasper/servlet/JspServlet.java.

During the processing of the request parameters, if the jsp_precompile
value evaluated to false, the preCompile method would return false.
Because of this, the service method in the JspServletWrapper class
would not return as the precompile value passed was false.

The attached simple patch seems to resolve the issue running what tests
I have.

Comments welcome.

Thanks,

-rl



Index: JspServlet.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/servlet/JspServlet.java,v
retrieving revision 1.24
diff -u -r1.24 JspServlet.java
--- JspServlet.java 2001/11/28 17:26:08 1.24
+++ JspServlet.java 2001/11/28 21:40:18
@@ -422,7 +422,7 @@
 if (value.equals(true))
 return (true); // ?jsp_precompile=true
 else if (value.equals(false))
-return (false);// ?jsp_precompile=false
+return (true);// ?jsp_precompile=false
 else
 throw new ServletException(Cannot have request parameter  +
Constants.PRECOMPILE +  set to  +



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


RE: [VOTE] Tomcat 4.0.2 Release Plan

2001-11-28 Thread Ryan Lubke

Hi Andrew,

Take a look at the following URL:
http://jakarta.apache.org/site/getinvolved.html


On Wed, 2001-11-28 at 19:10, Andrew Bruno wrote:
 How can this kind of documentation be inclcuded?
 
 http://www.vacodi.com/howto/tomcat/iisnt/
 
 I am happy to do some extra work (fix some content, etc..), but what
 standard and process do I follow? if there is one?  How can it be
 submitted by me? or anyone else is welcome to grab it, and put in CVS,
 docs, etc

Basically you would create a documentation patch of some sort from the 
anon CVS tree which you could submit to the developer list.  A committer
monitoring the list would apply the patch to the CVS tree if
appropriate.

 
 If it were included in the next release it would help a lot of people,
 and hopefully reduce some traffic on the tomcat-user mailing list.
 
 Regards, Andrew
 
 
Hope this helps. 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




[PATCH] Watchdog-4.0 -- GetMethod_HEADTest patch

2001-11-27 Thread Ryan Lubke

Hi,

This test, the way it is currently written, expects that whent he client
invokes the HTTP HEAD method, that a response-body is returned.  This is
incorrect.  The test currently passes due to Tomcat Bugzilla 5126.

I've modified the test so that no response output is written via a
writer and instead will use sendError( int, string ), to send the status
of the test.  I had to add a new instance variable and setter method to
GTest so that the response message could be configured by the
servlet-gtest.xml file, and be checked appropriately by the
checkResponse() method of GTest.

NOTE:  The goldenfile
${wgdir}/javax_servlet_http/HttpServletRequest/GetMethod_HEADTest.html
should be removed from the repository.

Attached are the patches necessary to correct this test.

Comments welcome.

-rl






Index: GTest.java
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/tools/org/apache/tomcat/task/GTest.java,v
retrieving revision 1.3
diff -u -r1.3 GTest.java
--- GTest.java  2001/09/28 04:09:56 1.3
+++ GTest.java  2001/11/27 15:19:57
@@ -37,6 +37,7 @@
 Hashtable expectHeaders;
 // Match request line
 String returnCode=;
+String returnCodeMsg = ;
 
 // Actual response
 String responseLine;
@@ -221,6 +222,10 @@
this.returnCode=s;
 }
 
+   public void setReturnCodeMsg( String s ) {
+   this.returnCodeMsg = s;
+   }
+
public void setHeaders( String s ) {
requestHeaders=new Hashtable();
parseHeader( s, requestHeaders );
@@ -309,7 +314,13 @@

// If returnCode doesn't match
if( request.indexOf( HTTP/1. )  -1) {
-   boolean match= ( responseLine!=null  responseLine.indexOf(returnCode)  
-1);
+boolean match = false;
+if ( returnCodeMsg ==  ) {
+   match = ( responseLine != null  responseLine.indexOf( returnCode )  
+-1 );
+} else {
+match = ( responseLine != null  responseLine.indexOf( returnCode )  -1 
+   responseLine.indexOf( returnCodeMsg )  -1 );
+}
if( match != testCondition ) {
responseStatus = false;
System.out.println(ERROR in:  + request);


Index: GetMethod_HEADTestServlet.java
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet_http/HttpServletRequest/GetMethod_HEADTestServlet.java,v
retrieving revision 1.1
diff -u -r1.1 GetMethod_HEADTestServlet.java
--- GetMethod_HEADTestServlet.java  2000/10/16 22:38:56 1.1
+++ GetMethod_HEADTestServlet.java  2001/11/27 14:52:17
@@ -80,20 +80,16 @@
 
 
public void service (HttpServletRequest request, HttpServletResponse response) 
throws ServletException, IOException {
-   PrintWriter out = response.getWriter();
 
String method = request.getMethod();
if(method!=null) {
if(method.trim().equalsIgnoreCase(HEAD))
{
-   out.println(GetMethod_HEADTest test PASSED);
+   response.sendError( HttpServletResponse.SC_OK, 
+GetMethod_HEADTest PASSED);
return;
}
}
-   out.println(GetMethod_HEADTest test FAILED);
-   out.println( BRgetMethod did not return proper method type);
-   out.println(Actual Return Value :  + method );
-   out.println(Expected Return Value : HEAD   );
+response.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, 
+GetMethod_HEADTest FAILED );
 
}
 }


Index: servlet-gtest.xml
===
RCS file: /home/cvspublic/jakarta-watchdog-4.0/src/conf/servlet-gtest.xml,v
retrieving revision 1.19
diff -u -r1.19 servlet-gtest.xml
--- servlet-gtest.xml   2001/07/20 23:07:56 1.19
+++ servlet-gtest.xml   2001/11/27 15:14:13
@@ -739,7 +739,7 @@
 
   gtest request=HEAD /servlet-tests/GetMethod_HEADTest HTTP/1.0
debug=0 host=${host} port=${port}  
-   
goldenFile=${wgdir}/javax_servlet_http/HttpServletRequest/GetMethod_HEADTest.html /
+   returnCode=200 returnCodeMsg=GetMethod_HEADTest PASSED /
 
   gtest request=POST /servlet-tests/GetMethod_POSTTest HTTP/1.0
debug=0 host=${host} port=${port}  



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[PATCH] Watchdog 4.0 - Fix for Bugzilla 3527

2001-11-20 Thread Ryan Lubke

Classes referenced by TLD are not in the repository.  As stated in the
bug, some containers are very strict about having all classes available
that are referenced in a TLD.

The included patches removed the unused references from the TLDs.

Comments welcome.

-rl




Index: tld_uri.tld
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/server/jsp-tests/WEB-INF/tlds/tld_uri.tld,v
retrieving revision 1.2
diff -u -r1.2 tld_uri.tld
--- tld_uri.tld 2000/11/30 23:53:58 1.2
+++ tld_uri.tld 2001/11/20 12:34:42
@@ -16,22 +16,7 @@
   description
A simple tab library for testing computation of TLD Resource Path 
   /description
-validator
-  validator-classtags.TagLibraryValidator.Validator/validator-class
-init-param
-param-nameusa/param-name
-param-valueWashington/param-value
-descriptionCapital/description
-/init-param
-init-param
-param-nameindia/param-name
-param-valueNew Delhi/param-value
-descriptionCapital/description
-/init-param
-/validator
 
-
-  !-- general validator tag --
   tag
 nametldtag/name
 tag-classtags.tld_resource_path.tld_URI/tag-class


Index: TestLib.tld
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/server/jsp-tests/WEB-INF/tlds/TestLib.tld,v
retrieving revision 1.8
diff -u -r1.8 TestLib.tld
--- TestLib.tld 2000/12/01 00:19:25 1.8
+++ TestLib.tld 2001/11/20 12:34:30
@@ -201,24 +201,6 @@
   /tag
 
 tag
-namepropertyEditor/name
-tag-classtags.PropertyEditorTag/tag-class
-description
-A tag that Uses ProprtyEditorSupport class
-/description
-
-attribute
-  nameurl/name
-  requiredfalse/required
-/attribute
-
-attribute
-  namelocale/name
-  requiredfalse/required
-/attribute
-/tag
-
-tag
 nameiterator/name
 tag-classtags.SimpleIteratorTag/tag-class
 description
@@ -310,21 +292,5 @@
   requiredtrue/required
 /attribute
 /tag
-
-tag
-namethirdWinner/name
-tag-classtags.TagSupport.thirdPrizeTag/tag-class
-description
-A tag that sets the third prize winner and also returns it to a   
-nested tag
-/description
-attribute
-  namewinner/name
-  requiredtrue/required
-/attribute
-/tag
-
-
-
 
 /taglib



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[PATCH] Watchdog 4.0 - Fix for Bugzilla 3904

2001-11-20 Thread Ryan Lubke

GTest currently verifies response headers in a case sensative
manner.  This patch resolves the issue.

Fix is based of suggested fix in Bug report.

Comments welcome.

-rl







Index: GTest.java
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/tools/org/apache/tomcat/task/GTest.java,v
retrieving revision 1.3
diff -u -r1.3 GTest.java
--- GTest.java  2001/09/28 04:09:56 1.3
+++ GTest.java  2001/11/19 21:36:00
@@ -15,6 +15,11 @@
 
 // derived from Jsp
 public class GTest extends Task {
+
+private static final String ZEROS = ;
+private static final int SHORTPADSIZE = 4;
+private static final int BYTEPADSIZE = 2;
+
 String prefix=http://localhost:8080/test;;
 String host=localhost;
 int port=8080;
@@ -376,9 +381,9 @@
boolean cmp=true;

if(exactMatch)
-   cmp=compare(responseBody, expResult.toString() );
+   cmp=compare(responseBody.getBytes(), expResult.toString().getBytes() );
else
-   cmp=compareWeek( responseBody, expResult.toString());
+   cmp=compareWeak( responseBody, expResult.toString());

if( cmp  != testCondition ) {
responseStatus = false;
@@ -521,30 +526,200 @@
 }
 }
 
+/*
+ * codecompare/code compares the two byte arrays passed
+ * in to verify that the lengths of the arrays are equal, and
+ * that the content of the two arrays, byte for byte are equal.
+ *
+ * @param fromServer a codebyte[]/code value
+ * @param fromGoldenFile a codebyte[]/code value
+ * @return codeboolean/code true if equal, otherwise false
+ */
+private boolean compare( byte[] fromServer, byte[] fromGoldenFile ) {
+if ( fromServer == null || fromGoldenFile == null ) {
+return false;
+}   
+
+/*
+ * Check to see that the respose and golden file lengths
+ * are equal.  If they are not, dump the hex and don't
+ * bother comparing the bytes.  If they are equal,
+ * iterate through the byte arrays and compare each byte.
+ * If the bytes don't match, dump the hex representation
+ * of the server response and the goldenfile and return
+ * false.
+ */
+
+if ( fromServer.length != fromGoldenFile.length ) {
+StringBuffer sb = new StringBuffer( 50 );
+sb.append( Response and golden file lengths do not match!\n );
+sb.append( Server response length:  );
+sb.append( fromServer.length );
+sb.append( \nGoldenfile length:  );
+sb.append( fromGoldenFile.length );
+System.out.println( sb.toString() );
+sb = null;
+// dump the hex representation of the byte arrays
+dumpHex( fromServer, fromGoldenFile );
+
+return false;
+
+} else {
+
+int i = 0;
+int j = 0;
+
+while ( ( i  fromServer.length )  ( j  fromGoldenFile.length ) ) {
+if ( fromServer[ i ] != fromGoldenFile[ j ] ) {
+System.out.println( Error at position  + ( i + 1 ) );
 
-// Compare the actual result and the expected result.
-private boolean compare(String str1, String str2) {
-   //System.out.println(In compare);
-   if ( str1==null || str2==null) return false;
-   if ( str1.length() != str2.length() ) {
-   System.out.println(Wrong size  + str1.length() +  + str2.length() );
-   return false;
-   }
-   
-for(int i=0; istr1.length() ; i++ ) {
-if (str1.charAt( i ) != str2.charAt( i ) ) {
-   System.out.println(Error at  + i  +   + str1.charAt(1) +
-  str2.charAt(i));
-return false;
+// dump the hex representation of the byte arrays
+dumpHex( fromServer, fromGoldenFile );
+
+return false;
+}
+
+i++;
+j++;
+}
+}
+
+return true;
+}
+
+/*
+ * codedumpHex/code helper method to dump formatted
+ * hex output of the server response and the goldenfile.
+ *
+ * @param serverResponse a codebyte[]/code value
+ * @param goldenFile a codebyte[]/code value
+ */
+private void dumpHex( byte[] serverResponse, byte[] goldenFile ) {
+StringBuffer outBuf = new StringBuffer( ( serverResponse.length + 
+goldenFile.length ) * 2 );
+
+String fromServerString = getHexValue( serverResponse, 0, 
+serverResponse.length );
+String fromGoldenFileString = getHexValue( goldenFile, 0, goldenFile.length );
+
+outBuf.append( Hex dump of server response and goldenfile below.\n\n### 
+RESPONSE FROM SERVER ###\n );
+outBuf.append( \n );
+outBuf.append( fromServerString );
+outBuf.append( 

Re: [PATCH] Watchdog 4.0 - Fix for Bugzilla 3904

2001-11-20 Thread Ryan Lubke

Apologies,

I attached the wrong patch in the previous email.  The correct
patch for Bugzilla 3904 is now attached.

-rl

On Tue, 2001-11-20 at 09:07, Ryan Lubke wrote:
 GTest currently verifies response headers in a case sensative
 manner.  This patch resolves the issue.
 
 Fix is based of suggested fix in Bug report.
 
 Comments welcome.
 
 -rl
 
 
 
 
 
 
 

 Index: GTest.java
 ===
 RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/tools/org/apache/tomcat/task/GTest.java,v
 retrieving revision 1.3
 diff -u -r1.3 GTest.java
 --- GTest.java2001/09/28 04:09:56 1.3
 +++ GTest.java2001/11/19 21:36:00
 @@ -15,6 +15,11 @@
  
  // derived from Jsp
  public class GTest extends Task {
 +
 +private static final String ZEROS = ;
 +private static final int SHORTPADSIZE = 4;
 +private static final int BYTEPADSIZE = 2;
 +
  String prefix=http://localhost:8080/test;;
  String host=localhost;
  int port=8080;
 @@ -376,9 +381,9 @@
   boolean cmp=true;
   
   if(exactMatch)
 - cmp=compare(responseBody, expResult.toString() );
 + cmp=compare(responseBody.getBytes(), expResult.toString().getBytes() );
   else
 - cmp=compareWeek( responseBody, expResult.toString());
 + cmp=compareWeak( responseBody, expResult.toString());
   
   if( cmp  != testCondition ) {
   responseStatus = false;
 @@ -521,30 +526,200 @@
  }
  }
  
 +/*
 + * codecompare/code compares the two byte arrays passed
 + * in to verify that the lengths of the arrays are equal, and
 + * that the content of the two arrays, byte for byte are equal.
 + *
 + * @param fromServer a codebyte[]/code value
 + * @param fromGoldenFile a codebyte[]/code value
 + * @return codeboolean/code true if equal, otherwise false
 + */
 +private boolean compare( byte[] fromServer, byte[] fromGoldenFile ) {
 +if ( fromServer == null || fromGoldenFile == null ) {
 +return false;
 +}   
 +
 +/*
 + * Check to see that the respose and golden file lengths
 + * are equal.  If they are not, dump the hex and don't
 + * bother comparing the bytes.  If they are equal,
 + * iterate through the byte arrays and compare each byte.
 + * If the bytes don't match, dump the hex representation
 + * of the server response and the goldenfile and return
 + * false.
 + */
 +
 +if ( fromServer.length != fromGoldenFile.length ) {
 +StringBuffer sb = new StringBuffer( 50 );
 +sb.append( Response and golden file lengths do not match!\n );
 +sb.append( Server response length:  );
 +sb.append( fromServer.length );
 +sb.append( \nGoldenfile length:  );
 +sb.append( fromGoldenFile.length );
 +System.out.println( sb.toString() );
 +sb = null;
 +// dump the hex representation of the byte arrays
 +dumpHex( fromServer, fromGoldenFile );
 +
 +return false;
 +
 +} else {
 +
 +int i = 0;
 +int j = 0;
 +
 +while ( ( i  fromServer.length )  ( j  fromGoldenFile.length ) ) {
 +if ( fromServer[ i ] != fromGoldenFile[ j ] ) {
 +System.out.println( Error at position  + ( i + 1 ) );
  
 -// Compare the actual result and the expected result.
 -private boolean compare(String str1, String str2) {
 - //System.out.println(In compare);
 - if ( str1==null || str2==null) return false;
 - if ( str1.length() != str2.length() ) {
 - System.out.println(Wrong size  + str1.length() +  + str2.length() );
 - return false;
 - }
 - 
 -for(int i=0; istr1.length() ; i++ ) {
 -if (str1.charAt( i ) != str2.charAt( i ) ) {
 - System.out.println(Error at  + i  +   + str1.charAt(1) +
 -str2.charAt(i));
 -return false;
 +// dump the hex representation of the byte arrays
 +dumpHex( fromServer, fromGoldenFile );
 +
 +return false;
 +}
 +
 +i++;
 +j++;
 +}
 +}
 +
 +return true;
 +}
 +
 +/*
 + * codedumpHex/code helper method to dump formatted
 + * hex output of the server response and the goldenfile.
 + *
 + * @param serverResponse a codebyte[]/code value
 + * @param goldenFile a codebyte[]/code value
 + */
 +private void dumpHex( byte[] serverResponse, byte[] goldenFile ) {
 +StringBuffer outBuf = new StringBuffer( ( serverResponse.length + 
goldenFile.length ) * 2 );
 +
 +String fromServerString = getHexValue( serverResponse, 0, 
serverResponse.length );
 +String fromGoldenFileString

[PATCH] Tomcat 4.0.1- Proposed fix for Bugzilla 4609

2001-11-20 Thread Ryan Lubke

Hi,

Thought I'd give a shot at patching a bug (4609) I logged.
The basics of the bug is that an IOException is not thrown
if out.close() is called from within a JSP page and 
subsequent calls to write() or println(), etc. are made.

The solution I have affects two classes:
org.apache.jasper.runtime.JspWriterImpl
org.apache.jasper.compiler.JspParseEventListener

The modification to JspWriterImpl was simple:
  -Added a new boolean instance variable called 'closed'
  -When JspWriter.close() is called, set 'closed' to true.
  -Modified the JspWriter.ensureOpen() method.  If
   'closed' is true, or response is null, throw the IOException.

I felt the modification to JspParseEventListener.generateFooter()
was necessary as the page code generated:

snip
} catch (Throwable t) {
if (out != null  out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
}
/snip

So in this case, now that the IOException is thown, we go into the 
throwable, but the call to out.clearBuffer() generates its own
IOException.  The problem with this is that the stacktrace becomes
inaccurate.  Showing the call to clearBuffer() as the top-most call
on the stack.

So the change I introduced would generate the following code:

snip
if (out != null  out.getBufferSize() != 0)
try {
out.clearBuffer();
} catch (java.io.IOException ioe) {
if (t instanceof java.io.IOException) {
if (!(t.getMessage().equals(ioe.getMessage( {
t = ioe;
}
}
}
/snip

So, here if out.clearBuffer() happens to throw an IOException,
check to see if the throwable that brought us to this point
in the code is an IOException as well.  If it is, see if 
the messages are the same, if they aren't, then there
is a new IO issue and set ioe to the throwable which will
be handled by pageContext.handlePageException.  Otherwise
the catch becomes a no-op and pageContext.handlePageException
will use the original throwable.  Hope that made sense.

Anyway,  comments are definately welcome.  Still getting familiar
with the code.

Thanks,
-rl





Index: JspParseEventListener.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
retrieving revision 1.35
diff -u -r1.35 JspParseEventListener.java
--- JspParseEventListener.java  2001/11/02 19:36:09 1.35
+++ JspParseEventListener.java  2001/11/20 22:29:40
@@ -378,7 +378,23 @@
writer.pushIndent();
 writer.println(if (out != null  out.getBufferSize() != 0));
 writer.pushIndent();
+writer.println( try { );
+writer.pushIndent();
writer.println(out.clearBuffer(););
+writer.popIndent();
+writer.println(} catch (java.io.IOException ioe) {);
+writer.pushIndent();
+writer.println(if (t instanceof java.io.IOException) {);
+writer.pushIndent();
+writer.println(if (!(t.getMessage().equals(ioe.getMessage( {);
+writer.pushIndent();
+writer.println(t = ioe;);
+writer.popIndent();
+writer.println(});
+writer.popIndent();
+writer.println(});
+writer.popIndent();
+writer.println(});
writer.popIndent();
writer.println(if (pageContext != null) pageContext.handlePageException(t););
writer.popIndent();


Index: JspWriterImpl.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/JspWriterImpl.java,v
retrieving revision 1.1
diff -u -r1.1 JspWriterImpl.java
--- JspWriterImpl.java  2000/08/12 00:52:12 1.1
+++ JspWriterImpl.java  2001/11/20 18:10:11
@@ -99,6 +99,7 @@
 protected static int defaultCharBufferSize = Constants.DEFAULT_BUFFER_SIZE;
 
 protected boolean flushed = false;
+protected boolean closed = false;
 
 public JspWriterImpl() {
super( defaultCharBufferSize, true );
@@ -223,6 +224,7 @@
 if (out != null)
 out.close();
 out = null;
+closed = true;
//cb = null;
 }
 }
@@ -236,7 +238,7 @@
 
 /** check to make sure that the stream has not been closed */
 protected void ensureOpen() throws IOException {
-   if (response == null)
+   if ( closed || response == null)
throw new IOException(Stream closed);
 }
 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[PATCH] Watchdog-4.0 - False positive from GetRealPathTestServlet

2001-11-19 Thread Ryan Lubke

Simple patch, but
server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletContext/GetRealPathTestServlet.java

Yeilds a false positive when the test is run.

Attached is a simple patch to rectify.

More to follow later






Index: GetRealPathTestServlet.java
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletContext/GetRealPathTestServlet.java,v
retrieving revision 1.1
diff -r1.1 GetRealPathTestServlet.java
90c90
   if(path!=null) {
---
   if(realPath!=null) {



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[PATCH] Watchdog-4.0 -- tag_int.jsp tests functionality notmentioned in detail in spec

2001-11-19 Thread Ryan Lubke

Hi,

The following test:

server/jsp-tests/jsp/tagext/LifeCycle/tag_int.jsp

Is testing functionality not really explained clearly in the
Specification.


Test code:

%--
  Test for defining an int variable.
--%
%@ taglib uri=/TestLib.tld prefix=x %

%! public static Integer increment(Integer i) {
 if (i != null)
return new Integer(i.intValue()+1);
 return new Integer(0);
}
%
%! public static int valueof(Integer i) {
 if (i != null)
return i.intValue();
 return 0;
}
%


x:define  id=i scope=page life=nested 
(1) i was %= i %; % i = increment(i); % i is now %= valueof(i) %
/x:define

x:define  id=i scope=page life=nested 
(2) i was %= i %; % i = increment(i); % i is now %= valueof(i) %
/x:define

x:define  id=i scope=page life=at_begin 
(3) i was %= i %; % i = increment(i); % i is now %= valueof(i) %
/x:define

(4) i was %= i %; % i = increment(i); % i is now %= valueof(i) %

**

GOLDENFILE OUTPUT:
(1) i was null;  i is now 0



(2) i was 0;  i is now 1



(3) i was 0;  i is now 1


(4) i was 0;  i is now 1

**

Issue:

In (3) since the life of the variable is described as at_begin the
value
should also be available via the PageContext.The value of i is not
synchronized
with the pageContext after the end of the define tag.

Hence in (4) i starts afresh with 0.

Recommendation:

The attached patch excludes the tag_int tests from running until a
clarification is made against the specification.




Index: jsp-gtest.xml
===
RCS file: /home/cvspublic/jakarta-watchdog-4.0/src/conf/jsp-gtest.xml,v
retrieving revision 1.9
diff -u -r1.9 jsp-gtest.xml
--- jsp-gtest.xml   2001/08/09 17:35:13 1.9
+++ jsp-gtest.xml   2001/11/19 19:53:47
@@ -1585,6 +1585,7 @@
/
 --
 
+!--
   gtest request=GET /jsp-tests/jsp/tagext/LifeCycle/tag_int.jsp HTTP/1.0
debug=0 host=${host} port=${port}
goldenFile=${wgdir}/tagext/LifeCycle/tag_int.html
@@ -1592,6 +1593,7 @@
   assertion=Test for defining an int variable, specified in the Java Server 
Pages Specification v1.2, Sec 6.4.7
   testStrategy=testing LifeCycle process
/
+--
 
 !--
   gtest request=GET /jsp-tests/jsp/tagext/LifeCycle/tag_nonempty_body_1.jsp 
HTTP/1.0



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[PATCH] Watchdog-4.0 - GTest patch for whitspace comparison.

2001-11-19 Thread Ryan Lubke

Hi,

After reading through GTest, and the JSP/Servlet-Gtest.xml, none of the
tests set the exactMatch property to true to do whitespace comparison
between the response from the server, and the contents of the
goldenfile.  This patch, will make GTest do a byte for byte comparison
of the response and goldenfile.  If any length or byte differeces
appear, it will dump a hex representation (ascii on the right side, hex
on the left) to help the test writer figure out what's wrong.  Make's
it easier in my opinion anyway :).


I plan to start going through and correcting the whitespace issues as 
I come across them, so there will probably be more patches to come down
the pipe.

Anyway, attached is the patch to GTest (GTest.patch.txt) as well as
sample output (sample.txt) of what this code produces when exactMatch is
set to true.

Anyone care to comment?

Thanks,

-rl




Index: GTest.java
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/tools/org/apache/tomcat/task/GTest.java,v
retrieving revision 1.3
diff -u -r1.3 GTest.java
--- GTest.java  2001/09/28 04:09:56 1.3
+++ GTest.java  2001/11/19 21:36:00
@@ -15,6 +15,11 @@
 
 // derived from Jsp
 public class GTest extends Task {
+
+private static final String ZEROS = ;
+private static final int SHORTPADSIZE = 4;
+private static final int BYTEPADSIZE = 2;
+
 String prefix=http://localhost:8080/test;;
 String host=localhost;
 int port=8080;
@@ -376,9 +381,9 @@
boolean cmp=true;

if(exactMatch)
-   cmp=compare(responseBody, expResult.toString() );
+   cmp=compare(responseBody.getBytes(), expResult.toString().getBytes() );
else
-   cmp=compareWeek( responseBody, expResult.toString());
+   cmp=compareWeak( responseBody, expResult.toString());

if( cmp  != testCondition ) {
responseStatus = false;
@@ -521,30 +526,200 @@
 }
 }
 
+/*
+ * codecompare/code compares the two byte arrays passed
+ * in to verify that the lengths of the arrays are equal, and
+ * that the content of the two arrays, byte for byte are equal.
+ *
+ * @param fromServer a codebyte[]/code value
+ * @param fromGoldenFile a codebyte[]/code value
+ * @return codeboolean/code true if equal, otherwise false
+ */
+private boolean compare( byte[] fromServer, byte[] fromGoldenFile ) {
+if ( fromServer == null || fromGoldenFile == null ) {
+return false;
+}   
+
+/*
+ * Check to see that the respose and golden file lengths
+ * are equal.  If they are not, dump the hex and don't
+ * bother comparing the bytes.  If they are equal,
+ * iterate through the byte arrays and compare each byte.
+ * If the bytes don't match, dump the hex representation
+ * of the server response and the goldenfile and return
+ * false.
+ */
+
+if ( fromServer.length != fromGoldenFile.length ) {
+StringBuffer sb = new StringBuffer( 50 );
+sb.append( Response and golden file lengths do not match!\n );
+sb.append( Server response length:  );
+sb.append( fromServer.length );
+sb.append( \nGoldenfile length:  );
+sb.append( fromGoldenFile.length );
+System.out.println( sb.toString() );
+sb = null;
+// dump the hex representation of the byte arrays
+dumpHex( fromServer, fromGoldenFile );
+
+return false;
+
+} else {
+
+int i = 0;
+int j = 0;
+
+while ( ( i  fromServer.length )  ( j  fromGoldenFile.length ) ) {
+if ( fromServer[ i ] != fromGoldenFile[ j ] ) {
+System.out.println( Error at position  + ( i + 1 ) );
 
-// Compare the actual result and the expected result.
-private boolean compare(String str1, String str2) {
-   //System.out.println(In compare);
-   if ( str1==null || str2==null) return false;
-   if ( str1.length() != str2.length() ) {
-   System.out.println(Wrong size  + str1.length() +  + str2.length() );
-   return false;
-   }
-   
-for(int i=0; istr1.length() ; i++ ) {
-if (str1.charAt( i ) != str2.charAt( i ) ) {
-   System.out.println(Error at  + i  +   + str1.charAt(1) +
-  str2.charAt(i));
-return false;
+// dump the hex representation of the byte arrays
+dumpHex( fromServer, fromGoldenFile );
+
+return false;
+}
+
+i++;
+j++;
+}
+}
+
+return true;
+}
+
+/*
+ * codedumpHex/code helper method to dump formatted
+ * hex output of the server response and the goldenfile.
+ *
+ * @param 

Re: [PATCH] Watchdog-4.0 - GTest patch for whitspace comparison.

2001-11-19 Thread Ryan Lubke

Forgot to mention, I changed the method name : compareWeek, to
compareWeak.

On Mon, 2001-11-19 at 17:04, Ryan Lubke wrote:
 Hi,
 
 After reading through GTest, and the JSP/Servlet-Gtest.xml, none of the
 tests set the exactMatch property to true to do whitespace comparison
 between the response from the server, and the contents of the
 goldenfile.  This patch, will make GTest do a byte for byte comparison
 of the response and goldenfile.  If any length or byte differeces
 appear, it will dump a hex representation (ascii on the right side, hex
 on the left) to help the test writer figure out what's wrong.  Make's
 it easier in my opinion anyway :).
 
 
 I plan to start going through and correcting the whitespace issues as 
 I come across them, so there will probably be more patches to come down
 the pipe.
 
 Anyway, attached is the patch to GTest (GTest.patch.txt) as well as
 sample output (sample.txt) of what this code produces when exactMatch is
 set to true.
 
 Anyone care to comment?
 
 Thanks,
 
 -rl
 
 
 
 

 Index: GTest.java
 ===
 RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/tools/org/apache/tomcat/task/GTest.java,v
 retrieving revision 1.3
 diff -u -r1.3 GTest.java
 --- GTest.java2001/09/28 04:09:56 1.3
 +++ GTest.java2001/11/19 21:36:00
 @@ -15,6 +15,11 @@
  
  // derived from Jsp
  public class GTest extends Task {
 +
 +private static final String ZEROS = ;
 +private static final int SHORTPADSIZE = 4;
 +private static final int BYTEPADSIZE = 2;
 +
  String prefix=http://localhost:8080/test;;
  String host=localhost;
  int port=8080;
 @@ -376,9 +381,9 @@
   boolean cmp=true;
   
   if(exactMatch)
 - cmp=compare(responseBody, expResult.toString() );
 + cmp=compare(responseBody.getBytes(), expResult.toString().getBytes() );
   else
 - cmp=compareWeek( responseBody, expResult.toString());
 + cmp=compareWeak( responseBody, expResult.toString());
   
   if( cmp  != testCondition ) {
   responseStatus = false;
 @@ -521,30 +526,200 @@
  }
  }
  
 +/*
 + * codecompare/code compares the two byte arrays passed
 + * in to verify that the lengths of the arrays are equal, and
 + * that the content of the two arrays, byte for byte are equal.
 + *
 + * @param fromServer a codebyte[]/code value
 + * @param fromGoldenFile a codebyte[]/code value
 + * @return codeboolean/code true if equal, otherwise false
 + */
 +private boolean compare( byte[] fromServer, byte[] fromGoldenFile ) {
 +if ( fromServer == null || fromGoldenFile == null ) {
 +return false;
 +}   
 +
 +/*
 + * Check to see that the respose and golden file lengths
 + * are equal.  If they are not, dump the hex and don't
 + * bother comparing the bytes.  If they are equal,
 + * iterate through the byte arrays and compare each byte.
 + * If the bytes don't match, dump the hex representation
 + * of the server response and the goldenfile and return
 + * false.
 + */
 +
 +if ( fromServer.length != fromGoldenFile.length ) {
 +StringBuffer sb = new StringBuffer( 50 );
 +sb.append( Response and golden file lengths do not match!\n );
 +sb.append( Server response length:  );
 +sb.append( fromServer.length );
 +sb.append( \nGoldenfile length:  );
 +sb.append( fromGoldenFile.length );
 +System.out.println( sb.toString() );
 +sb = null;
 +// dump the hex representation of the byte arrays
 +dumpHex( fromServer, fromGoldenFile );
 +
 +return false;
 +
 +} else {
 +
 +int i = 0;
 +int j = 0;
 +
 +while ( ( i  fromServer.length )  ( j  fromGoldenFile.length ) ) {
 +if ( fromServer[ i ] != fromGoldenFile[ j ] ) {
 +System.out.println( Error at position  + ( i + 1 ) );
  
 -// Compare the actual result and the expected result.
 -private boolean compare(String str1, String str2) {
 - //System.out.println(In compare);
 - if ( str1==null || str2==null) return false;
 - if ( str1.length() != str2.length() ) {
 - System.out.println(Wrong size  + str1.length() +  + str2.length() );
 - return false;
 - }
 - 
 -for(int i=0; istr1.length() ; i++ ) {
 -if (str1.charAt( i ) != str2.charAt( i ) ) {
 - System.out.println(Error at  + i  +   + str1.charAt(1) +
 -str2.charAt(i));
 -return false;
 +// dump the hex representation of the byte arrays
 +dumpHex( fromServer, fromGoldenFile );
 +
 +return false;
 +}
 +
 +i

[PATCH] - Watchdog 4.0 - 3 New HttpServletResponse tests + Patchesto support new tests.

2001-11-19 Thread Ryan Lubke

Hi,

I've added 3 tests to javax_servlet_http/HttpServletResponse to 
validate that headers set after sendError() or sendRedirect are
called are ignored by the container (this was an issue at one point).

The 3 new tests are:
SendErrorIgnoreHeaderTestServlet.java
SendError_StringIgnoreHeaderTestServlet.java
SendRedirectIgnoreHeaderTestServlet.java

These should be placed in
${WATCHDOG{/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet_http/HttpServletResponse

To support these tests, I've added a new method to GTest,
setUnexpectedHeaders (set in the servlet or jsp gtest.xml like so: 
unexpectedHeaders=key:value ).
This will setup a hashtable of headers to compare against the server
response.  The logic to checkResponse has been updated accordingly.
More to come.

Comments welcome.

-rl






Index: GTest.java
===
RCS file: 
/home/cvspublic/jakarta-watchdog-4.0/src/tools/org/apache/tomcat/task/GTest.java,v
retrieving revision 1.3
diff -u -r1.3 GTest.java
--- GTest.java  2001/09/28 04:09:56 1.3
+++ GTest.java  2001/11/19 23:54:31
@@ -35,6 +35,10 @@
 String responseMatch;
 // the response should include the following headers
 Hashtable expectHeaders;
+
+// the response should not include the following headers
+Hashtable unexpectedHeaders;
+
 // Match request line
 String returnCode=;
 
@@ -197,10 +201,21 @@
 
//Ramesh
 public void setExpectHeaders( String s ) {
-   this.expectHeaders=new Hashtable();
-   getHeaderDetails( s, expectHeaders );
+this.expectHeaders=new Hashtable();
+getHeaderDetails( s, expectHeaders );
 
-   //parseHeader( s, expectHeaders );
+//parseHeader( s, expectHeaders );
+}
+
+   /**
+ * codesetUnexpectedHeaders/code sets an ArrayList
+ * with headers that are not expected to be found in a response
+ *
+ * @param s a codeString/code value
+ */
+public void setUnexpectedHeaders( String s ) {
+this.unexpectedHeaders = new Hashtable();
+getHeaderDetails( s, unexpectedHeaders );
 }
 
 public void setResponseMatch( String s ) {
@@ -329,30 +344,46 @@
if( expectHeaders != null ) {
// Check if we got the expected headers
if(headers==null) {
-   System.out.println(ERROR no response header, expecting header);
+System.out.println(ERROR no response header, expecting header);
}
Enumeration e=expectHeaders.keys();
while( e.hasMoreElements()) {
-   String key=(String)e.nextElement();
-   String value=(String)expectHeaders.get(key);
-   String respValue=(String)headers.get(key);
-   if( respValue==null || respValue.indexOf( value ) 0 ) {
-   System.out.println(ERROR expecting header  + key + : +
-  value +  GOT:  + respValue+  HEADERS( + 
headers + ));
-   if ( resultOut != null )
-   {
-   expectedString = expectedHeader + key + :+ value 
+ /expectedHeader\n;
-   actualString = actualHeader+ key + : + respValue 
+ /actualHeader\n;
-   resultOut.write(expectedString.getBytes() );
-   resultOut.write(actualString.getBytes() );
+String key=(String)e.nextElement();
+String value=(String)expectHeaders.get(key);
+String respValue=(String)headers.get(key);
+if( respValue==null || respValue.indexOf( value ) 0 ) {
+System.out.println(ERROR expecting header  + key + : +
+   value +  GOT:  + respValue+  HEADERS( + 
+headers + ));
+if ( resultOut != null )
+{
+expectedString = expectedHeader + key + :+ value + 
+/expectedHeader\n;
+actualString = actualHeader+ key + : + respValue + 
+/actualHeader\n;
+resultOut.write(expectedString.getBytes() );
+resultOut.write(actualString.getBytes() );

-   }
+}

-   return false;
-   }
+return false;
+}
}
-
}
+
+// check to see if any unexpected headers we're recieved
+if ( unexpectedHeaders != null ) {
+if ( headers != null ) {
+Enumeration e = unexpectedHeaders.keys();
+while( e.hasMoreElements() ) {
+String key = (String) e.nextElement();
+String value = (String) unexpectedHeaders.get( key );
+String respValue = (String) headers.get( key );
+if ( respValue != null  respValue.indexOf( value )  0 ) {
+System.out.println( ERROR Unexpected header:  + key + : + 
+value +
+   

Re: Performance of tomcat 3.2.3

2001-11-16 Thread Ryan Lubke

http://jakarta.apache.org/jmeter/index.html

On Fri, 2001-11-16 at 12:16, Michael Jennings wrote:
 Hi everyone,
 
 I'm working on a project for a client that involves a servlet engine component. I 
suggested tomcat
 since I am most familiar with it and it seems the most compliant servlet engine 
around.
 My client has mentioned concerns about tomcat's performance and now is insisting on
 using IBM websphere 4.0
 
 My suspicion is that tomcat's performance will be fine for this application, but I 
would
 like to have some hard numbers to back up my claim. Does anyone know of any kind
 of tool or code out there that can measure http and https performance?
 
 Thanks in advance.
 -Mike Jennings



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




[PATCH] Status-Code not set for Error pages when Exception is thrown

2001-11-16 Thread Ryan Lubke

Hi,

Say a user has a custom error page for status codes of 500
when an uncaught exception occurs.  The request parameter,
javax.servlet.error.status_code, is not set, so if the
error page tries to access this req. parameter, null will
be returned. 

Attached is a patch that I've tested in my env and seems
to do the trick.

-rl






Index: ErrorDispatcherValve.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorDispatcherValve.java,v
retrieving revision 1.6
diff -u -r1.6 ErrorDispatcherValve.java
--- ErrorDispatcherValve.java   2001/11/13 00:42:24 1.6
+++ ErrorDispatcherValve.java   2001/11/16 23:56:55
@@ -229,6 +229,8 @@
 response.setAppCommitted(false);
 ServletRequest sreq = request.getRequest();
 ServletResponse sresp = response.getResponse();
+sreq.setAttribute(Globals.STATUS_CODE_ATTR,
+  new 
+Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
 sreq.setAttribute(Globals.ERROR_MESSAGE_ATTR,
   throwable.getMessage());
 sreq.setAttribute(Globals.EXCEPTION_ATTR,



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]