当我尝试调用服务方法并检查之前的某些条件时,我遇到了问题
@Path("service")
public class MyService {
@POST
@Path("process")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_PLAIN)
public static Response process(@Context HttpServletRequest request, @FormParam("text") final String text) throws JSONException, IOException {
boolean someCondition = true; // for example
System.out.println("I'm here"); //*
if (!someCondition) {
return MyClass1.process(request, text);
} else {
return MyClass2.process(request, text);
}
}
在类MyClass1和MyClass2中,我有next方法签名
public static Response process(@Context HttpServletRequest request, @FormParam("text") final String text) throws JSONException, IOException
我在调用此方法服务时没有找到响应,甚至连带有*注释的行都没有打印出来。
我该如何解决这个问题?
发布于 2014-02-18 17:49:00
我犯了一个非常愚蠢的错误静态方法:
public static Response process(@Context HttpServletRequest request, @FormParam("text") final String text) throws JSONException, IOException {
https://stackoverflow.com/questions/21526431
复制相似问题