Class SecureDispatchService
from gwt like this:
@RemoteServiceRelativePath("dispatch")
public interface SecureDispatchService extends RemoteService {
Result execute( String sessionId, Action<?> action ) throws DispatchException;
}
RemoteServiceRelativePath
:
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface RemoteServiceRelativePath {
/**
* The relative path for the {@link RemoteService} implementation.
*
* @return relative path for the {@link RemoteService} implementation
*/
String value();
}
Test code is very simple:
package com.name.sbts.wbts.sm;
import net.customware.gwt.dispatch.client.secure.SecureDispatchService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
public class TestClass {
public static void main(String[] args) {
Class c = SecureDispatchService.class;
System.out.println(c.getAnnotation(RemoteServiceRelativePath.class));
System.out.println(c.getAnnotations().length);
}
}
But the result is not wanted:
null
0
I was running this code in eclipse, with JRE1.7
SecureDispatchService
is in this jar from google:
gwt-dispatch-1.2.0.jar
I used mvn eclipse:eclipse
to generate the project.
This jar file is as a referenced libraries of eclipse project, and its real path is in my .m2/repostory.
This is happening because gwt-dispatch
project is compiled using old gwt-user
dependency (gwt version 2.0.4
). In this version of gwt the RemoteServiceRelativePath
annotation doesn't have @Retention(RetentionPolicy.RUNTIME)
on it, so the RemoteServiceRelativePath
annotation is not available at the runtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With