DO NOT REPLY [Bug 42943] New: - jsp:text gets confused with other *:text elements in a JSP tag file

2007-07-20 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42943

   Summary: jsp:text gets confused with other *:text elements in a
JSP tag file
   Product: Tomcat 5
   Version: 5.0.30
  Platform: Other
OS/Version: other
Status: NEW
  Severity: normal
  Priority: P2
 Component: Jasper
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


I have a JSP .tag file (label.tagx) that I want to use in other JSPs. The tag
file looks as follows:

http://java.sun.com/JSP/Page";>
  
  http://www.whatever.com/dul";>



When I want to use this tag file in a JSP:

...
blablabla
...

I get the stacktrace at the end of this message.

However, if I replace the dul:text element with something else, such as
dul:dul:textzz, then everything works fine:

http://java.sun.com/JSP/Page";>
  
  http://www.whatever.com/dul";>


Seems like the dul:text and jsp:text tags get confused (namespace problems?)
somewhere during the page compilation.

Stacktrace:

2007-07-20 12:05:50,828 [http-8080-Processor25] ERROR
org.apache.struts.taglib.tiles.InsertTag - ServletException in
'/WEB-INF/jsp/test-page.jsp': /WEB-INF/tags/label.tagx(6,90) 
must not have any subelements
org.apache.jasper.JasperException: /WEB-INF/tags/label.tagx(6,90)
 must not have any subelements
at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
at 
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
at 
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:90)
at 
org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.java:201)
at 
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:197)
at 
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
at 
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
at
org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:201)
at
org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:514)
at 
org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:47)
at
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:565)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2324)
at 
org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
at
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:569)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2224)
at org.apache.jasper.compiler.Node$JspRoot.accept(Node.java:525)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at
org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:583)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:226)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
at 
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
at
org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:201)
at
org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFilePro

DO NOT REPLY [Bug 42839] - iPlanet / SunONE web server tomcat connector connection re-use disabled

2007-07-20 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42839


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2007-07-20 06:39 ---
This will be part of 1.2.24, which we expect to release soon.
Thanks for sharing you experience.

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

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



DO NOT REPLY [Bug 42944] New: - plus sign in url-pattern in servlet-mapping does not work

2007-07-20 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42944

   Summary: plus sign in url-pattern in servlet-mapping does not
work
   Product: Tomcat 5
   Version: 5.5.20
  Platform: Other
OS/Version: other
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


Hi all,

I had servlet-mappings that contain plus signs (they were created by JspC), 
e.g.:


  org.apache.jsp.suchergebnis_005fbu_002bbb_jsp
  /suchergebnis_bu+bb.jsp


This mapping does not work (the referred class is present)! When I change the
original file names of the JSPs such that the plus signs are replaced by a minus
signs the following mapping results:


  org.apache.jsp.suchergebnis_005fbu_002dbb_jsp
  /suchergebnis_bu-bb.jsp


Now the mapping works.

Therefore I assume that there is a bug in handling servlet mappings with plus
signs in their url pattern.

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

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



svn commit: r558127 - in /tomcat/trunk/java/org/apache: catalina/valves/ErrorReportValve.java tomcat/util/http/ServerCookie.java

2007-07-20 Thread fhanik
Author: fhanik
Date: Fri Jul 20 13:44:08 2007
New Revision: 558127

URL: http://svn.apache.org/viewvc?view=rev&rev=558127
Log:
synch from 6.0

http://svn.apache.org/viewvc?view=rev&rev=543307
http://svn.apache.org/viewvc?view=rev&rev=553410


