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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:53:46+00:00 2026-05-16T07:53:46+00:00

hope you can help me with this: I’m working with j_security_check and have this

  • 0

hope you can help me with this:
I’m working with j_security_check and have this problem

I have a profile page that must be restricted to any unloged user,
so i add a security constraint in the web.xml file and works fine
if i try to access by adress bar, this show me the login page perfectly ok

now the problem is that: In my index page example:

http://localhost/mySite/index.xhtml

have a link

<h:commandLink action="user/Profile" />

this redirect me to profile page ok but the URL still the same

http://localhost/mySite/index.xhtml

so j_security_check don’t show the login page
as far as i’ve seen j_security_check works with url and jsf don’t
and if in the profile page press a link to ex:myImages then now the url says:

ex: http://localhost/mySite/user/Profile.xhtml

Why is this happend? is there anyway to fix this ??
Thanks in advance

an alternative i’ve been using is put a like

<a href="user/Profile.xhtml" >Profile</a>

this show me the login page but if i go to the index.xhtml and press profile this don’t find the page because redirects me to:

ex: http://localhost/mySite/user/user/Profile.xhtml

  • 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-16T07:53:46+00:00Added an answer on May 16, 2026 at 7:53 am
    <h:commandLink action="user/Profile" />
    

    A h:commandLink and h:commandButton fires a HTTP POST request (by the h:form) to the current page which in turn forwards to the given resource.

    You don’t want to use POST for page-to-page navigation. It’s not only bad user experience (URL doesn’t change, unintuive behaviour when going back/forward in browser history), but also not SEO friendly (searchbots doesn’t index POST).

    You need to replace it by h:outputLink or, as you found out, by a simple <a> element if you don’t need any JSF-ish features at all.

    As to your last problem of going directed to the wrong URL (with duplicated path): this is solved when you use h:outputLink. JSF will then take the current context path into account.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope some of you guys can help me with this problem.... I have
I have a problem with the succes page from Magento. Hope somebody can help
I hope someone can help with this. I have created a map app that
Hope you can help me with this: So, I have Nivo slider working fine
hope someone can help with this problem that's been driving me insane for ages.
I really hope someone can help with this problem. I have an ajax pagination
I hope somebody can help me with this. I have a script that generates
I hope someone can help me with this, I have this javascript code that
Hope someone can help me out with this problem I am having. I just
I hope you can help. This has been confounding me for hours. I have

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.