Wicket in OC4J / OracleAS
November 22, 2009 Leave a comment
Recently I tried deploying wicket framework based web application in OC4J container it didn’t work, whereas the same code works well in Tomcat. While googling found a few solution which recommends to use wicket servlet configuration instead of servlet filter to resolve the issue. I did the same but no luck. Then I tried associating a bookmarkable page for the homepage then it works well. Here is the code snippet:
@Override
protected void init() {
super.init();
// this is the important line which made wicket work in OC4J
mountBookmarkablePage("/login", LoginPage.class);
}
/**
* @see org.apache.wicket.Application#getHomePage()
*/
public Class getHomePage() {
return LoginPage.class;
}
Root cause: OC4J by default doesn’t allow directory browsing hence any request ends with / been blocked.
Solution: In the above solution we are redirecting login page to /login url hence directory browsing issue doesn’t occur.