aspose file tools*
The moose likes JSF and the fly likes Masking url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Masking url" Watch "Masking url" New topic
Author

Masking url

Maksim Ustinov
Greenhorn

Joined: Sep 15, 2008
Posts: 26
I have an enterprise application written in JAVA with JSF (using RichFaces 3.3). I'm using Glassfish server.
Currently my URL looks like this:

http://localhost/WebApplication/faces/folder1/page.jsp

Question is how do I mask my url to make it like this:

http://localhost/folder1/page.jps

Basically i want to hide "WebApplication/faces/"

Thanks
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
This actually isn´t to be called "masking url".

You need to put the webapplication in the tomcat root directory or to change the context name to root.
Also you need to change the FacesServlet mapping from /faces/* to *.jps.

If that *.jps is actually a typo: at least you need to change it to an extension-mapping, like *.jsf.
No, you can´t use *.jsp.
Maksim Ustinov
Greenhorn

Joined: Sep 15, 2008
Posts: 26
Yeah.. the "/faces/" part was easy... and .jps was a typo, i meant jsp. and I've renamed jsp to jsf. Works perfectly.

Now, because I have Enterprise project with EJBs and I'm using Glassfish I think I can't move war file to the root directory of my domain1. or i'm wrong?

right now my url looks like this:
http://localhost/WebApp/index.jsf

And I want to get rid of "WebApp" part in my url.

Thanks for your help!
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You can change the context root in the application.xml of the EAR.
Maksim Ustinov
Greenhorn

Joined: Sep 15, 2008
Posts: 26
For some reason I can't find application.xml in my project. I think I need to make it manually.
Are you sure that I need to add that to application.xml? I thought it should be somewhere on the application server level.

I'm using NetBeans to make my application, so is it possible application.xml file is missing because NetBeans did not add it?
Maksim Ustinov
Greenhorn

Joined: Sep 15, 2008
Posts: 26
I have figure out how to put application.xml to my enterprise app.

In NetBeans I just need to right-click on the EAR icon in the project view (triangle icon in NB), select New…, and choose “Standard Deployment Descriptor…”.

This will cause NetBeans to create and populate the application.xml file, including referencing the EAR’s source war files and putting in your already-defined context roots.

But when I put <context-root> </context-root> it did not work to specify root. How can I do it?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Masking url