0

starting a new project, and I don't have anything really added in the project yet except base stuff. First thing I wanted to do was clean up the .xhtml/.jsf extensions. I installed:

<dependency>
    <groupId>org.omnifaces</groupId>
    <artifactId>omnifaces</artifactId>
    <version>1.5</version>
</dependency>

made directory: WEB-INF/faces-views/ put simple file in there home.xhtml in my web.xml i put:

<context-param>
    <param-name>org.omnifaces.FACES_VIEWS_SCAN_PATHS</param-name>
    <param-value>/*.xhtml</param-value>
</context-param>

<welcome-file-list>
    <welcome-file>home</welcome-file>
</welcome-file-list>

I also tried the web.xml without the context-param setting above.

(FYI: this same page worked outside omnifaces at host/context/home.xhtml)

In the logs I can see omnifaces getting loaded:

23:22:24,628 INFO  [org.omnifaces.eventlistener.VersionLoggerEventListener] (ServerService Thread Pool -- 74) Using OmniFaces version 1.5

However when i go to localhost:8080/{context}/home I get a 404:

JBWEB000309: type JBWEB000067: Status report

JBWEB000068: message /{context}/home.xhtml

JBWEB000069: description JBWEB000124: The requested resource is not available.

Container is JBoss Community latest: Janus:6.1.0.GA, JBoss Web/7.2.0.Final-redhat-1

I thought this would be a great solution considering it was so simple to set up. Does anyone know of compatibility problems I could be facing, or something i did wrong. I don't see any errors in the log files.

Thanks

Sector7B
  • 123
  • 2
  • 11

1 Answers1

0

First of all note that's it not needed to specify both org.omnifaces.FACES_VIEWS_SCAN_PATHS and put something in WEB-INF/faces-views/.

WEB-INF/faces-views/ is the no-configuration default. It's always scanned for views.

org.omnifaces.FACES_VIEWS_SCAN_PATHS is used to configure optional paths that are to be scanned.

In your case you can thus either put your views in the root (as they would normally be) and keep the configuration, or remove the configuration and keep your files in WEB-INF/faces-views/.

At any length, what you tried should have worked. I tested it with JBoss EAP 6.1 (currently at the top of the JBoss download page) and it just worked with a most minimal example. I suspect there is something else going wrong.

You can alternatively create an issue at the OmniFaces issues tracker if you want.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
  • Thanks, I should have noted i tried it 3 ways, one with the faces-views, one with SCAN_PATHS, and one with both, which is the one I shared. The fact that you got it to work gives me reason to go back and look at it again. I must have done something, thing is i don't have any other dependencies that could cause a collision, but again it must be something i did. – Sector7B Jun 17 '13 at 14:03