This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes cannot access site from subdirectory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "cannot access site from subdirectory" Watch "cannot access site from subdirectory" New topic
Author

cannot access site from subdirectory

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
Hello,

I have put a site hello.xhtml into a subdirectory called "category" and put a link going to this site:

<hutputLink value="category/hello.xhtml" title="hello">

Now, I want to access the page via:

But it does not work. The browser cannot find this site (HTTP Status 404) although my WAR has this site into this directory.

When I put the site out of the subdirectory, then it works:
<hutputLink value="/hello.xhtml" title="hello">

But I want to have subdirectories. How can I do that?
Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

Give the full path and it will work. Don't give the relative path. Or if you want to give relative path use / at the start of the URL, It may work as I am not very sure. But complete or absolute URL will work for sure.


My Blog SCJP 5 SCWCD 5
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

Looks like another one of those cases where people think just because a URL has slashes in it that it's exactly the same thing as a file path.

It's not.

Check your web.xml and see how it decodes URLs with ".xhtml" in them.


Customer surveys are for companies who didn't pay proper attention to begin with.
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
cool, that helps!

thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cannot access site from subdirectory
 
Similar Threads
Tiles
Xml Conversion
Handling IDREF in XSL
Sorry For Throwing Lengthy Codes At This Site, But I Really Need Help
How to call the javascript method in jsf while calling servlet?