gpt4 book ai didi

jsp - JSP 的文件命名约定

转载 作者:行者123 更新时间:2023-12-02 05:11:15 26 4
gpt4 key购买 nike

JSP 文件是否有行业标准命名约定?

我遇到过来自不同来源的三种约定:

  1. 全部小写 (thisismyfile.jsp)

  2. 首字母小写的驼峰式大小写 (thisIsMyFile.jsp)

  3. 首字母大写的驼峰式大小写 (ThisIsMyFile.jsp)

最佳答案

更新答案 - 2019

自从首次回答这个问题以来,Oracle 似乎已在其文档中添加了命名约定部分:https://www.oracle.com/technetwork/articles/javase/code-convention-138726.html

JSP Names

A JSP (file) name should always begin with a lower-case letter. The name may consist of multiple words, in which case the words are placed immediately adjacent and each word commences with an upper-case letter.

因此,thisIsMyFile.jsp(上面)是最符合约定的选择。

<小时/>

2013 年的原始答案

这是我能找到的最接近官方命名约定的东西:http://www.oracle.com/technetwork/articles/javase/code-convention-138726.html .

Sun/Oracle 似乎对文件名没有意见。

我的 2 美分:我更喜欢全部小写。它最大限度地减少了移植问题的可能性。例如,从 Windows 移植到 Unix(区分大小写的操作系统)可能会导致大小写问题。

关于jsp - JSP 的文件命名约定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14245535/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com