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 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 really hope someone can help with this problem. I have an ajax pagination
I hope someone can help with this issue. I have a popup iframe using
I really hope someone can help on this because I'm learning cocoa and have
Hope you can help me on this. I have a serial device, this device
I hope someone can help... This issue has been discussed here and I have
I hope there's a SharePoint expert here on SO who can help with this.
I hope I can explain this clearly enough. I have my main form (A)
This really, really urks me, so I hope that someone can give me a
Hope someone can help with this. I've been up and down the web and
hope you can help with this one (or even improve it - which won't

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.