Re: GSOC 2010

2010-02-13 Thread buddhika chamith
Hi Mark,

Thanks for the quick reply.


> they have already provided an
> acceptable patch for at least one and preferably more currently open,
> non-trivial bugzilla items (bugs or enhancements).
>
>
I will look in to that and see. If I come across with any issue I will come
up with a mail. Btw any pointers that would help if I start looking in to
tomcat connectors and JMX usage within tomcat. (I saw the ideas regarding
connectors and JMX). I have the source built and setup.

Best Regards,
Chamith


svn commit: r909789 - /tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java

2010-02-13 Thread markt
Author: markt
Date: Sat Feb 13 11:02:23 2010
New Revision: 909789

URL: http://svn.apache.org/viewvc?rev=909789&view=rev
Log:
Change a few variable names to reduce potential confusion - no functional change

Modified:

tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java

Modified: 
tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java?rev=909789&r1=909788&r2=909789&view=diff
==
--- 
tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java 
(original)
+++ 
tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java 
Sat Feb 13 11:02:23 2010
@@ -257,11 +257,11 @@
 ArrayList soaproles = new ArrayList();
 
 while (((ServiceRef) ref).getHandlersSize() > 0) {
-HandlerRef handler = ((ServiceRef) ref).getHandler();
-HandlerInfo handlerref = new HandlerInfo();
+HandlerRef handlerRef = ((ServiceRef) ref).getHandler();
+HandlerInfo handlerInfo = new HandlerInfo();
 
 // Loading handler Class
-tmp = handler.get(HandlerRef.HANDLER_CLASS);
+tmp = handlerRef.get(HandlerRef.HANDLER_CLASS);
 if ((tmp == null) || (tmp.getContent() == null))
 break;
 Class handlerClass = null;
@@ -276,51 +276,51 @@
 ArrayList headers = new ArrayList();
 Hashtable config = new 
Hashtable();
 ArrayList portNames = new ArrayList();
-for (int i = 0; i < handler.size(); i++)
-if 
(HandlerRef.HANDLER_LOCALPART.equals(handler.get(i).getType())) {
+for (int i = 0; i < handlerRef.size(); i++)
+if 
(HandlerRef.HANDLER_LOCALPART.equals(handlerRef.get(i).getType())) {
 String localpart = "";
 String namespace = "";
-localpart = (String) handler.get(i).getContent();
-if 
(HandlerRef.HANDLER_NAMESPACE.equals(handler.get(i + 1).getType())) {
+localpart = (String) 
handlerRef.get(i).getContent();
+if 
(HandlerRef.HANDLER_NAMESPACE.equals(handlerRef.get(i + 1).getType())) {
 i++;
-namespace = (String) 
handler.get(i).getContent();
+namespace = (String) 
handlerRef.get(i).getContent();
 }
 QName header = new QName(namespace, localpart);
 headers.add(header);
-} else if 
(HandlerRef.HANDLER_PARAMNAME.equals(handler.get(i).getType())) {
+} else if 
(HandlerRef.HANDLER_PARAMNAME.equals(handlerRef.get(i).getType())) {
 String paramName = "";
 String paramValue = "";
-paramName = (String) handler.get(i).getContent();
-if 
(HandlerRef.HANDLER_PARAMVALUE.equals(handler.get(i + 1).getType())) {
+paramName = (String) 
handlerRef.get(i).getContent();
+if 
(HandlerRef.HANDLER_PARAMVALUE.equals(handlerRef.get(i + 1).getType())) {
 i++;
-paramValue = (String) 
handler.get(i).getContent();
+paramValue = (String) 
handlerRef.get(i).getContent();
 }
 config.put(paramName, paramValue);
-} else if 
(HandlerRef.HANDLER_SOAPROLE.equals(handler.get(i).getType())) {
+} else if 
(HandlerRef.HANDLER_SOAPROLE.equals(handlerRef.get(i).getType())) {
 String soaprole = "";
-soaprole = (String) handler.get(i).getContent();
+soaprole = (String) handlerRef.get(i).getContent();
 soaproles.add(soaprole);
-} else if 
(HandlerRef.HANDLER_PORTNAME.equals(handler.get(i).getType())) {
+} else if 
(HandlerRef.HANDLER_PORTNAME.equals(handlerRef.get(i).getType())) {
 String portName = "";
-portName = (String) handler.get(i).getContent();
+portName = (String) handlerRef.get(i).getContent();
 portNames.add(portName);
 }
 
 // Set the handlers informations
-handlerr

Re: svn commit: r907390 - in /tomcat/site/trunk: docs/whoweare.html xdocs/whoweare.xml

2010-02-13 Thread Mark Thomas
On 12/02/2010 23:50, Konstantin Kolinko wrote:
> 2010/2/11 Mark Thomas :
>> On 07/02/2010 07:33, t...@apache.org wrote:
>>> Author: timw
>>> Date: Sun Feb  7 07:33:25 2010
>>> New Revision: 907390
>>>
>>> URL: http://svn.apache.org/viewvc?rev=907390&view=rev
>>> Log:
>>> Adding timw to committers list.
>>
>> Tim when you did svn up on people.a.o you didn't set your umask first.
>> You are now the only person that can modify this file. Please can you do
>> a chmod g+w on that file so anyone in the Tomcat group can update it.
>>
>> Cheers,
>>
>> Mark
>>
> 
> SVN ignores those permissions.  I just updated that file (in r909660)
> and it just let me to do so, regardless of -rw-r--r-- mode of it.
> Note, that the .svn/entries file even has -r--r--r-- on it, but is
> updated by svn.

Hmm. Odd. I wonder if the directory level permissions are essentially
allowing a delete followed by creating a new file? Anyway, as log as it
works - that is the main thing.

> Still, having
> umask 002
> in your .profile  is recommended.

+1.  Not setting umask has certainly caused issues in the past.

> Mark, please update the group owner for the  tomcat-5.5-doc symlink.
> It is owned by your private group (markt) right now.

Odd. chgrp doesn't have an affect but deleting and re-creating works.
Anyway, this too is fixed.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r909845 - /tomcat/trunk/java/org/apache/catalina/connector/Connector.java

2010-02-13 Thread kkolinko
Author: kkolinko
Date: Sat Feb 13 16:37:49 2010
New Revision: 909845

URL: http://svn.apache.org/viewvc?rev=909845&view=rev
Log:
reverted Filip's r909673

Modified:
tomcat/trunk/java/org/apache/catalina/connector/Connector.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Connector.java?rev=909845&r1=909844&r2=909845&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/Connector.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Connector.java Sat Feb 13 
16:37:49 2010
@@ -539,7 +539,7 @@
 
 /**
  * Return the port number on which we listen for requests.
- /
+ */
 public int getPort() {
 
 return (this.port);
@@ -558,10 +558,6 @@
 setProperty("port", String.valueOf(port));
 
 }
-
-public int getPort() {
-return this.port;
-}
 
 
 /**



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r909860 - /tomcat/tc6.0.x/trunk/STATUS.txt

2010-02-13 Thread kkolinko
Author: kkolinko
Date: Sat Feb 13 17:55:11 2010
New Revision: 909860

URL: http://svn.apache.org/viewvc?rev=909860&view=rev
Log:
split EL fixes vote into individual patches, for clarity
veto the Enum EL patch backport

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=909860&r1=909859&r2=909860&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat Feb 13 17:55:11 2010
@@ -107,59 +107,64 @@
 
 * Fix various EL TCK failures
   http://svn.apache.org/viewvc?view=rev&rev=899653 (signatures)
+   +1: markt, kkolinko
+   -1:
+
   http://svn.apache.org/viewvc?view=rev&rev=899769 (CCE expected)
   http://svn.apache.org/viewvc?view=rev&rev=899770 (CCE expected)
+   +1: markt, kkolinko
+   -1:
+ kkolinko: Maybe better name for that message, because it says about
+ arrays, yet name is rather generic
+
   http://svn.apache.org/viewvc?view=rev&rev=899783 (ELException expected)
+   +1: markt, kkolinko
+   -1:
+
   http://svn.apache.org/viewvc?view=rev&rev=899788 (PNFE expected)
+   +1: markt, kkolinko
+   -1:
+ kkolinko: I think 
o.a.jasper.el.ELResolverImpl#getType(ELContext,Object,Object)
+ should likewise throw a PropertyNotFoundException instead of returning 
null.
+ I have no test, though.
+
   http://svn.apache.org/viewvc?view=rev&rev=899792 (ELException rather than 
IAE)
+   +1: markt, kkolinko
+   -1:
+
   http://svn.apache.org/viewvc?view=rev&rev=899916 (ELException rather than 
IAE)
+   +1: markt, kkolinko
+   -1:
+
   http://svn.apache.org/viewvc?view=rev&rev=899918 (Enum coercion test cases)
   http://svn.apache.org/viewvc?view=rev&rev=899919 (Enum coercion bug) 
+   +1: markt
+   -1: kkolinko:
+ As far as I am reading, there is no provision in the EL
+ spec, that enum -> enum conversion can be performed by using its
+ string value.
+
+ The current TC 6.0 behaviour here will be a ClassCastException, trying
+ to assign the value, and that should be an ELException instead.
+
+ In EL 2.1 and 2.2 specifications chapter 1.18.6 'Coerce A to an Enum Type 
T' says:
+   "If A is a String call Enum.valueOf(T.getClass(), A) and return the 
result."
+ Thus, our
+  result = Enum.valueOf(type, obj.toString());
+ should only be applicable if obj is a String.
+
+ In ELSupport#coerceToType(Object, Class), that implements 1.18.7, we
+ already throw an ELException if A is not a String.
+
   http://svn.apache.org/viewvc?view=rev&rev=899935 (ELException expected)
-  http://svn.apache.org/viewvc?view=rev&rev=899949 (ignore whitespace on comp)
-  +1: markt
-  +1: kkolinko:
- 899653: OK.  We do not have @Deprecated annotations in those classes,
-  so the patch is about adding @SuppressWarnings("dep-ann")
- 899769: With 899770 that backports the message string used here. 
- 899770: OK
- (Maybe better name for that message, because it says about arrays,
- yet name is rather generic).
- 899783: OK
- 899788: OK
- (Likewise, 
o.a.jasper.el.ELResolverImpl#getType(ELContext,Object,Object)
- should probably throw a PropertyNotFoundException, instead of 
returning null.
- I have no proof, though.)
- 899792: OK
- 899916: OK
-
- 899918, 899919: OK, but there is probably an omission in the EL spec:
- I do not see why we do conversion Enum->Enum via toString() call.
-
- The EL spec chapter 1.18.6 'Coerce A to an Enum Type T' says
-"If A is a String call Enum.valueOf(T.getClass(), A) and return 
the result."
- It does not say what to do if A is not a String. (There is no
- explicit "Otherwise, error" statement below).
-
- In 1.18.7 (aka ELSupport#coerceToType(Object, Class)) we throw
- an error if A is not a String. Even if T has a PropertyEditor,
- we do not do  editor.setAsText(obj.toString()),  as the spec does
- not say to do so, but throw an exception.
-
- (In 1.18.7 the spec says "Otherwise, apply T's PropertyEditor",
- but PropertyEditor can be applied only is A is a String. Am I right?)
-
- Without 899919 patch we will throw a ClassCaseException when object 
type
- is a different type of enum, but other values are still converted
- via toString() call.  The patch makes that behaviour consistent, even
- if I do not understand why it is allowed.
-
- 899935: OK
- 899949: OK,
- but why ValueExpressionImpl.equals() is implemented as comparing
- the hash codes? What will happen with false positives?
+  +1: markt, kkolinko
+  -1:
 
-  -1: 
+  http://svn.apache.org/viewvc?view=rev&rev=899949 (ignore whitespace on comp)
+  +1: markt, kkolinko
+  -1:
+ kkolinko: Why ValueExpressionImpl.equals() is implemented as compari

svn commit: r909865 - /tomcat/trunk/java/org/apache/jasper/compiler/Generator.java

2010-02-13 Thread kkolinko
Author: kkolinko
Date: Sat Feb 13 18:04:52 2010
New Revision: 909865

URL: http://svn.apache.org/viewvc?rev=909865&view=rev
Log:
JavaDoc correction

Modified:
tomcat/trunk/java/org/apache/jasper/compiler/Generator.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=909865&r1=909864&r2=909865&view=diff
==
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Sat Feb 13 
18:04:52 2010
@@ -168,7 +168,7 @@
 }
 
 /**
- * Finds the  subelement of the given parent node. If not
+ * Finds the  subelement of the given parent node. If not
  * found, null is returned.
  */
 protected static Node.JspBody findJspBody(Node parent) {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r909866 - /tomcat/trunk/java/org/apache/jasper/compiler/Generator.java

2010-02-13 Thread kkolinko
Author: kkolinko
Date: Sat Feb 13 18:14:32 2010
New Revision: 909866

URL: http://svn.apache.org/viewvc?rev=909866&view=rev
Log:
JavaDoc correction

Modified:
tomcat/trunk/java/org/apache/jasper/compiler/Generator.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=909866&r1=909865&r2=909866&view=diff
==
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Sat Feb 13 
18:14:32 2010
@@ -962,9 +962,9 @@
 }
 
 /**
- * Scans through all child nodes of the given parent for 
- * subelements. For each  element, if its value is specified via
- * a Named Attribute (), generate the code to evaluate
+ * Scans through all child nodes of the given parent for 
+ * subelements. For each  element, if its value is 
specified via
+ * a Named Attribute (), generate the code to 
evaluate
  * those bodies first.
  * 
  * If parent is null, simply returns.
@@ -1380,7 +1380,7 @@
 public void visit(Node.PlugIn n) throws JasperException {
 
 /**
- * A visitor to handle  in a plugin
+ * A visitor to handle  in a plugin
  */
 class ParamVisitor extends Node.Visitor {
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r909867 - /tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java

2010-02-13 Thread kkolinko
Author: kkolinko
Date: Sat Feb 13 18:16:05 2010
New Revision: 909867

URL: http://svn.apache.org/viewvc?rev=909867&view=rev
Log:
JavaDoc correction

Modified:
tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java?rev=909867&r1=909866&r2=909867&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java Sat Feb 
13 18:16:05 2010
@@ -949,9 +949,9 @@
 }
 
 /**
- * Scans through all child nodes of the given parent for 
- * subelements. For each  element, if its value is specified via
- * a Named Attribute (), generate the code to evaluate
+ * Scans through all child nodes of the given parent for 
+ * subelements. For each  element, if its value is 
specified via
+ * a Named Attribute (), generate the code to 
evaluate
  * those bodies first.
  * 
  * If parent is null, simply returns.
@@ -1376,7 +1376,7 @@
 public void visit(Node.PlugIn n) throws JasperException {
 
 /**
- * A visitor to handle  in a plugin
+ * A visitor to handle  in a plugin
  */
 class ParamVisitor extends Node.Visitor {
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48737] New: JspCompilationContext assumes that tagfile with a path starting with META-INF are in jars without checking

2010-02-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48737

   Summary: JspCompilationContext assumes that tagfile with a path
starting with META-INF are in jars without checking
   Product: Tomcat 6
   Version: 6.0.24
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Jasper
AssignedTo: dev@tomcat.apache.org
ReportedBy: fgi...@apache.org


Created an attachment (id=24978)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24978)
patch to JspCompilationContext

This is a pretty special case, since tagfiles in META-INF are usually in jar
files...
but when using a custom dircontext implementation (usually during development
in order to load files from the filesystem without building a full jar) it may
happen that the path given to jasper starts with META-INF also if the file is
not in a jar. This is what happens using the Eclipse WTP tomcat loader, which
loads classes from the workspaces and tld/tagfiles from directories inside your
projects.

Tagfiles contained in META-INF directories worked properly till tomcat 6.0.17,
but the final fix for BUG 43741 broke it (I am still using 6.0.16 and not
upgrading due to this problem).

Looking at JspCompilationContext.getResource() the patch to solve this problem
would be very simple and "safe": if the path starts with META-INF and a jar
file containing the tld doesn't exist the resulting URL is simply null.
Adding a check for the null jar and setting the URL to the "standard" path
inside the context fixes the problem and everything starts working again (note
that this doesn't break the previous fix and it can't cause any problem, since
the result would have been null anyway).


A patch against trunk (2010-02-13) is attached, the following code should
easily displays what the patch does: 

URL result = null;
if (res.startsWith("/META-INF/")) {
   // some lines to get the jar url
   // ...
   if (jarUrl != null) {
   result = new URL(jarUrl.toExternalForm() + res.substring(1));
   }
+  else {
+  // the path starts with /META-INF but the file is not in a jar
+  result = context.getResource(canonicalURI(res));
+  }
}

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r909869 - /tomcat/trunk/java/org/apache/jasper/JspC.java

2010-02-13 Thread markt
Author: markt
Date: Sat Feb 13 18:25:07 2010
New Revision: 909869

URL: http://svn.apache.org/viewvc?rev=909869&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48371
Skip comments when working out where to insert generated servlets and 
associated mappings

Modified:
tomcat/trunk/java/org/apache/jasper/JspC.java

Modified: tomcat/trunk/java/org/apache/jasper/JspC.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspC.java?rev=909869&r1=909868&r2=909869&view=diff
==
--- tomcat/trunk/java/org/apache/jasper/JspC.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspC.java Sat Feb 13 18:25:07 2010
@@ -27,15 +27,18 @@
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.io.Reader;
 import java.io.Writer;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
+import java.util.Set;
 import java.util.Stack;
 import java.util.StringTokenizer;
 import java.util.Vector;
@@ -123,20 +126,31 @@
 protected static final String SWITCH_ENCODING = "-javaEncoding";
 protected static final String SWITCH_SMAP = "-smap";
 protected static final String SWITCH_DUMP_SMAP = "-dumpsmap";
-
 protected static final String SHOW_SUCCESS ="-s";
 protected static final String LIST_ERRORS = "-l";
 protected static final int INC_WEBXML = 10;
 protected static final int ALL_WEBXML = 20;
 protected static final int DEFAULT_DIE_LEVEL = 1;
 protected static final int NO_DIE_LEVEL = 0;
-
-protected static final String[] insertBefore =
-{ "", "", "",
-  "", "", "", "",
-  "", "", "",
-  "", "", "", "",
-  "" };
+protected static final Set insertBefore = new HashSet();
+
+static {
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+insertBefore.add("");
+}
 
 protected static int die;
 protected String classPath = null;
@@ -864,66 +878,37 @@
 PrintWriter writer = new PrintWriter(new FileWriter(webXml2));
 
 // Insert the  and  declarations
-int pos = -1;
-String line = null;
-while (true) {
-line = reader.readLine();
-if (line == null) {
-break;
-}
-// Skip anything previously generated by JSPC
-if (line.indexOf(insertStartMarker) >= 0) {
-while (true) {
-line = reader.readLine();
-if (line == null) {
-return;
-}
-if (line.indexOf(insertEndMarker) >= 0) {
-line = reader.readLine();
-line = reader.readLine();
+boolean inserted = false;
+int current = reader.read();
+while (current > -1) {
+if (!inserted && current == '<') {
+String element = getElement(reader);
+if (insertBefore.contains(element)) {
+// Insert generated content here
+writer.println(insertStartMarker);
+while (true) {
+String line = fragmentReader.readLine();
 if (line == null) {
-return;
+writer.println();
+break;
 }
-break;
+writer.println(line);
+}
+writer.println(insertEndMarker);
+writer.println();
+writer.write(element);
+} else if (element.contains(insertStartMarker)) {
+// Skip the previous auto-generated content
+while (!element.contains(insertEndMarker)) {
+element = getElement(reader);
 }
+} else {
+writer.write(element);
 }
-}
-for (int i = 0; i < insertBefore.length; i++) {
-pos = line.indexOf(insertBefore[i]);
-if (pos >= 0)
-break;
-}
-if (pos >= 0) {
-writer.print(line.substring(0, pos));
-break;
 } else {
-writer.println(line);
-}

svn commit: r909872 - /tomcat/tc6.0.x/trunk/STATUS.txt

2010-02-13 Thread markt
Author: markt
Date: Sat Feb 13 19:09:34 2010
New Revision: 909872

URL: http://svn.apache.org/viewvc?rev=909872&view=rev
Log:
Proposal

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=909872&r1=909871&r2=909872&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat Feb 13 19:09:34 2010
@@ -341,3 +341,9 @@
   http://svn.apache.org/viewvc?rev=909636&view=rev
   +1: markt
   -1: 
+
+* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48371
+  Take acocunt of comments when working out where to insert generated web.xml 
+  http://people.apache.org/~markt/patches/2010-02-13-bug48371.patch
+  +1: markt
+  -1: 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r909860 - /tomcat/tc6.0.x/trunk/STATUS.txt

2010-02-13 Thread Mark Thomas
On 13/02/2010 17:55, kkoli...@apache.org wrote:
>http://svn.apache.org/viewvc?view=rev&rev=899918 (Enum coercion test cases)
>http://svn.apache.org/viewvc?view=rev&rev=899919 (Enum coercion bug) 
> +   +1: markt
> +   -1: kkolinko:
> + As far as I am reading, there is no provision in the EL
> + spec, that enum -> enum conversion can be performed by using its
> + string value.

Point taken although I'd be a lot happier if there was an otherwise
error at the end of that section. There is currently a big blackhole
there in the spec.

> + The current TC 6.0 behaviour here will be a ClassCastException, trying
> + to assign the value, and that should be an ELException instead.

There are still issue with the current behaviour. I'll fix the test so
converting via toString() is not expected and then fix the code accordingly.

I'll leave this proposal here for now until I see how much needs to change.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r909875 - in /tomcat/trunk: java/org/apache/el/lang/ELSupport.java test/org/apache/el/lang/TestELSupport.java

2010-02-13 Thread markt
Author: markt
Date: Sat Feb 13 19:22:02 2010
New Revision: 909875

URL: http://svn.apache.org/viewvc?rev=909875&view=rev
Log:
Address review comments
Don't use toString() to try and co-erce any old object to an Enum - the spec 
only mentions String

Modified:
tomcat/trunk/java/org/apache/el/lang/ELSupport.java
tomcat/trunk/test/org/apache/el/lang/TestELSupport.java

Modified: tomcat/trunk/java/org/apache/el/lang/ELSupport.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/lang/ELSupport.java?rev=909875&r1=909874&r2=909875&view=diff
==
--- tomcat/trunk/java/org/apache/el/lang/ELSupport.java (original)
+++ tomcat/trunk/java/org/apache/el/lang/ELSupport.java Sat Feb 13 19:22:02 2010
@@ -185,9 +185,15 @@
 if (type.isAssignableFrom(obj.getClass())) {
 return (Enum) obj;
 }
+
+if (!(obj instanceof String)) {
+throw new ELException(MessageFactory.get("error.convert",
+obj, obj.getClass(), type));
+}
+
 Enum result;
 try {
- result = Enum.valueOf(type, obj.toString());
+ result = Enum.valueOf(type, (String) obj);
 } catch (IllegalArgumentException iae) {
 throw new ELException(MessageFactory.get("error.convert",
 obj, obj.getClass(), type));

Modified: tomcat/trunk/test/org/apache/el/lang/TestELSupport.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/lang/TestELSupport.java?rev=909875&r1=909874&r2=909875&view=diff
==
--- tomcat/trunk/test/org/apache/el/lang/TestELSupport.java (original)
+++ tomcat/trunk/test/org/apache/el/lang/TestELSupport.java Sat Feb 13 19:22:02 
2010
@@ -92,9 +92,10 @@
 Object output = null;
 try {
 output = ELSupport.coerceToEnum(TestEnumA.VALA1, TestEnumC.class);
-} finally {
-assertEquals(TestEnumC.VALA1, output);
+} catch (ELException ele) {
+// Ignore
 }
+assertNull(output);
 }
 
 private static void testIsSame(Object value) {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r909876 - /tomcat/tc6.0.x/trunk/STATUS.txt

2010-02-13 Thread markt
Author: markt
Date: Sat Feb 13 19:23:42 2010
New Revision: 909876

URL: http://svn.apache.org/viewvc?rev=909876&view=rev
Log:
Address Konstantin's review comments

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=909876&r1=909875&r2=909876&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat Feb 13 19:23:42 2010
@@ -137,7 +137,8 @@
-1:
 
   http://svn.apache.org/viewvc?view=rev&rev=899918 (Enum coercion test cases)
-  http://svn.apache.org/viewvc?view=rev&rev=899919 (Enum coercion bug) 
+  http://svn.apache.org/viewvc?view=rev&rev=899919 (Enum coercion bug)
+  http://svn.apache.org/viewvc?rev=909875&view=rev (kkolinko's review - 
toString())
+1: markt
-1: kkolinko:
  As far as I am reading, there is no provision in the EL



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48371] addWebXmlMappings does not place servlet tags correctly

2010-02-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48371

--- Comment #3 from Mark Thomas  2010-02-13 19:24:11 UTC ---
This has been fixed in trunk and proposed for 6.0.x

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r909877 - /tomcat/tc6.0.x/trunk/STATUS.txt

2010-02-13 Thread kkolinko
Author: kkolinko
Date: Sat Feb 13 19:30:48 2010
New Revision: 909877

URL: http://svn.apache.org/viewvc?rev=909877&view=rev
Log:
review comment addresses - update vote
not voting for 48616 yet - still reviewing

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=909877&r1=909876&r2=909877&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat Feb 13 19:30:48 2010
@@ -139,23 +139,8 @@
   http://svn.apache.org/viewvc?view=rev&rev=899918 (Enum coercion test cases)
   http://svn.apache.org/viewvc?view=rev&rev=899919 (Enum coercion bug)
   http://svn.apache.org/viewvc?rev=909875&view=rev (kkolinko's review - 
toString())
-   +1: markt
-   -1: kkolinko:
- As far as I am reading, there is no provision in the EL
- spec, that enum -> enum conversion can be performed by using its
- string value.
-
- The current TC 6.0 behaviour here will be a ClassCastException, trying
- to assign the value, and that should be an ELException instead.
-
- In EL 2.1 and 2.2 specifications chapter 1.18.6 'Coerce A to an Enum Type 
T' says:
-   "If A is a String call Enum.valueOf(T.getClass(), A) and return the 
result."
- Thus, our
-  result = Enum.valueOf(type, obj.toString());
- should only be applicable if obj is a String.
-
- In ELSupport#coerceToType(Object, Class), that implements 1.18.7, we
- already throw an ELException if A is not a String.
+   +1: markt, kkolinko
+   -1:
 
   http://svn.apache.org/viewvc?view=rev&rev=899935 (ELException expected)
   +1: markt, kkolinko
@@ -202,6 +187,12 @@
   +1: markt
   -1: 
 
+  Additional patches (trivial):
+  http://svn.apache.org/viewvc?rev=905643&view=rev (misprint)
+  http://svn.apache.org/viewvc?rev=909865&view=rev (javadoc)
+  +1: kkolinko
+  -1:
+
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48612
   Prevent exception on shutdown
   Port of r896193 and r905343



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r909887 - in /tomcat/trunk: conf/web.xml java/org/apache/catalina/servlets/DefaultServlet.java webapps/docs/default-servlet.xml

2010-02-13 Thread markt
Author: markt
Date: Sat Feb 13 20:12:11 2010
New Revision: 909887

URL: http://svn.apache.org/viewvc?rev=909887&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48384
Add a per context xslt option for directory listings
Make the fallback options work as described in the docs

Modified:
tomcat/trunk/conf/web.xml
tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
tomcat/trunk/webapps/docs/default-servlet.xml

Modified: tomcat/trunk/conf/web.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/conf/web.xml?rev=909887&r1=909886&r2=909887&view=diff
==
--- tomcat/trunk/conf/web.xml (original)
+++ tomcat/trunk/conf/web.xml Sat Feb 13 20:12:11 2010
@@ -80,7 +80,12 @@
   
   
   
-  
+  
+  
+  
+  
+  
+  
   
   
   

Modified: tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java?rev=909887&r1=909886&r2=909887&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java Sat Feb 
13 20:12:11 2010
@@ -124,13 +124,19 @@
 /**
  * Allow customized directory listing per directory.
  */
-protected String  localXsltFile = null;
+protected String localXsltFile = null;
 
 
 /**
+ * Allow customized directory listing per context.
+ */
+protected String contextXsltFile = null;
+
+
+/**
  * Allow customized directory listing per instance.
  */
-protected String  globalXsltFile = null;
+protected String globalXsltFile = null;
 
 
 /**
@@ -248,6 +254,7 @@
 fileEncoding = getServletConfig().getInitParameter("fileEncoding");
 
 globalXsltFile = getServletConfig().getInitParameter("globalXsltFile");
+contextXsltFile = 
getServletConfig().getInitParameter("contextXsltFile");
 localXsltFile = getServletConfig().getInitParameter("localXsltFile");
 readmeFile = getServletConfig().getInitParameter("readmeFile");
 
@@ -1195,6 +1202,9 @@
 trimmed.equalsIgnoreCase(localXsltFile))
 continue;
 
+if ((cacheEntry.name + trimmed).equals(contextXsltFile))
+continue;
+
 CacheEntry childCacheEntry =
 resources.lookupCache(cacheEntry.name + resourceName);
 if (!childCacheEntry.exists) {
@@ -1492,11 +1502,19 @@
 } catch (NamingException e) {
 if (debug > 10)
 log("localXsltFile '" + localXsltFile + "' not found", e);
-
-return null;
 }
 }
 
+if (contextXsltFile != null) {
+InputStream is =
+getServletContext().getResourceAsStream(contextXsltFile);
+if (is != null)
+return is;
+
+if (debug > 10)
+log("contextXsltFile '" + contextXsltFile + "' not found");
+}
+
 /*  Open and read in file in one fell swoop to reduce chance
  *  chance of leaving handle open.
  */

Modified: tomcat/trunk/webapps/docs/default-servlet.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/default-servlet.xml?rev=909887&r1=909886&r2=909887&view=diff
==
--- tomcat/trunk/webapps/docs/default-servlet.xml (original)
+++ tomcat/trunk/webapps/docs/default-servlet.xml Sat Feb 13 20:12:11 2010
@@ -125,9 +125,21 @@
 If you wish to customize your directory listing, you
 can use an XSL transformation. This value is an absolute
 file name which be used for all directory listings.
-This can be disabled by per webapp by also declaring the
-default servlet in your local webapp's web.xml. The format
-of the xml is shown below.
+This can be overridden per context and/or per directory. See
+contextXsltFile and localXsltFile
+below. The format of the xml is shown below.
+
+  
+  
+contextXsltFile
+
+You may also customize your directory listing by context by
+configuring contextXsltFile. This should be a context
+relative path (e.g.: /path/to/context.xslt). This
+overrides globalXsltFile. If this value is present but a
+file does not exist, then globalXsltFile will be used. If
+globalXsltFile does not exist, then the default
+directory listing will be shown.
 
   
   
@@ -136,8 +148,10 @@
 You may also customize your directory listing by directory by
 configuring localXsltFile. This should be a relative
 file name in the directory where the listing will take place.
-This overrides glob

svn commit: r909890 - /tomcat/tc6.0.x/trunk/STATUS.txt

2010-02-13 Thread markt
Author: markt
Date: Sat Feb 13 20:14:38 2010
New Revision: 909890

URL: http://svn.apache.org/viewvc?rev=909890&view=rev
Log:
Proposal

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=909890&r1=909889&r2=909890&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat Feb 13 20:14:38 2010
@@ -339,3 +339,10 @@
   http://people.apache.org/~markt/patches/2010-02-13-bug48371.patch
   +1: markt
   -1: 
+
+* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48384
+  Add a per context xslt option for directory listings
+  Make the fallback options work as described in the docs
+  http://svn.apache.org/viewvc?rev=909887&view=rev
+  +1: markt
+  -1: 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48384] globalXsltFile parameter for the DefaultServlet

2010-02-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48384

--- Comment #1 from Mark Thomas  2010-02-13 20:15:03 UTC ---
This has been fixed in trunk and proposed for 6.0.x. I also made the fallback
local->context->global->default work as described in the docs

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48738] New: GzipOutputFilter blocking data to the client browser when flushBuffer is invoked

2010-02-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48738

   Summary: GzipOutputFilter blocking data to the client browser
when flushBuffer is invoked
   Product: Tomcat 6
   Version: 6.0.20
  Platform: All
OS/Version: Mac OS X 10.4
Status: NEW
  Severity: major
  Priority: P2
 Component: Connectors
AssignedTo: dev@tomcat.apache.org
ReportedBy: jiw...@linkedin.com


Created an attachment (id=24979)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24979)
patch for the making GzipOutputFilter work with early flush

As part of our site speed optimizations (at Linkedin) we bumped into a problem
when trying to do partial flush of compressed content stream from Tomcat to the
browser. We discovered the root cause to be a couple of long outstanding JDK
bugs:

 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4255743
 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4813885

Basically, with the GzipOutputFilter turned on, the GZIPOutputStream it uses
internally buffers the data that's been sent over, and does not flush to client
(browser) when flushBuffer() is invoked.

We have produced a patch which we verified internally, that it did work to do a
partial flush on the compressed stream. We also have a unit testcase included
in the patch to quickly show the problem. 

Early flush is a quite useful technique that many sites out there can benefit
from to speed up the page download/rendering time, and by having it working in
tomcat would benefit the existing and new customers. 

Thanks!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48738] [PATCH]Allow GzipOutputFilter to send partial result when flushBuffer() is called

2010-02-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48738

Konstantin Kolinko  changed:

   What|Removed |Added

   Keywords||PatchAvailable
Summary|GzipOutputFilter blocking   |[PATCH]Allow
   |data to the client browser  |GzipOutputFilter to send
   |when flushBuffer is invoked |partial result when
   ||flushBuffer() is called
   Severity|major   |enhancement

--- Comment #1 from Konstantin Kolinko  2010-02-13 
23:47:31 UTC ---
Thank you for the patch.
I updated Summary and Severity of this issue.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48616] Struts 1.2 and bean:define tag throws jsp 1.1 regression exception

2010-02-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48616

--- Comment #15 from Konstantin Kolinko  2010-02-14 
06:07:32 UTC ---
Reviewing the fix to this issue,
I cannot find any provision in the JSP specification to support the requested
behaviour.

The question is, when we are requested to declare a Java variable whether we
should try to reuse existing declaration, or we should always declare it anew.

I cannot find anything in the spec that says about reusing existing
declaration. The only place relevant is chapter JSP.9.4.4 "Actions", and it
says that when we do a custom action, it is translated into Java code as

declare AT_BEGIN variables
{
  declare NESTED variables
  transformation of foo
}
declare AT_END variables

It just says "declare".


Looking at the example provided in Comment 2:

In struts 1.2.8 the bean:define tag is a BodyTag, which in its *Tei class
declares a variable with the scope of VariableInfo.AT_END

See
http://svn.apache.org/viewvc/struts/struts1/tags/STRUTS_1_2_8/src/share/org/apache/struts/taglib/bean/DefineTag.java?view=markup

http://svn.apache.org/viewvc/struts/struts1/tags/STRUTS_1_2_8/src/share/org/apache/struts/taglib/bean/DefineTei.java?view=markup


The OP's problem is that such a tag defines both a scoped variable and a Java
variable ("scripting variable"). It is OK to put a value into pageContext under
the same name, but duplicate Java variables are not allowed.

To be able to implement behaviour, requested in Comment 2, Tomcat would have to
track which Java variables were declared. So, to not define a variable when it
is created by the second time. But, consider the following example of mixing
scriptlets and those tags:

<% { %>



<% } { %>



<% } %>

There is no way to reliably tell the difference between the above example and
the one in Comment 2.


To conclude, I would recommend the OP to use the following construct (using the
JSTL tag library). I think, that it should be safe:








Or, use  from the same JSTL library.


Thus, I think that this issue should be closed either as WONTFIX, or as
INVALID.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r909979 - /tomcat/tc6.0.x/trunk/STATUS.txt

2010-02-13 Thread kkolinko
Author: kkolinko
Date: Sun Feb 14 06:47:40 2010
New Revision: 909979

URL: http://svn.apache.org/viewvc?rev=909979&view=rev
Log:
veto

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=909979&r1=909978&r2=909979&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sun Feb 14 06:47:40 2010
@@ -185,7 +185,33 @@
   Test cases for both bugs and the JSP TCK pass with this patch applied.
   http://people.apache.org/~markt/patches/2010-02-02-bug42390.patch
   +1: markt
-  -1: 
+  -1: kkolinko:
+1. There is a copy-paste issue in the patch:
+   vec.add(tagVarInfos[i]); call was replaced by vec.add(varInfos[i]);
+   which is wrong. This error is not present in trunk.
+
+2. isImplemetedAsFragment() method is wrong.
+   1) A fragment can also be created with  when calling a 
tag,
+ when the attribute is declared being of type JspFragment.
+ -see JSP.5.10 , or the places where the following 
method is called:
+ Generator#GeneratorVisitor#generateJspFragment(Node, String)
+
+   2) It should navigate up the parents chain. The SimpleTag can be one
+ of our parents, not necessary the immediate one.
+
+3. I think that BZ 48616 cannot/should not be fixed - see Comment 15 to
+  the issue.
+
+4. Should we fix BZ 42390 in TC 5.5, and bring on BZ 48616 there, if it
+was historically working? I have doubts.
+
+Reviewing this as a whole, I have questions regarding the following field:
+  ScriptingVariabler#ScriptingVariableVisitor#scriptVars
+It is used to introduce behaviour like requested in BZ 48616, but ...
+The BZ 42390 fix (r804734) effectively eliminates it. It looks like
+it'd be better to remove it and care about redeclarations somewhere
+else.
+- to discuss on dev@
 
   Additional patches (trivial):
   http://svn.apache.org/viewvc?rev=905643&view=rev (misprint)



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org