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

  • Home
  • SEARCH
  • 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 9213615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:47:24+00:00 2026-06-18T01:47:24+00:00

I am using a <p:commandButton> for navigation and set ajax=false , however the addressbar

  • 0

I am using a <p:commandButton> for navigation and set ajax="false", however the addressbar won’t update to match the target page as defined in action-attribute. It still shows the address of the initial page with the <p:commandButton>.
I could swear it was not always like that. Is this behaviour normal?
How could I fix this still using <p:commandButton> for navigation?

my code:

<p:commandButton value="speichern" action="secondPage" ajax="false"/>
  • 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-18T01:47:25+00:00Added an answer on June 18, 2026 at 1:47 am

    Yes, this is normal behavior if you fire a POST request. The <form action> as generated by <h:form> defaults to the current URL (rightclick, View Source in browser to see it yourself). Exactly this URL get reflected in browser address bar. If you want to change it after POST, you need to send a redirect afterwards. A redirect basically instructs the client to send a new GET request on the given URL. This will get reflected in browser address bar. This can be done by adding faces-redirect=true query string parameter to the outcome value.

    <p:commandButton value="speichern" action="secondPage?faces-redirect=true" ajax="false"/>
    

    However, using POST for navigation is bad for UX and SEO. Just use GET in first place.

    <p:button value="speichern" outcome="secondPage"/>
    

    See also:

    • When should I use h:outputLink instead of h:commandLink?
    • Difference between h:button and h:commandButton
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sometimes, when using <h:commandLink> , <h:commandButton> or <f:ajax> , the action , actionListener or
I have this piece of code for render a popup, using f:ajax: <h:commandButton id
I'm developing JSF 2 web application and using implicit navigation from page to page
Using a commandButton in a jsf Page to download a file. Using: JSF &
I want to set focus on commandButton field in JSF2(Mojarra) on page load. How
We are using Richfaces 3.3.3.Final. Our problem is about navigation problem on a4j:commandButton .
I am using this in a page: <f:event type=preRenderView listener=#{bean.logoutIfNotAuthenticated}/> it works. However, the
I'm using GlassFish 3.1, and trying to pass parameter to commandButton action. Following is
I'm using Primefaces 3.2 with JSF 2.0. I'm using a <p:commandButton action=#{myBackingBean.action} value=press me
I'm using Primefaces 3.3.1 and have question. I have p:commandButton inside p:column of p:dataTable.

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.