追加を実行すると、MobileFirst Java Adapter で次のようになります。
Error 500: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
@Path("/calc")
public class Calculator {
@Context
HttpServletRequest request;
//Define the server api to be able to perform server operations
WLServerAPI api = WLServerAPIProvider.getWLServerAPI();
@GET
@Path("/addTwoIntegers/{first}/{second}")
public int addTwoIntegers(@PathParam("first") String first, @PathParam("second") String second){
int a=Integer.parseInt(first);
int b=Integer.parseInt(second);
int c=a+b;
return c;
}
}