tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1647051 - in /tomcat/trunk/java/org/apache: catalina/connector/ catalina/manager/ catalina/manager/host/ catalina/servlets/ catalina/users/ catalina/util/ catalina/valves/ tomcat/util/http/
Date Mon, 22 Dec 2014 12:34:04 GMT
2014-12-20 23:32 GMT+03:00  <markt@apache.org>:
> Author: markt
> Date: Sat Dec 20 20:32:39 2014
> New Revision: 1647051
>
> URL: http://svn.apache.org/r1647051
> Log:
> Remove duplicate utility method.


1). RequestUtil.filter() is used in 404.jsp of manager and
host-manager applications. Those JSP pages have to be fixed as well.

2). Actually searching for uses of HttpMessages.filter() method in
Tomcat 8/7/6, it is only used once, in
org.apache.catalina.ssi.SSIMediator.encode(String,String).

The HttpMessages class is about HTTP protocol reason phrase.

As such, I think that HTML markup filtering method does not belong
there, and that is better to fix this duplicate code issue in the
opposite way by choosing  RequestUtil.filter() as the winner.

> Modified:
>     tomcat/trunk/java/org/apache/catalina/connector/Response.java
>     tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
>     tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
>     tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java
>     tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
>     tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
>     tomcat/trunk/java/org/apache/catalina/users/MemoryUser.java
>     tomcat/trunk/java/org/apache/catalina/util/RequestUtil.java
>     tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
>     tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java
>
> 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?rev=1647051&r1=1647050&r2=1647051&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original)
> +++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Sat Dec 20 20:32:39
2014
> @@ -45,12 +45,12 @@ import org.apache.catalina.Globals;
>  import org.apache.catalina.Session;
>  import org.apache.catalina.Wrapper;
>  import org.apache.catalina.security.SecurityUtil;
> -import org.apache.catalina.util.RequestUtil;
>  import org.apache.catalina.util.SessionConfig;
>  import org.apache.coyote.ActionCode;
>  import org.apache.tomcat.util.buf.CharChunk;
>  import org.apache.tomcat.util.buf.UEncoder;
>  import org.apache.tomcat.util.http.FastHttpDateFormat;
> +import org.apache.tomcat.util.http.HttpMessages;
>  import org.apache.tomcat.util.http.MimeHeaders;
>  import org.apache.tomcat.util.http.parser.MediaTypeCache;
>  import org.apache.tomcat.util.net.URL;
> @@ -1297,7 +1297,7 @@ public class Response
>              if (getContext().getSendRedirectBody()) {
>                  PrintWriter writer = getWriter();
>                  writer.print(sm.getString("coyoteResponse.sendRedirect.note",
> -                        RequestUtil.filter(absolute)));
> +                        HttpMessages.filter(absolute)));
>                  flushBuffer();
>              }
>          } catch (IllegalArgumentException e) {
>
(...)

Best regards,
Konstantin Kolinko

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


Mime
View raw message