You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Andrew Robinson <an...@gmail.com> on 2008/08/13 23:13:44 UTC

[Trinidad] GlobalConfiguratonImpl.beginRequest called once results in a "fine" log?

In 1.2.9.1, the GlobalConfiguratonImpl has the function:

public void beginRequest(final ExternalContext externalContext)

This checks to see if the this has already be called once

If it is called a second time the following code is executed:
    else
    {
      _LOG.fine("BeginRequest called multiple times for this request");
    }

This seems really lenient to me. I would think an exception should be
thrown. How come it is only a fine log? Is there an instance when this
is okay?

The reason I came across this, is that we had a user configure the
Trinidad filter incorrectly:
  <filter-mapping>
    <filter-name>trinidad</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
  </filter-mapping>
  <filter-mapping>
    <filter-name>trinidad</filter-name>
    <url-pattern>*.jspx</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
   </filter-mapping>

Due to the double-registering of the filter, exceptions were being
thrown in our code. I would like to be able to throw an exception or
at least a log a fatal/severe message when this happens.

Any opinions on this?

Let me know if it is valid to call beginRequest more than once. Also,
if you have a better means to detect an invalid filter setup, feel
free to share.

-Andrew

Re: [Trinidad] GlobalConfiguratonImpl.beginRequest called once results in a "fine" log?

Posted by Matthias Wessendorf <ma...@apache.org>.
On Wed, Aug 13, 2008 at 11:13 PM, Andrew Robinson
<an...@gmail.com> wrote:
> In 1.2.9.1, the GlobalConfiguratonImpl has the function:
>
> public void beginRequest(final ExternalContext externalContext)
>
> This checks to see if the this has already be called once
>
> If it is called a second time the following code is executed:
>    else
>    {
>      _LOG.fine("BeginRequest called multiple times for this request");
>    }
>
> This seems really lenient to me. I would think an exception should be
> thrown. How come it is only a fine log? Is there an instance when this
> is okay?
>
> The reason I came across this, is that we had a user configure the
> Trinidad filter incorrectly:
>  <filter-mapping>
>    <filter-name>trinidad</filter-name>
>    <servlet-name>Faces Servlet</servlet-name>
>    <dispatcher>FORWARD</dispatcher>
>    <dispatcher>REQUEST</dispatcher>
>  </filter-mapping>
>  <filter-mapping>
>    <filter-name>trinidad</filter-name>
>    <url-pattern>*.jspx</url-pattern>
>    <dispatcher>FORWARD</dispatcher>
>    <dispatcher>REQUEST</dispatcher>
>   </filter-mapping>
>
> Due to the double-registering of the filter, exceptions were being
> thrown in our code. I would like to be able to throw an exception or
> at least a log a fatal/severe message when this happens.
>
> Any opinions on this

I saw those messages as well, b/c of wrong cfg.
So, I am fine with it.

>
> Let me know if it is valid to call beginRequest more than once. Also,
> if you have a better means to detect an invalid filter setup, feel
> free to share.

dunno, but I think that beginReq on the Global configurator should be
called only once...

Scott actually implemented it

-M

>
> -Andrew
>



-- 
Matthias Wessendorf

Need JSF and Web 2.0?
http://code.google.com/p/facesgoodies

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org