Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8381175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:38:17+00:00 2026-06-09T16:38:17+00:00

In my JSF 2 I use form based authentication. The web.xml contains a single

  • 0

In my JSF 2 I use form based authentication. The web.xml contains a single login.html entry.

<login-config>
    <auth-method>FORM</auth-method>
    <realm-name>testDB</realm-name>
    <form-login-config>
        <form-login-page>/login.html</form-login-page>
        <form-error-page>/loginError.html</form-error-page>
    </form-login-config>
</login-config>

The web app has a main page (/app/index.html) and a /app/mobile/index.html to support mobile phones.

I would like to use different layouts in login.html, based on the target URL.

  • if the target URL is /app/mobile/index.html, use a login page which is optimized for small browser sizes

  • otherwise use the default login page

The login page (login.html) page is a JSF page.

Is it possible to get the ‘destination’ page within the login page with JSF, maybe using information in the FacesContext?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:38:18+00:00Added an answer on June 9, 2026 at 4:38 pm

    I found a way to get the destination request URI at https://stackoverflow.com/a/5820573/80901

    The expression

    #{requestScope['javax.servlet.forward.request_uri']}
    

    contains the value /app/index.html or /app/mobile/index.html

    Code example:

        <h:panelGroup rendered="#{requestScope['javax.servlet.forward.request_uri'] eq '/app/mobile/index.html'}">
            <h2>
                Welcome to the MOBILE login page.
            </h2>
        </h:panelGroup>
        <h:panelGroup rendered="#{requestScope['javax.servlet.forward.request_uri'] ne '/app/mobile/index.html'}">
            <h2>
                Welcome to the NON-MOBILE login page.
            </h2>
        </h:panelGroup>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web application based on JSF technology. I use Eclipse as
I have a J2EE/JSF-based web-app. It consists of an form-input, a text display and
Here is a code I use : request.jsf <h:form> <!-- form inputs ... -->
I am trying to get JSF setup to use files with a html extension.
I have a JSF web client and a Java client that both use the
i have a JSF web application. I use Beans as Spring Beans (not JSF
I have a Java-JSF Web Application on GlassFish, in which I want to use
I'm creating a JSF 2-application and I'm trying to use form validation in the
I try to create login form in web application. in JSP page I can
I found examples of programmatic login into jsf based application, like this from Balusc.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.