简体   繁体   中英

GlassFish 3.1 problem with /faces/*

I read that a facelet can be accessed, with GF 3.1, directly by:

  1. http://localhost:8080/myapp/page.faces ;
  2. http://localhost:8080/myapp/page.jsf ;
  3. http://localhost:8080/myapp/faces/page.xhtml .

because that mapping is made automatically by the server.

However the last mapping doesn't work. I have the following error: The requested resource () is not available.

Any idea? Thanks!

NOTE : Some application servers (including GlassFish) automatically provide a servlet mapping for the /faces/*, *.faces, and *.jsf patterns

It doesn't say it maps to .xhtml and so the result.

Have you checked that JSF support is aded to your web project. That was the issue for me.

In Eclipse IDE:

  1. Right click Your project -> Properties
  2. Select: Project Facets and confirm JavaServer Faces is checked.
  3. If not check it and in my case it needed further configuration but I think everyone can figure it from there on

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM