简体   繁体   English

/faces/* 的 GlassFish 3.1 问题

[英]GlassFish 3.1 problem with /faces/*

I read that a facelet can be accessed, with GF 3.1, directly by:我读到可以使用 GF 3.1 直接通过以下方式访问 facelet:

  1. http://localhost:8080/myapp/page.faces ; http://localhost:8080/myapp/page.faces
  2. http://localhost:8080/myapp/page.jsf ; http://localhost:8080/myapp/page.jsf
  3. http://localhost:8080/myapp/faces/page.xhtml . 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.我有以下错误: 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注意:一些应用程序服务器(包括 GlassFish)自动为 /faces/*、*.faces 和 *.jsf 模式提供 servlet 映射

It doesn't say it maps to .xhtml and so the result.它并没有说它映射到.xhtml等等结果。

Have you checked that JSF support is aded to your web project.您是否检查过 JSF 支持已添加到您的 web 项目中。 That was the issue for me.这对我来说是个问题。

In Eclipse IDE:在 Eclipse IDE 中:

  1. Right click Your project -> Properties右键单击您的项目-> 属性
  2. Select: Project Facets and confirm JavaServer Faces is checked. Select:Project Facets 并确认 JavaServer Faces 已选中。
  3. If not check it and in my case it needed further configuration but I think everyone can figure it from there on如果不检查它,就我而言,它需要进一步配置,但我认为每个人都可以从那里弄清楚

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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