Questions tagged «java-ee-7»

5
如何从ProceedingJoinPoint获取方法的注释值?
我有以下注释。 MyAnnotation.java @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface MyAnnotation { } SomeAspect.java public class SomeAspect{ @Around("execution(public * *(..)) && @annotation(com.mycompany.MyAnnotation)") public Object procede(ProceedingJoinPoint call) throws Throwable { //Some logic } } SomeOther.java public class SomeOther{ @MyAnnotation("ABC") public String someMethod(String name){ } } 在上课中,@MyAnnotation中传递了“ ABC ” 。现在如何在SomeAspect.java类的处理方法中访问“ ABC ”值? 谢谢!

9
如何在JAX-RS Web服务上启用跨域请求?
我开发了一套宁静的Web服务。由于出现错误,我无法从远程客户端调用任何这些方法 No 'Access-Control-Allow-Origin' header is present on the requested resource. 该服务可以在localhost上完美运行。在服务器端是否有任何更改或配置要做以解决问题。即启用跨域请求。 我正在使用WildFly 8,JavaEE 7
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.