0

Using JSF 1.2 and RichFaces 3.3.1 on JBoss 4.2.3.

I've just started on a JSF Application. It uses XHTML files for most of its content, and a login.jsp with form-based authentication for logging in, something I understand is common in JSF applications. However, I now need to include sections from the regular pages, which include a header bar and a right panel, that have RichFace styles. I've tried dozens of combinations of ways to put the Rich tags into the login page, while still allowing the submit to go through j_security_check, but so far nothing has worked. Is there a way to do this?

Greg Charles
  • 1,880
  • 4
  • 20
  • 39

1 Answers1

0

Just convert login.jsp to login.xhtml. It doesn't matter for j_security_check where the request is coming from. You can just use plain HTML in a JSF/Facelets page.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Well, the interesting thing is even when I convert it (changing the header, taking out scriptlets, fixing non-strict HTML syntax, etc.), I get one of two problems. If web.xml sets the form-login-page to login.xhtml, the login process works, but the ui:include of the top panel doesn't work. If web.xml use login.jsf, the ui:include works, but the rich style classes aren't imported, and instead of continuing on to the requested page (home.jsf), it brings up spacer.gif.jsf (an empty file) instead. spacer.gif was the last loaded image from the login page, but it still doesn't make sense to me. – Greg Charles Dec 16 '10 at 01:18
  • You should be defining the login page on FacesServlet's mapping, i.e. `login.jsf` is right. The CSS issue sounds like an absolute/relative path problem. The spacer does totally not make sense to me. How did you construct the form? You just used `
    ` right?
    – BalusC Dec 16 '10 at 01:54
  • It's:
    Adding to the confusion, if I go directly to the login page, ie., my URL is like http://myhost/myapp/login.jsf, then the RichFaces styles are brought in correctly. However, if I get to the login because of container manager security, i.e., my URL is like http://myhost/myapp/home.jsf and home is a protected page, then the page source looks the same, with the same RichFaces-added link and script tags. but drilling down into the contents of those references shows a duplication of my HTML, not the expected CSS and JS.
    – Greg Charles Dec 16 '10 at 17:45