Right now, every time I type mydomain.com
it would automatically go to mydomain.com/projectname/home.jsf
, which is my login page. Not sure why, I know I still in session meaning that I can navigate to a restricted page without login in again. So how do I make so that if I type mydomain.com
, I go to mydomain.com/projectname/CentralFeed.jsf
instead of login page if the user still in session. Here is my rough design
In my web.xml
<welcome-file-list>
<welcome-file>CentralFeed.jsf</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>jdbc-realm-scholar</realm-name>
<form-login-config>
<form-login-page>/home.jsf</form-login-page>
<form-error-page>/LoginError.jsf</form-error-page>
</form-login-config>
</login-config>
<filter>
<filter-name>MyFilter</filter-name>
<filter-class>com.scholar.servlet.MyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>MyFilter</filter-name>
<url-pattern>/CentralFeed.jsf</url-pattern>
<url-pattern>/TextBook.jsf</url-pattern>
...
</filter-mapping>
I am not sure if you guys need to know this, but I also have a Filter call MyFilter
, which map to restricted page, and check if the user still in session, if so then just chain.doFilter(req, res);
, if not then redirect to login page home.jsf