Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

java - File names for JSP include directive to avoid compilation of them

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

Included files follow same naming rules as regular JSP: *.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)?

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

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.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...