java.lang.IllegalArgumentException:无效的 URL 模式:[xhtml]
我正在尝试部署一个非常简单的&我的第一个 JSF 应用程序(遵循 非常好的教程BalusC)在 glassfish 本地服务器上。我完成了创建应用程序的所有步骤。当我尝试在 glassfish 服务器上部署应用程序时,它失败了,并显示以下异常消息:-
cannot Deploy Playground
Deployment Error for module: Playground: Exception while deploying the app :
java.lang.IllegalArgumentException: Invalid URL Pattern: [xhtml]
任何人都可以解释错误在哪里以及如何修改它吗?
I am trying to deploy a very simple & my first JSF application (following a really good tutorial by BalusC) on glassfish local server. I completed all the steps to create the application. And when I tried to deploy the application on the glassfish server, it just failed with the following exception message:-
cannot Deploy Playground
Deployment Error for module: Playground: Exception while deploying the app :
java.lang.IllegalArgumentException: Invalid URL Pattern: [xhtml]
Could anyone explain where is the fault and how can I amend it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这不是有效的 url 模式。您可以将映射安排为前缀映射或扩展映射(来自 JSF 2.0 规范):
前缀映射:
扩展名映射:
This is not a valid url-pattern. You can arrange the mapping as prefix mapping or extension mapping (from the JSF 2.0 specification):
Prefix mapping:
Extension mapping:
您的
必须包含扩展名匹配(以*
开头)或前缀匹配(以/
开头),不仅仅是xhtml
。这就是我的做法。
Your
<url-pattern>
must either have an extension matching (starts with a*
) or prefix matching (starting with/
) included, not justxhtml
.Here's how I did mine.
Servlet 3.0 规范中介绍了 Servlet 映射的规则:
遇到此错误时,请检查 web.xml 和任何映射注释 (WebServlet,WebFilter 等)
您可以在 JSF 2.0 规范。
The rules for servlet mappings are covered in the Servlet 3.0 specs:
When you encounter this error, check your web.xml and any mapping annotations (WebServlet, WebFilter, etc.)
You can find recommendations for JSF servlet mapping in the JSF 2.0 spec.