Incorrect URL in browser using JSF 2.0 - jsf

I'm creating login form using JSF 2.0. Below is the detailed description.
When I run the form, I get the login.xhtml
Once I get successfully logged in, I get page as temp1.xhtml and when I click the link (that I have created on temp1.xhtml page) I get temp2.xhtml page.
All is working perfectly... but the problem of URL which is described below...
When I successfully logged in, the browser still shows URL as login.xhtml instead if temp1.xhtml
when I click on the link that is on temp1.xhtml, I get temp2.xhtml page but the URL says temp1.xhtml instead of temp2.xhtml
Could any one help me to show the correct URL as I have to filter these pages and as URL is INCORRECT my filter is useless...
Please note that I am not using configuration file for directing the pages...

You have to add:
?faces-redirect=true in the end of the view that you are directing.
e.g:
return "mypage?faces-redirect=true"

you can also directly use it in the .xhtml files for example on page temp1.xhtml page in link use action="temp2?faces-redirect=true"

Related

How to get Liferay current url that is being displayed in browser?

I have two portlets on a page "Portlet A" and "Portlet B".
The page has url http://localhost:8080/web/guest/page?p_p_id="Portlet A"...
Then I submit a form in "Portlet B" and try to get current url from PortalUtil like
PortalUtil.getCurrentURL(myRequest);//p_p_id="Portlet B"...
themeDisplay.getURLCurrent(myRequest);p_p_id="Portlet B"...
But in browser before submission I see url with p_p_id="Portlet A"...
Is there a way to get url that is being shown to user?
The link I was looking for is called Referer and points to the page where the request comes from.
Thanks to Tobias Liefke
In Liferay you can find it using portlerRequest.getHttpRequest().getHeader("Referer")

Link to external URL from Modx Revolution Menu

I'm attempting to link to another site from the main navigation on my Modx Revolution 2.2.13-pl site.
I tried to create a weblink resource, but it simply loads up a page with the URL in the content of the page, then redirects to the homepage as if you had hit a page that did not exist.
Can anyone chime in on how to properly create a weblink in Modx?
Thanks.
Update: I am using a fully qualified URL to an external website.
Weblink setup:
HTML Output:
I tried to get a SS of what happens when you click the link, but it redirects too fast. It's basically my template with the resource title in H4, then the URL in the weblink field on the page as a link in the content area. Then it redirects to the homepage (which is our default 404 action)
This is works as expected. Compare with what you got.
Page:
Wayfinder output:

Logout link in JSF page

I created JSF login page which is used for client authentication. I created filter which destroys user session when the user opens page logout.html. I want to create simple http link which will be used when it's clicked to redirect user to logout.html page. What JSF tag can you recommend for page redirection?
Just use <h:outputLink>.
<h:outputLink value="logout.html">Logout</h:outputLink>
Do you know that you can even use plain HTML in JSF?
Logout

How to get the URL history after redirecting to different databases?

I have a viewPanel on an xpage that links to documents in different databases. I am able to click links to open the documents.After submit the document, i want to redirect the url to the previous viewPanel. Now the problem is that i can't open the viewPanel again and the url history(context.getHistoryUrl) is blank for redirecting to different databases. Any tips on how to get the URL history?
If you are executing a context.redirecttopage to redirect the user you could change this code so that when you're update has finished the oncomplete is being executed and does a redirect clientside to the correct url. To compute the correct url you can use the code you gave in the answer to my comment.
more info here: http://xpag.es/?192E

BrowserContent unable to render my page and redirects. What should I do?

When I log in, instead of showing the homepage, it redirects back to log in page, on valid user name and password. It only happens with BrowserContent, and not in BrowserField or any where else. What could be the problem?
[This is to be noted that I am using the sample provided in the 4.5 JDE]
More information: I have tried the page for authentication, like what happens when I input wrong user name and password, the validation is done perfectly...
I track the result of the input-stream for each of the URL, and to know why the redirection is happening.. I found that an HTML is inserted above the page's normal HTML, that shows hyperlink that an object is moved to the log in page, and the main page is not viewed at all.
More information: I have also tracked whether the set-cookie is maintained or not.. The session is maintained...
There is one more bug.. The browserContent keeps on redirecting to the page requested, and on fail of load, it gives RenderingException stating that maximum attempts of redirection fail. In case there is a referrer, it redirects the page to it. In the attachment, I have removed the link name for security.

Resources