Liferay hook: filter url giving filterstart error and current url generates exception null
- by jack
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.