执行添加时,我在 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;
}
}