小编HFD*_*Dev的帖子

如何为不区分大小写的URL配置Tomcat?

我需要在Tomcat中使用URL作为CASE-INSENSITIVE.我的意思是当我在浏览器的地址栏中写例如'http://localhost/index.htm'不等于'http://localhost/INDEX.htm'然后我得到错误因为这个页面(INDEX.htm)那里不是.我如何为不区分大小写的URL配置Tomcat6?谢谢

url tomcat case-insensitive

6
推荐指数
1
解决办法
1万
查看次数

在运行时访问注释

我怎样才能访问main是否checkSample类是真还是假?
我应该在Main类写什么?

    package annotation;

    import java.lang.annotation.Retention;
    import java.lang.annotation.RetentionPolicy;

    @Retention(RetentionPolicy.RUNTIME)

    public @interface annotation {
        public String name() default "Jimmy";
        public boolean check() default false;
    }
Run Code Online (Sandbox Code Playgroud)
    package annotation;

    @annotation(name = "Jack", check = false)

    public class Sample {

        public String str = "Hi";

        public void printHi(String str) {
            System.out.println(str);
        }
    }
Run Code Online (Sandbox Code Playgroud)
    package annotation;

    public class Main {
        public static void main(String[] args) {

        }
    }
Run Code Online (Sandbox Code Playgroud)

java annotations

3
推荐指数
1
解决办法
445
查看次数

标签 统计

annotations ×1

case-insensitive ×1

java ×1

tomcat ×1

url ×1