我实际上可以在实际代码中看到Google Annotations Gallery的用途:
偶然发现代码超出了所有原因?生命是短暂的.用@Magic标记并继续:
Run Code Online (Sandbox Code Playgroud)@Magic public static int negate(int n) { return new Byte((byte) 0xFF).hashCode() / (int) (short) '\uFFFF' * ~0 * Character.digit ('0', 0) * n * (Integer.MAX_VALUE * 2 + 1) / (Byte.MIN_VALUE >> 7) * (~1 | 1); }
这是一个严重的问题.这可以用于实际的代码审查吗?
我使用servlet配置我的Spring Web应用程序以在URL处提供图像:
/imgsrv?imgid=12345
Run Code Online (Sandbox Code Playgroud)
我也安装了Sitemesh,现在当我调用这个图像servlet时,我得到一个与这个servlet相关的装饰器异常,它不需要应用装饰器.
根据Sitemesh文档,您可以排除某些URL应用装饰器,但语法不明确.
以下哪种模式最适合将上面的URL排除在"装饰"之外:
<decorators defaultdir="/WEB-INF/view/decorators">
<excludes>
<pattern>/imgsrv*</pattern>
<pattern>/imgsrv/*</pattern>
<pattern>/imgsrv**</pattern>
<pattern>/imgsrv/**</pattern>
<pattern>/imgsrv*.*</pattern>
<pattern>/imgsrv/*.*</pattern>
</excludes>
<decorator name="main" page="main.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>
Run Code Online (Sandbox Code Playgroud)