Liferay hook: filter url giving filterstart error and current url generates exception null

Posted by jack on Stack Overflow See other posts from Stack Overflow or by jack
Published on 2010-11-11T13:55:13Z Indexed on 2010/12/30 7:53 UTC
Read the original article Hit count: 329

I'm trying to make an autologinfilter in Eclipse using a liferay hook.

Now I've added the:

<filter>
    <filter-name>myautologinfilter</filter-name>
    <filter-class>bla.bla.xyz</filter-class>
</filter>
<filter-mapping>
    <filter-name>myautologinfilter</filter-name>
    <url-pattern>/c/login/myurl</url-pattern>
</filter-mapping>

To the liferay hook's web.xml. In the liferay-hook.xml I added: portal.properties And in that hook.xml I added: auto.login.hooks=bla.bla.xyz

bla.bla.xyz implements AutoLogin, but for now it's pretty gutted:

@Override
    public String[] login(HttpServletRequest request, HttpServletResponse response)
            throws AutoLoginException {
        Object parameters = request.getAttribute("javax.servlet.forward.query_string");
        Map<String, String> x = parserClass.parsing(parameters.toString());

        System.out.println("voornaam: " + geparsdeParameters.get("tokenvalue1"));


        try {
            return null;
        } catch (Exception e) {
            throw new AutoLoginException(e);
        }

    }

Since the hook doesn't start when I add the filtering I removed it and just tried: http://localhost:8080/c/portal/login?tokenvalue1=55 but when I check my tomcat I see: Error XYZ Url: url myUsedUrl exception null


Also I tried adding some util classes but I got: classnotfoundexceptions. Is there anything specific I have to do when I add extra classes in a hook?


Any advice/input would be appreciated. Or someone's ear I could lend so I could mail them a little bit so I could pick their brain a bit would be really appreciated since I don't know anyone who programs for liferay.

© Stack Overflow or respective owner

Related posts about hook

Related posts about liferay