将jsf.js.jsf重命名为jsf.js.xhtml [英] renaming jsf.js.jsf to jsf.js.xhtml

查看:158
本文介绍了将jsf.js.jsf重命名为jsf.js.xhtml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

xhtml页面包含

<script src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development" type="text/javascript"></script>

如果我删除了脚本,则javascript函数无法正常工作. 要求是仅支持.xhtml页面.因此,我继续进行操作,并删除了web.xml中.jsf的servlet映射,这导致javascript函数执行不正确.

If I remove the scripts the javascript functions do not work as expected. The requirement is to support only .xhtml pages. So, I went ahead and removed servlet-mapping for .jsf in web.xml, which results in javascript functions being executed incorrectly.

那么,我们可以将jsf.js.jsf更改为jsf.js.xhtml吗?

So, can we change jsf.js.jsf to jsf.js.xhtml?

推荐答案

如果您正确使用<h:head>而不是<head>,则应该自动完成.您完全不应将jsf.js手动包含在<script>中.将主模板中的<head>固定为<h:head>,并从Facelet模板中删除所有引用jsf.js<script>行.

That should be done automatically if you're properly using <h:head> instead of <head>. You should not manually include the jsf.js in a <script> at all. Fix the <head> in your master template to be <h:head> and remove all those <script> lines referring jsf.js from your Facelet templates.

这篇关于将jsf.js.jsf重命名为jsf.js.xhtml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