File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes JSF File not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF File not found" Watch "JSF File not found" New topic
Author

JSF File not found

Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 505
    
    1

Hello!

You were right about that invisible exception. I removed phase listener and did the same with javascript in a few lines, but not to the end so far.
It turned out that I caught worse exception:

This line:

points to false location of my template.xhtml. I have always had a template at - file:/D:/NBPr/Olympics/Olympics-war/src/main/webapp/template.xhtml.
Why did it decide to look in folder 'user'(which also is) for template.xhtml?
Why does it look for files at location where I have my source code which I modify from IDE - D:/NBPr/Olympics/Olympics-war/src/main/?
My deployed webapp is at C:\\glassfish3\glassfish\domains\domain2\applications\Olympics.
Very interesting is that I have this error if only I move to http://localhost:8989/Olympics/user/competition/detail.xhtml
I don't get this error if I move to http://localhost:8989/Olympics/user/detail.xhtml or any other location.
On the Internet I found that this might happen due to different locales - my webapp's locale and my default locale. I set locales to be identical and it didn't help.

Reply if you have met something similar otherwise I will remove folder competition. I even renamed it and it didn't help.


True person is moral, false is right!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16070
    
  21

I have split this question off into a new topic because we were covering too many other questions in the old topic. We prefer to keep topics mostly about 1 subject so that it's easier for people to find information about specific questions.

My best guess - since this is a template - is that your template file path in a ui:include element isn't being referenced correctly. That would be in your View Definition XML (xhtml) file that includes the template.


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

Joined: Mar 29, 2012
Posts: 505
    
    1

You are totally right!
I have my template.xhtml in webapp folder.
I have my template client in webapp/user/competition folder.
Correct path to my template in template client is:
<ui:composition template="./../../template.xhtml">

Thank you for help!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16070
    
  21

You may find an absolute path (<ui:composition template="/template.xhtml">) to be more convenient. The absolute path is always relative to the root of the webapp (WAR) and never includes the context that the WAR is deployed under or the absolute filesystem path of the deployed WAR. So, for example, the absolute path for the web.xml file is "/WEB-INF/web.xml", although that one isn't something you'd use for a template!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16070
    
  21

Volodymyr Levytskyi,
Your post was moved to a new topic.
 
Consider Paul's rocket mass heater.
 
subject: JSF File not found