I want to mask my JSF urls, to customization purpose.
For Example:
If url is : http://localhost:8080/myapp/mypages/index.xhtml
I want to mask it as : http://localhost:8080/MyApp/Home
I want do like this for all urls of my application.
I'm sorry If this is repeated question,! If there is any similar on JSF question please point it out I'll delete this question.
Related
I am having in an url the id of a div (#latest) like this at the end:
http://example.com/discussion/64/moderators-only#latest
http://example.com/discussion/32/bugs#latest
// and so on...
How can i remove the #latest in all these url's with htaccess?
You can't. Anything after the # is a URL fragment that the browser never even sends to the server. So the only thing the webserver sees is: http://example.com/discussion/64/moderators-only. So nothing in the htaccess or even in the apache config can do anything about those fragments.
You'll need to employ some sort of javascript or client-side solution if you want to remove it. But a better question is, do you need this in order to display the content correctly? If so, then how do you expect to display the content if this is gone?
I want to hide the xhtml page name when redirecting, url should be user defined. For All redirecting pages the URL should be same only the content of the page should be changed. how i need to implement this in primefaces without using third party tool like pretty faces.
First of all, what you are talking about is not URL rewriting.
By 'URL Rewriting' we mean to show more user friendly URL instead the one your page already have.
If what you want to achieve is to have only one URL for all of your pages, maybe your should use ui:include with rendered tag for every page in your home page and keep your page name in session scoped bean, which is BAD idea and NOT a good practice.
More of this is explained here:
How to include another XHTML in XHTML using JSF 2.0 Facelets?
and what you need to add is this:
<ui:include src=".../PageOne.xhtml" rendered="#{mySessionBean.pageToShow.equalsIgnoreCase('PageOne')}" >
Anyway I don't really see any security based reason why would you need to do this. Maybe you are looking for an answer in a wrong direction.
I will let you decide if you need this or not.
I have several pages with static data, like About Us etc... Basically there's nothing dynamic about this pages... And my question is: how to implement these pages? I know I could add Pages to Pages list, and then copy/paste markup to body. But for me it would be more convienient to use MVC approach, where controller simply returns a:
return View();
from the action, and I have all my markup in cshtml file. Is it possible? If so, is it correct approach?
Yes it's possible. You just have to return a Shape with your custom content in an action marked as Themed. But I don't think that this is the correct approach. Why not just add pages? You could put HTML in the body section or even attach a custom part with the html (if you don't want to use a body part)
I have researched this question in numerous places, but I cannot find a definitive answer.
The question in detail is:
I want to import other pages from the SAME domain into EITHER an IFRAME or OBJECT TAG.
It's an html5 website, but I want the OBJECT or IFRAME tag to be searchable and not mess with SEO.
Which one do I use and why?
Which one will work better for IE 6?
basically, (and it pains me to admit) I want to find a way to have one navigation bar that import into one of these tags so i do not need to change them on every page.
There is this stackoverflow question here: Use of Iframe or Object tag to embed web pages in another
BUT it's much older and seems to dismiss html5
I'm trying to avoid:
Server side includes and
JavaScript dependency
Help is GREATLY appreciated!
This problem is the result of IE7 not displaying animated GIF's that are hidden.
for reference:
http://crunchlife.com/articles/2008/06/11/ie7s-inanimate-gif
These 2 solutions involve the use of the setTimeout function and innerHTML. These examples use absolute URL's to the images. Since I'm using JSF, I would like to use relative URL's. Is there a proper way to do this in JSF?
Those examples doesn't use absolute URL's. Your problem lies somewhere else. At least, the URL pointing to the image should be relative to the request URL of the JSF page in question. You can easily check it in the browser's address bar.
A common mistake among starters is namely that they think that it should be relative to the location of the page in the server side folder structure. This is untrue. You should look at the request URL. Determine the absolute request URL of both the JSF page and the image, then you should be able to extract the relative URL to the image from it.