tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Polak <ivan.po...@f4s.sk>
Subject Re: problem with filters on Tomcat 7.0.16 and above
Date Sun, 26 Aug 2012 20:27:09 GMT
I have found, where is the problem.

problem is in StandardContextValve.java in

@Override
    public final void invoke(Request request, Response response)
        throws IOException, ServletException {

....

// Select the Wrapper to be used for this Request
        Wrapper wrapper = request.getWrapper();
        if (wrapper == null || wrapper.isUnavailable()) {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
.....

if request is : http://localhost:8080/app/index.html (direct link to
Spring MVC controller), object wrapper is not null,

and if request is : http://localhost:8080/app/invitations/ (served by
UrlRewrite filter), object wrapper is NULL!

in CoyoteAdapter.java on line 649:

request.setWrapper((Wrapper) request.getMappingData().wrapper);

is set NULL.

Ivan

On 26 August 2012 22:25, Konstantin Kolinko <knst.kolinko@gmail.com> wrote:
> 2012/8/26 Ivan Polak <ivan.polak@f4s.sk>:
>> Hi,
>>
>> I have version 4.0.5 of UrlRewriteFilter, I built it from source code
>> from svn repository (jar file created by maven build script and
>> included to project). With version 4.0.3 is also the same problem (jar
>> file downloaded from UrlRewrite home page).
>>
>> I have all rules for UrlRewriteFilter defined in urlrewrite.xml config
>> file (which is in WEB-INF directory) and all rules are loaded
>> succesfully during Tomcat server start (there were confirmation
>> messages in log file).
>>
>> When I started Tomcat server,and then in web browser I show first
>> page-welcome page, doFilter method in UrlRewriteFitlter class is
>> called (I have a breakpoint on the first line of this method).
>>
>> all defined rules for UrlRewriteFilter have the same problem.
>>
>> and now, my Tomcat debug:
>>
>> first, I have breakpoint on the first line in method:
>>
>> public ApplicationFilterChain createFilterChain(ServletRequest
>> request, Wrapper wrapper, Servlet servlet) in
>> ApplicationFilterFactory.class,
>>
>> and when I click in web browser on link
>> http://localhost:8080/app/invitations/ (or other link, which is served
>> by UrlRewrite filter, this method was not called, why ?
>>
>> and when I click in web browser on link
>> http://localhost:8080/app/user/settings.html, which is 'direct' link
>> to Spring MVC controller, createFilterChain method was called.
>>
>
> I cannot reproduce. Using current 7.0.x (dev), UrlRewriteFilter 4.0.3
> and similar configuration with three filters.
>
>> and when I click in web browser on link
>
> Maybe it was served from browser's cache, so no request was sent to Tomcat?
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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


Mime
View raw message