Take it out yourself. In your example, the path is 6 characters long plus the id length.
String path = ctx.request().path();
String id = path.substring(6, path.length());
This decision depends on the length of the route. In addition, you can pass the start and end parameters to your action:
@With({ ArgsAction.class })
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Args {
int start() default -1;
int end() default -1;
}
action :
public class ArgsAction extends Action<Args> {
@Override
public Promise<Result> call(Context ctx) throws Throwable {
final int start = configuration.start();
final int end = configuration.end();
if (start != -1) {
final String path = ctx.request().path();
String arg = null;
if (end != -1) {
arg = path.substring(start, end);
} else {
arg = path.substring(start, path.length());
}
}
return delegate.call(ctx);
}
}
JobManager:
@Args(start = 6)
public getlist(Integer id) {
return ok();
}