Modified:
tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java?view=diff&rev=558127&r1=558126&r2=558127
==
--- tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java Fri Jul 
20 13:44:08 2007
@@ -104,7 +104,7 @@
 Throwable throwable =
 (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
 
-if (response.isAppCommitted()) {
+if (response.isCommitted()) {
 return;
 }
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java?view=diff&rev=558127&r1=558126&r2=558127
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java Fri Jul 20 
13:44:08 2007
@@ -130,6 +130,7 @@
 //
 // private static final String tspecials = "()<>@,;:\\\"/[]?={} \t";
 private static final String tspecials = ",; ";
+private static final String tspecials2 = ",; \"";
 
 /*
  * Tests a string and returns true if the string counts as a
@@ -154,6 +155,19 @@
return true;
 }
 
+public static boolean isToken2(String value) {
+   if( value==null) return true;
+   int len = value.length();
+
+   for (int i = 0; i < len; i++) {
+   char c = value.charAt(i);
+
+   if (c < 0x20 || c >= 0x7f || tspecials2.indexOf(c) != -1)
+   return false;
+   }
+   return true;
+}
+
 public static boolean checkName( String name ) {
if (!isToken(name)
|| name.equalsIgnoreCase("Comment") // rfc2019
@@ -213,7 +227,7 @@
 // this part is the same for all cookies
buf.append( name );
 buf.append("=");
-maybeQuote(version, buf, value);
+maybeQuote2(version, buf, value);
 
// XXX Netscape cookie: "; "
// add version 1 specific information
@@ -283,6 +297,17 @@
 buf.append('"');
 }
 }
+public static void maybeQuote2 (int version, StringBuffer buf,
+String value) {
+// special case - a \n or \r  shouldn't happen in any case
+if (isToken2(value)) {
+buf.append(value);
+} else {
+buf.append('"');
+buf.append(escapeDoubleQuotes(value));
+buf.append('"');
+}
+}
 
 // log
 static final int dbg=1;
@@ -306,12 +331,14 @@
 }
 
 StringBuffer b = new StringBuffer();
+char p = s.charAt(0);
 for (int i = 0; i < s.length(); i++) {
 char c = s.charAt(i);
-if (c == '"')
+if (c == '"' && p != '\\')
 b.append('\\').append('"');
 else
 b.append(c);
+p = c;
 }
 
 return b.toString();



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



svn commit: r558176 - in /tomcat/trunk/java/org/apache/tomcat/util/http: AcceptLanguage.java BaseRequest.java MimeMap.java Parameters.java ServerCookie.java

2007-07-20 Thread fhanik
Author: fhanik
Date: Fri Jul 20 15:18:27 2007
New Revision: 558176

URL: http://svn.apache.org/viewvc?view=rev&rev=558176
Log:
 syncing up from 6.0

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/AcceptLanguage.java
tomcat/trunk/java/org/apache/tomcat/util/http/BaseRequest.java
tomcat/trunk/java/org/apache/tomcat/util/http/MimeMap.java
tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/AcceptLanguage.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/AcceptLanguage.java?view=diff&rev=558176&r1=558175&r2=558176
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/AcceptLanguage.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/AcceptLanguage.java Fri Jul 
20 15:18:27 2007
@@ -38,44 +38,46 @@
 public class AcceptLanguage {
 
 public static Locale getLocale(String acceptLanguage) {
-   if( acceptLanguage == null ) return Locale.getDefault();
+if( acceptLanguage == null ) return Locale.getDefault();
 
-Hashtable languages = new Hashtable();
-Vector quality=new Vector();
-processAcceptLanguage(acceptLanguage, languages,quality);
+Hashtable> languages =
+new Hashtable>();
+Vector quality = new Vector();
+processAcceptLanguage(acceptLanguage, languages, quality);
 
 if (languages.size() == 0) return Locale.getDefault();
 
-Vector l = new Vector();
+Vector l = new Vector();
 extractLocales( languages,quality, l);
 
 return (Locale)l.elementAt(0);
 }
 
 public static Enumeration getLocales(String acceptLanguage) {
-   // Short circuit with an empty enumeration if null header
+// Short circuit with an empty enumeration if null header
 if (acceptLanguage == null) {
-Vector v = new Vector();
+Vector v = new Vector();
 v.addElement(Locale.getDefault());
 return v.elements();
 }
-   
-Hashtable languages = new Hashtable();
-Vector quality=new Vector();
-   processAcceptLanguage(acceptLanguage, languages , quality);
+
+Hashtable> languages =
+new Hashtable>();
+Vector quality=new Vector();
+processAcceptLanguage(acceptLanguage, languages , quality);
 
 if (languages.size() == 0) {
-Vector v = new Vector();
+Vector v = new Vector();
 v.addElement(Locale.getDefault());
 return v.elements();
 }
-   Vector l = new Vector();
-   extractLocales( languages, quality , l);
-   return l.elements();
+Vector l = new Vector();
+extractLocales( languages, quality , l);
+return l.elements();
 }
 
 private static void processAcceptLanguage( String acceptLanguage,
- Hashtable languages, Vector q)
+Hashtable> languages, Vector q)
 {
 StringTokenizer languageTokenizer =
 new StringTokenizer(acceptLanguage, ",");
@@ -90,7 +92,7 @@
 if (qValueIndex > -1 &&
 qValueIndex < qIndex &&
 qIndex < equalIndex) {
-   String qValueStr = language.substring(qValueIndex + 1);
+String qValueStr = language.substring(qValueIndex + 1);
 language = language.substring(0, qValueIndex);
 qValueStr = qValueStr.trim().toLowerCase();
 qValueIndex = qValueStr.indexOf('=');
@@ -110,11 +112,11 @@
 
 if (! language.equals("*")) {
 String key = qValue.toString();
-Vector v;
+Vector v;
 if (languages.containsKey(key)) {
-v = (Vector)languages.get(key) ;
+v = languages.get(key) ;
 } else {
-v= new Vector();
+v= new Vector();
 q.addElement(qValue);
 }
 v.addElement(language);
@@ -123,7 +125,8 @@
 }
 }
 
-private static void extractLocales(Hashtable languages, Vector q,Vector l)
+private static void extractLocales(Hashtable languages, Vector q,
+Vector l)
 {
 // XXX We will need to order by q value Vector in the Future ?
 Enumeration e = q.elements();
@@ -132,9 +135,9 @@
 (Vector)languages.get(((Double)e.nextElement()).toString());
 Enumeration le = v.elements();
 while (le.hasMoreElements()) {
-   String language = (String)le.nextElement();
-   String country = "";
-   int countryIndex = language.indexOf("-");
+St

svn commit: r558177 - in /tomcat/trunk/java/org/apache: catalina/session/JDBCStore.java catalina/util/CookieTools.java jk/server/JkMain.java

2007-07-20 Thread fhanik
Author: fhanik
Date: Fri Jul 20 15:24:26 2007
New Revision: 558177

URL: http://svn.apache.org/viewvc?view=rev&rev=558177
Log:
sync up from 6.0
http://svn.apache.org/viewvc?view=rev&rev=553716
http://svn.apache.org/viewvc?view=rev&rev=554109 


Modified:
tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java
tomcat/trunk/java/org/apache/catalina/util/CookieTools.java
tomcat/trunk/java/org/apache/jk/server/JkMain.java

Modified: tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java?view=diff&rev=558177&r1=558176&r2=558177
==
--- tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java Fri Jul 20 
15:24:26 2007
@@ -970,7 +970,7 @@
 
 /**
  * Gracefully terminate everything associated with our db.
- * Called once when this Store is stoping.
+ * Called once when this Store is stopping.
  *
  */
 public void stop() throws LifecycleException {

Modified: tomcat/trunk/java/org/apache/catalina/util/CookieTools.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/CookieTools.java?view=diff&rev=558177&r1=558176&r2=558177
==
--- tomcat/trunk/java/org/apache/catalina/util/CookieTools.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/CookieTools.java Fri Jul 20 
15:24:26 2007
@@ -1,159 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.catalina.util;
-
-import java.text.*;
-import java.util.*;
-
-import javax.servlet.http.Cookie;
-
-// XXX use only one Date instance/request, reuse it.
-
-/**
- * Cookie utils - generate cookie header, etc
- *
- * @author Original Author Unknown
- * @author [EMAIL PROTECTED]
- */
-public class CookieTools {
-
-/** Return the header name to set the cookie, based on cookie
- *  version
- */
-public static String getCookieHeaderName(Cookie cookie) {
-int version = cookie.getVersion();
-
-if (version == 1) {
-return "Set-Cookie2";
-} else {
-return "Set-Cookie";
-}
-}
-
-/** Return the header value used to set this cookie
- *  @deprecated Use StringBuffer version
- */
-public static String getCookieHeaderValue(Cookie cookie) {
-StringBuffer buf = new StringBuffer();
-getCookieHeaderValue( cookie, buf );
-return buf.toString();
-}
-
-/** Return the header value used to set this cookie
- */
-public static void getCookieHeaderValue(Cookie cookie, StringBuffer buf) {
-int version = cookie.getVersion();
-
-// this part is the same for all cookies
-
-String name = cookie.getName(); // Avoid NPE on malformed cookies
-if (name == null)
-name = "";
-String value = cookie.getValue();
-if (value == null)
-value = "";
-
-buf.append(name);
-buf.append("=");
-maybeQuote(version, buf, value);
-
-// add version 1 specific information
-if (version == 1) {
-// Version=1 ... required
-buf.append ("; Version=1");
-
-// Comment=comment
-if (cookie.getComment() != null) {
-buf.append ("; Comment=");
-maybeQuote (version, buf, cookie.getComment());
-}
-}
-
-// add domain information, if present
-
-if (cookie.getDomain() != null) {
-buf.append("; Domain=");
-maybeQuote (version, buf, cookie.getDomain());
-}
-
-// Max-Age=secs/Discard ... or use old "Expires" format
-if (cookie.getMaxAge() >= 0) {
-if (version == 0) {
-buf.append ("; Expires=");
-if (cookie.getMaxAge() == 0)
-DateTool.oldCookieFormat.format(new Date(1), buf,
-new FieldPosition(0));
-else
- 

svn commit: r558178 - in /tomcat/trunk: java/org/apache/catalina/connector/CoyoteAdapter.java java/org/apache/catalina/connector/Response.java java/org/apache/catalina/realm/RealmBase.java webapps/doc

2007-07-20 Thread fhanik
Author: fhanik
Date: Fri Jul 20 15:28:05 2007
New Revision: 558178

URL: http://svn.apache.org/viewvc?view=rev&rev=558178
Log:
up sync from 6.0
http://svn.apache.org/viewvc?view=rev&rev=554814
http://svn.apache.org/viewvc?view=rev&rev=555304 


Modified:
tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
tomcat/trunk/java/org/apache/catalina/connector/Response.java
tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java
tomcat/trunk/webapps/docs/config/http.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?view=diff&rev=558178&r1=558177&r2=558178
==
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Fri Jul 
20 15:28:05 2007
@@ -510,7 +510,7 @@
 if (request.isRequestedSessionIdFromURL()) {
 // This is not optimal, but as this is not very common, it
 // shouldn't matter
-redirectPath = redirectPath + ";jsessionid=" 
+redirectPath = redirectPath + ";" + 
Globals.SESSION_PARAMETER_NAME + "=" 
 + request.getRequestedSessionId();
 }
 if (query != null) {

Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?view=diff&rev=558178&r1=558177&r2=558178
==
--- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Fri Jul 20 
15:28:05 2007
@@ -1447,7 +1447,8 @@
 String file = url.getFile();
 if ((file == null) || !file.startsWith(contextPath))
 return (false);
-if( file.indexOf(";jsessionid=" + session.getIdInternal()) >= 0 )
+String tok = ";" + Globals.SESSION_PARAMETER_NAME + "=" + 
session.getIdInternal();
+if( file.indexOf(tok, contextPath.length()) >= 0 )
 return (false);
 }
 
@@ -1581,7 +1582,9 @@
 }
 StringBuffer sb = new StringBuffer(path);
 if( sb.length() > 0 ) { // jsessionid can't be first.
-sb.append(";jsessionid=");
+sb.append(";");
+sb.append(Globals.SESSION_PARAMETER_NAME);
+sb.append("=");
 sb.append(sessionId);
 }
 sb.append(anchor);

Modified: tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java?view=diff&rev=558178&r1=558177&r2=558178
==
--- tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java Fri Jul 20 
15:28:05 2007
@@ -37,6 +37,7 @@
 
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
+import org.apache.catalina.Globals;
 import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleListener;
@@ -944,7 +945,9 @@
 String requestedSessionId = request.getRequestedSessionId();
 if ((requestedSessionId != null) &&
 request.isRequestedSessionIdFromURL()) {
-file.append(";jsessionid=");
+file.append(";");
+file.append(Globals.SESSION_PARAMETER_NAME);
+file.append("=");
 file.append(requestedSessionId);
 }
 String queryString = request.getQueryString();

Modified: tomcat/trunk/webapps/docs/config/http.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?view=diff&rev=558178&r1=558177&r2=558178
==
--- tomcat/trunk/webapps/docs/config/http.xml (original)
+++ tomcat/trunk/webapps/docs/config/http.xml Fri Jul 20 15:28:05 2007
@@ -344,7 +344,7 @@
 
 
   The Server header for the http response.
- Unless your paranoid, you won't need this feature.
+ Unless you are paranoid, you won't need this feature.
   
 
 



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



svn commit: r558179 - in /tomcat/trunk/java/org/apache/jasper: Constants.java tagplugins/jstl/Util.java

2007-07-20 Thread fhanik
Author: fhanik
Date: Fri Jul 20 15:29:12 2007
New Revision: 558179

URL: http://svn.apache.org/viewvc?view=rev&rev=558179
Log:
up sync from 6.0
http://svn.apache.org/viewvc?view=rev&rev=555310


Modified:
tomcat/trunk/java/org/apache/jasper/Constants.java
tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java

Modified: tomcat/trunk/java/org/apache/jasper/Constants.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/Constants.java?view=diff&rev=558179&r1=558178&r2=558179
==
--- tomcat/trunk/java/org/apache/jasper/Constants.java (original)
+++ tomcat/trunk/java/org/apache/jasper/Constants.java Fri Jul 20 15:29:12 2007
@@ -196,4 +196,10 @@
 public static final boolean USE_INSTANCE_MANAGER_FOR_TAGS =
 
Boolean.valueOf(System.getProperty("org.apache.jasper.Constants.USE_INSTANCE_MANAGER_FOR_TAGS",
 "false")).booleanValue();
 
+/**
+ * The name of the path parameter used to pass the session identifier
+ * back and forth with the client.
+ */
+public static final String SESSION_PARAMETER_NAME = "jsessionid";
+
 }

Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java?view=diff&rev=558179&r1=558178&r2=558179
==
--- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java (original)
+++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java Fri Jul 20 
15:29:12 2007
@@ -18,6 +18,8 @@
 
 package org.apache.jasper.tagplugins.jstl;
 
+import org.apache.jasper.Constants;
+
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -150,7 +152,7 @@
 public static String stripSession(String url) {
 StringBuffer u = new StringBuffer(url);
 int sessionStart;
-while ((sessionStart = u.toString().indexOf(";jsessionid=")) != -1) {
+while ((sessionStart = u.toString().indexOf(";" + 
Constants.SESSION_PARAMETER_NAME + "=")) != -1) {
 int sessionEnd = u.toString().indexOf(";", sessionStart + 1);
 if (sessionEnd == -1)
 sessionEnd = u.toString().indexOf("?", sessionStart + 1);



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



svn commit: r558181 - in /tomcat/trunk: java/org/apache/catalina/startup/ContextConfig.java webapps/docs/jndi-datasource-examples-howto.xml webapps/docs/manager-howto.xml

2007-07-20 Thread fhanik
Author: fhanik
Date: Fri Jul 20 15:31:38 2007
New Revision: 558181

URL: http://svn.apache.org/viewvc?view=rev&rev=558181
Log:
up sync from 6.0
http://svn.apache.org/viewvc?view=rev&rev=556453
http://svn.apache.org/viewvc?view=rev&rev=556489
http://svn.apache.org/viewvc?view=rev&rev=556767


Modified:
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml
tomcat/trunk/webapps/docs/manager-howto.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?view=diff&rev=558181&r1=558180&r2=558181
==
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Fri Jul 20 
15:31:38 2007
@@ -881,12 +881,12 @@
 file = new File(docBase);
 String origDocBase = docBase;
 
+String contextPath = context.getPath();
+if (contextPath.equals("")) {
+contextPath = "ROOT";
+}
 if (docBase.toLowerCase().endsWith(".war") && !file.isDirectory() && 
unpackWARs) {
 URL war = new URL("jar:" + (new File(docBase)).toURL() + "!/");
-String contextPath = context.getPath();
-if (contextPath.equals("")) {
-contextPath = "ROOT";
-}
 docBase = ExpandWar.expand(host, war, contextPath);
 file = new File(docBase);
 docBase = file.getCanonicalPath();
@@ -900,7 +900,7 @@
 if (warFile.exists()) {
 if (unpackWARs) {
 URL war = new URL("jar:" + warFile.toURL() + "!/");
-docBase = ExpandWar.expand(host, war, 
context.getPath());
+docBase = ExpandWar.expand(host, war, contextPath);
 file = new File(docBase);
 docBase = file.getCanonicalPath();
 } else {

Modified: tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml?view=diff&rev=558181&r1=558180&r2=558181
==
--- tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml (original)
+++ tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml Fri Jul 20 
15:31:38 2007
@@ -42,10 +42,10 @@
 to the wider audience, or if you feel we can improve this section in 
anyway.
 
 
-Please note that JNDI resource configuration has changed somewhat between
-Tomcat 5.0.x and Tomcat 5.5.x.  You will most likely need to modify your 
JNDI
-resource configurations to match the syntax in the example below in order
-to make them work in Tomcat 5.5.x.
+Please note that JNDI resource configuration changed somewhat between
+Tomcat 5.0.x and Tomcat 5.5.x.  You will most likely need to modify older
+JNDI resource configurations to match the syntax in the example below in order
+to make them work in Tomcat 6.x.x.
 
 
 
@@ -192,15 +192,10 @@
 
 
 
-2. server.xml configuration
+2. Context configuration
 Configure the JNDI DataSource in Tomcat by adding a declaration for your
-resource to $CATALINA_HOME/conf/server.xml.
-Add this in between the  tag of the examples
-context and the  tag closing the localhost 
definition.
-If there is no such tag, you can add one as illustrated in the 
-Context and
-Host configuration references, and repeated 
below
-for your convenience.
+resource to your Context.
+For example:
 
 
 

svn commit: r558182 - in /tomcat/trunk/java/org/apache: catalina/manager/host/HTMLHostManagerServlet.java tomcat/util/http/Cookies.java

2007-07-20 Thread fhanik
Author: fhanik
Date: Fri Jul 20 15:36:07 2007
New Revision: 558182

URL: http://svn.apache.org/viewvc?view=rev&rev=558182
Log:
upsync from 6.0
http://svn.apache.org/viewvc?view=rev&rev=557454
http://svn.apache.org/viewvc?view=rev&rev=557467 


Modified:

tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java

Modified: 
tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java?view=diff&rev=558182&r1=558181&r2=558182
==
--- 
tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 
Fri Jul 20 15:36:07 2007
@@ -229,7 +229,8 @@
 for (int i = 0; i < children.length; i++)
 hostNames[i] = children[i].getName();
 
-TreeMap sortedHostNamesMap = new TreeMap();
+TreeMap sortedHostNamesMap =
+new TreeMap();
 
 for (int i = 0; i < hostNames.length; i++) {
 String displayPath = hostNames[i];
@@ -240,15 +241,16 @@
 String hostsStop = sm.getString("htmlHostManagerServlet.hostsStop");
 String hostsRemove = 
sm.getString("htmlHostManagerServlet.hostsRemove");
 
-Iterator iterator = sortedHostNamesMap.entrySet().iterator();
+Iterator> iterator =
+sortedHostNamesMap.entrySet().iterator();
 while (iterator.hasNext()) {
-Map.Entry entry = (Map.Entry) iterator.next();
+Map.Entry entry = iterator.next();
 String hostName = (String) entry.getKey();
 Host host = (Host) engine.findChild(hostName);
 
 if (host != null ) {
 args = new Object[2];
-args[0] = hostName;
+args[0] = RequestUtil.filter(hostName);
 String[] aliases = host.findAliases();
 StringBuffer buf = new StringBuffer();
 if (aliases.length > 0) {
@@ -260,9 +262,11 @@
 
 if (buf.length() == 0) {
 buf.append(" ");
+args[1] = buf.toString();
+} else {
+args[1] = RequestUtil.filter(buf.toString());
 }
 
-args[1] = buf.toString();
 writer.print
 (MessageFormat.format(HOSTS_ROW_DETAILS_SECTION, args));
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java?view=diff&rev=558182&r1=558181&r2=558182
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java Fri Jul 20 
15:36:07 2007
@@ -249,9 +249,11 @@
 int endValue=startValue;
 
 cc=bytes[pos];
-if(  cc== '\'' || cc=='"' ) {
-startValue++;
-endValue=indexOf( bytes, startValue, end, cc );
+if( cc=='"' ) {
+endValue=findDelim3( bytes, startValue+1, end, cc );
+if (endValue == -1) {
+endValue=findDelim2( bytes, startValue+1, end );
+} else startValue++;
 pos=endValue+1; // to skip to next cookie
  } else {
 endValue=findDelim2( bytes, startValue, end );
@@ -335,28 +337,26 @@
 return off;
 }
 
-public static int indexOf( byte bytes[], int off, int end, byte qq )
+/*
+ *  search for cc but skip \cc as required by rfc2616
+ *   (according to rfc2616 cc should be ")
+*/
+public static int findDelim3( byte bytes[], int off, int end, byte cc )
 {
 while( off < end ) {
 byte b=bytes[off];
-if( b==qq )
+if ( b== '\\' ) {
+  off++;
+  off++;
+  continue;
+}
+if( b==cc )
 return off;
 off++;
 }
-return off;
+return -1;
 }
 
-public static int indexOf( byte bytes[], int off, int end, char qq )
-{
-while( off < end ) {
-byte b=bytes[off];
-if( b==qq )
-return off;
-off++;
-}
-return off;
-}
-
 // XXX will be refactored soon!
 public static boolean equals( String s, byte b[], int start, int end) {
 int blen = end-start;
@@ -412,7 +412,7 @@
 /**
  *
  * Strips quotes from the start and end of the cookie string
- * This conforms to RFC 2109
+ * This conforms to RFC 2965
  * 
  * @param valuea String

svn commit: r558184 - /tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java

2007-07-20 Thread fhanik
Author: fhanik
Date: Fri Jul 20 15:41:17 2007
New Revision: 558184

URL: http://svn.apache.org/viewvc?view=rev&rev=558184
Log:
missing import

Modified:

tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java

Modified: 
tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java?view=diff&rev=558184&r1=558183&r2=558184
==
--- 
tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 
Fri Jul 20 15:41:17 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,11 +33,11 @@
 import org.apache.catalina.Container;
 import org.apache.catalina.Host;
 import org.apache.catalina.util.ServerInfo;
-
+import org.apache.catalina.util.RequestUtil;
 /**
 * Servlet that enables remote management of the virtual hosts deployed
 * on the server.  Normally, this functionality will be protected by a security
-* constraint in the web application deployment descriptor.  However, 
+* constraint in the web application deployment descriptor.  However,
 * this requirement can be relaxed during testing.
 * 
 * The difference between the HostManagerServlet and this
@@ -78,7 +78,7 @@
 String command = request.getPathInfo();
 
 String name = request.getParameter("name");
- 
+
 // Prepare our output writer to generate the response message
 response.setContentType("text/html; charset=" + Constants.CHARSET);
 
@@ -102,7 +102,7 @@
 list(request, response, message);
 }
 
-
+
 /**
  * Add a host using the specified parameters.
  *
@@ -135,7 +135,7 @@
 return stringWriter.toString();
 }
 
-
+
 /**
  * Start the host with the specified name.
  *
@@ -151,7 +151,7 @@
 return stringWriter.toString();
 }
 
-
+
 /**
  * Stop the host with the specified name.
  *
@@ -167,7 +167,7 @@
 return stringWriter.toString();
 }
 
-
+
 /**
  * Render a HTML list of the currently active Contexts in our virtual host,
  * and memory and server status information.
@@ -304,7 +304,7 @@
 args[4] = sm.getString("htmlHostManagerServlet.addAliases");
 args[5] = sm.getString("htmlHostManagerServlet.addAppBase");
 writer.print(MessageFormat.format(ADD_SECTION_START, args));
- 
+
 args = new Object[3];
 args[0] = sm.getString("htmlHostManagerServlet.addAutoDeploy");
 args[1] = "autoDeploy";
@@ -335,7 +335,7 @@
 args[1] = "manager";
 args[2] = "checked";
 writer.print(MessageFormat.format(ADD_SECTION_BOOLEAN, args));
-
+
 args = new Object[1];
 args[0] = sm.getString("htmlHostManagerServlet.addButton");
 writer.print(MessageFormat.format(ADD_SECTION_END, args));
@@ -370,7 +370,7 @@
 writer.close();
 }
 
-
+
 // -- Private Constants
 
 // These HTML sections are broken in relatively small sections, because of
@@ -452,7 +452,7 @@
 "  \n" +
 " \n" +
 "\n" ;
-
+
 private static final String ADD_SECTION_BOOLEAN =
 "\n" +
 " \n" +
@@ -462,7 +462,7 @@
 "  \n" +
 " \n" +
 "\n" ;
-
+
 private static final String ADD_SECTION_END =
 "\n" +
 " \n" +



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