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 5946035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:45:56+00:00 2026-05-22T16:45:56+00:00

In order to replace the default Spring security login form I came up with

  • 0

In order to replace the default Spring security login form I came up with this solution:

<form name="f" action="../j_spring_security_check" method="POST" >
    <h:panelGrid columns="2">
        <h:outputText value="Username" />
        <h:inputText id="j_username" />
        <h:outputText value="Password" />
        <h:inputText id="j_password" />
    </h:panelGrid>
    <h:commandButton value="Login" />
</form>

But instead of plain <form> tag I would like to use <h:form> since Primefaces components only work within <h:form>. Using <h:form> the form action will be set automatically by JSF to the current page, not to the value set by me in the example above. Where to I have to code the action "../j_spring_security_check" now? I tried putting it into the <h:commandButton> as follows but that doesn’t work:

<h:form name="f">
    <h:panelGrid columns="2">
        <h:outputText value="Username" />
        <h:inputText id="j_username" />
        <h:outputText value="Password" />
        <h:inputText id="j_password" />
    </h:panelGrid>

    <h:commandButton value="Click here" action="../j_spring_security_check" />
</form>

It leads to the error message Unable to find matching navigation case with from-view-id '/login.xhtml' for action '../j_spring_security_check' with outcome '../j_spring_security_check'.

Is it the only way to define a navigation case in faces-config.xml? I want to avoid using a bean for this simple use case.

  • 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-05-22T16:45:57+00:00Added an answer on May 22, 2026 at 4:45 pm

    The best solution for me is to use the default <button> tag instead. Since typical button styling is not being applied (in my case I am using Primefaces), I set it manually. Here’s the whole result:

        <h:outputStylesheet library="primefaces" name="jquery/ui/jquery-ui.css" />
        <h:outputStylesheet library="css" name="login.css" />
    
        <div class="message">
            <c:if test="#{param.error == 1 and SPRING_SECURITY_LAST_EXCEPTION != null}">
                <span class="error">#{SPRING_SECURITY_LAST_EXCEPTION.message}</span>
            </c:if>
        </div>
    
    
    
        <div class="login">
            <form action="../j_spring_security_check" method="post">
                <h:panelGrid columns="2">
                    <h:outputText value="Username" />
                    <h:inputText id="j_username" />
                    <h:outputText value="Password" />
                    <h:inputSecret id="j_password" />
                </h:panelGrid>
    
                <div class="submit">
                    <button type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
                        <span class="ui-button-text">Login</span>
                    </button>
                </div>
            </form>
        </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In order to replace default product image in Magento, we have to replace images
I have a text template with placehoders that I parse in order to replace
In order to perform a case-sensitive search/replace on a table in a SQL Server
ERROR: Microsoft JScript runtime error: Object doesn't support this property or method here is
In a nopCommerce solution, we needed to replace an existing ASP.NET page with a
We are currently implementing MOSS 2007 to replace an older portal system (Plumtree) and
When you pressed CMD F on older versions of Xcode you got the find/replace
order by in query is taking to much time in MySQL. SHOW PROFILES shows
Order by descending is not working on LINQ to Entity In the following Query
In order to fully use LinqToSql in an ASP.net 3.5 application, it is necessary

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.