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

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

问题描述

我参与了项目,其中JSP中的代码重复被包含 JSP指令(静态,如C中的#include)所避免。

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 include指令的文件名,以避免编译它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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