I am having a simple web application which has some static pages. The URL which comes in the browser address bar simply depends on file location in the project.
http://computername:8080/mylogin/ is my home URL.
And below are the few URLs which come when I make a single click on the main home page.
http://computername:8080/mylogin/ssis/api.jsf
http://computername:8080/mylogin/ssis/dev.jsf
I am implementing a breadcrumb. And to generate it I am using javascript by Justin Whitford.
Issue is this breadcrumb uses the browser URL to generate it. So my URL should be in some common fashion/pattern to have breadcrumb implemented properly.
I want to control these URLs. I want to make them like this.
Home: http://myLogin/
sub pages:
http://mylogin/ssis/api/
http://mylogin/ssis/dev/
All this I want to have a proper implementation of breadcrumbs.
You can deploy your webapp to the context root by deleting Tomcat’s default
/webapps/ROOTfolder altogether and renaming your webapp’smylogin.warfile toROOT.war.This way you have http://computername:8080/
You can get rid of port
8080by configuring Tomcat to listen on default HTTP port80. Open Tomcat’s/conf/server.xml, locate the<Connector port="8080">element and edit the port in there.Now you have http://computername/
You can change the computer name in platform properties or to add a forward in your hosts config file. On Windows, it’s the
system32/drivers/etc/hostsfile. Just add the following line:Now you have http://mylogin/ (note that this works for local environment only!)
As to mapping the individual pages such as
/foo.jsfon/foo, you could use a filter for this. It’s a pretty tedious job. Instead of reinventing the wheel you may want to take a look at PrettyFaces.It’s only beyond me how exactly changing the hostname, port and context name is related to generating breadcrumbs. You might be exaggerating the concrete problem or using it the wrong way.