I need a global filter on mobilefirst 8.0 java adapter. Am tring to write ContainerRequestFilter filter. But i need some mobilefirst data in there. ConfigurationApi,AdaptersAPI. How can i get it in this context ? Or there have other way to call some code with all java adapter methods ?
相关问题
- IBM Worklight 6.0 - Worklight Console does not sho
- Output delayed from Cordova Plugin
- Android Application Build with MobileFirst 7.1 is
- Custom ListView in Worklight using Dojo
- How to display a custom keyboard
相关文章
- Unknown realm [myRealm]. null returned for key: is
- How To Calling a Stored Procedure in Worklight
- Worklight 6.0 WL development Server not starting
- How to open the phone dialer?
- Is there a tool to install an existing Cordova 3 p
- Worklight Online + Offline Authentication
- Cannot Call determinedVisibility() never saw a con
- Getting “Cannot install applications because the c
Thanks all! Question was solved. Helped this page https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/index.html about @NameBinding annotation. and additional @Produce annotation on Filter class.
You can write a ContainerRequestFilter and use it with an adapter. All you need to do is add to the getClasses() method in the adapter application class (unless it's in the same package as the application class, in this case it will happen automatically).
You can use the @Context annotation in filters to inject any MFP API you need, just like in your resource classes.
Here is a working example: