小编caf*_*afe的帖子

Google Annotations Gallery在生产代码中有用吗?

我实际上可以在实际代码中看到Google Annotations Gallery的用途:

偶然发现代码超出了所有原因?生命是短暂的.用@Magic标记并继续:

@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);
}
Run Code Online (Sandbox Code Playgroud)

这是一个严重的问题.这可以用于实际的代码审查吗?

java annotations

14
推荐指数
1
解决办法
1661
查看次数

为Sitemesh选择合适的url模式以从我的装饰器中排除我的servlet?

我使用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)

java regex servlets spring-mvc sitemesh

4
推荐指数
1
解决办法
7937
查看次数

标签 统计

java ×2

annotations ×1

regex ×1

servlets ×1

sitemesh ×1

spring-mvc ×1