JSP 包含指令的文件名以避免编译它们 [英] File names for JSP include directive to avoid compilation of them

查看:26
本文介绍了JSP 包含指令的文件名以避免编译它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我加入了一个项目,其中 include JSP 指令(静态,如 C 中的 #include)避免了 JSP 中的代码重复.

I join to project where code duplication in JSP avoided by include JSP directive (static, like #include in C).

包含的文件遵循与常规 JSP 相同的命名规则:*.jsp

Included files follow same naming rules as regular JSP: *.jsp

我担心这个.它们是否需要另一个文件扩展名来防止它们被 servlet 容器编译(它们只是读取 JSP 页面的一部分)?

I worry about this. Do they need another file extension to prevent them from compilation by servlet container (they are just only parts of read JSP pages)?

或者 servlet 容器在没有请求的情况下不接触文件?

Or servlet container don't touch files if they don't requested?

如果我需要使用另一个文件扩展名如何处理 IDE.我不想错过语法高亮和完成.在 Emacs 的情况下,它很容易解决,但我不知道如何在 NetBeans 的情况下根据文件扩展名注册文件类型.

If I need to use another file extension how to deal with IDE. I don't want to miss syntax highlighting and completion. In case of Emacs it is easy to workaround, but I don't know how to register file type based on file extension in case of NetBeans.

我不是 JSP 专家,所以我阅读了JSR 267:JSP 标记库" 部分 JSP.1.10.3 包含指令",但没有找到如何解决我的问题.

I am not JSP expert so I read "JSR 267: JSP Tag Library" section "JSP.1.10.3 The include Directive" but didn't find how to resolve my question.

推荐答案

此类 JSP 文件的适当名称是 .jspf(JSP 片段),如 这个问题.

The appropriate name for such JSP files is .jspf (JSP fragment), as explained in this question.

这篇关于JSP 包含指令的文件名以避免编译它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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