宁静的Web服务计划

时间:2016-01-21 10:49:12

标签: java string web-services rest

我有以下代码如何获取返回类型为int代替String

@Path("name")
@GET
@Produces(MediaType.TEXT_PLAIN)
public String sayParam(@QueryParam("no1")int no1,@QueryParam("no2")int no2)
{
    return (no1+no2)+" ";
}

1 个答案:

答案 0 :(得分:0)

您应environments { development { dataSource { username = "root" password = "password" logSql = true dbCreate = "update" url = "jdbc:mysql://localhost/my_project?useUnicode=yes&characterEncoding=UTF-8&autoReconnect=true" } } } 使用no1+no2

int