|
![]() |
vincenzo palazzo wrote:How you load the CSS inside your error page?
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Bruno John Mccoy wrote:
WebContent -> Name of the page: errorSession.xhtml. Css path: <link href="resources/bs2/css/style.css" rel="stylesheet"/>
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Tim Holloway wrote:
Bruno John Mccoy wrote:
WebContent -> Name of the page: errorSession.xhtml. Css path: <link href="resources/bs2/css/style.css" rel="stylesheet"/>
You really should be using JSF's own resource resolution tags for this kind of stuff. It gets rid of a lot of problems, and as a bonus, promotes "skinning".
Tim Holloway wrote:I'm still trying to make sense of this.
I've got a nasty suspicion that this app is using a DIY security system and not the JEE standard security. JEE standard security avoids the issues of having to manually determine what should be done when a request or request component is unauthorized. It is also much, much less likely to get hacked. As in, I know of no documented cases of JEE security breakage, unlike virtually every DIY system - many of which can be bypassed in 10 minutes or less by unskilled users.
I don't recommend using JSF for error pages, or for that matter, for any page served out of web.xml - especially login/loginfail pages. Page/resource references in web.xml are served directly by the web application server, not via the normal external request/response system and in particular that has historically meant that the request would not go through the FacesServlet. JSPs and HTML are safe. JSF Views, I'm less certain about.
And, of course, any javascript, images, CSS or other sub-request items should not be secured if they would be requested from a page that is not secure. As a very common example, a login page should not have secured JavaScript, CSS or images, since the login page itself is not yet authenticated. So JEE standard security would loop forcing a login on the secured JavaScript, CSS and/or images.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Tim Holloway wrote:As I said. Use the JEE container security system, not a do-it-yourself system. Security is hard. I've worked with JEE since before JSPs were invented and about 90% of the user-designed login systems I've seen could be easily defeated. And that includes the ones designed by the in-house "genius". Financial, military, didn't matter. Security is a full-time job, not something to do "in addition" to writing the application. Even security professionals see their hard work defeated periodically, much less dilettantes.
There's just way too much coding being considered here, and I don't mean only login coding. Rule #1 in JSF is that the more JSF-specific code your app has, the more likely it is that you're not using JSF effectively. Most well-written JSF apps use nothing from javax.faces except for the model classes (DataModel and SelectItem). In cases where I need direct access to raw HTTP services (such as JEE beans that cannot be injected and JEE security API methods), I get by with a single utility class - which not only keeps the FacesContext out of casual code, it also can be easily mocked for offline testing.
JEE has lots of advanced features, but I rarely use them. Because I rarely actually need them. Plus a few of them are crap, and I'll avoid them until they get replaced by a cleaner standard in some future release. Which will probably break the crap stuff, if the JSF1-to-JSF2 transition has been any guide.
Also, just to complete the rant, I recommend avoiding raw HTML on JSF View Template (xhtml) files. JSF usually has an equivalent that works better and is better integrated into the JSF process. For example, the JSF resource tags don't have to know the application context path that the webapp is deployed under. They handle it automatically.