Thursday, October 9, 2008

First Failure

Well that didn't take long. Filters seem to be working differently between the development and test environments. This is why we test, right. Dev is a Windows XP notebook running Jetty. Test is an OpenSolaris x86 box running GlassFish. I am glad to have a test server running OpenSolaris and GlassFish so this didn't happen on the production site. I am using a filter with a uri which works fine in dev but appears to not do anything at all in test. It should force all requests to the login page for any user that is not already logged in. I will switch to using (controller:'*', action:'*') in the filter and see if that changes the behavior on GlassFish. I suspect the way GlassFish uses domains might require the uri to be different from what works on Jetty. Or I could have done something that works for one OS and not the other.

1 comment:

  1. Here is what does work:

    class SecurityFilters {
    def filters = {
    quoteFilter(controller:'*', action:'*') {
    // Redirect to login if not logged in
    before = {
    if (actionName != "login") {
    return applicationContext.authenticationService.filterRequest( request,
    response, "${request.contextPath}/quote/login" )
    } else return true
    }}}}

    Sorry about the (lack of) formatting.

    ReplyDelete