This content has been marked as final. Show 1 reply
I am also new to web applications and JSF. But I can tell you that its a little hard to programically achieve the security you want to achieve i.e. displaying some error page if the user is not logged in, however you can do it relatively easily using web.xml or sun-web.xml files by defining some roles, filters etc.
I read that somewhere, try searching on Google...I have not implemented that myself.
As far as obtaning the root directory of web application is concerned you may try following in your button_action method or any where in Page Bean class:
Then use "rootPath" where ever you want, it contains the path of the root directory.
ServletContext theApplicationsServletContext = (ServletContext) this.getExternalContext().getContext(); String rootPath = theApplicationsServletContext.getRealPath("/");
It atleast works for me.....
Its strange that no one has answered this query for so long. Hope someone does early, I also want the clear answer.
Edited by: T.B.M on Oct 20, 2008 12:45 AM