サービスメソッドを呼び出して、その前にいくつかの条件を確認しようとしているときに問題に直面しました
@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 には、次のメソッド シグネチャがあります。
public static Response process(@Context HttpServletRequest request, @FormParam("text") final String text) throws JSONException, IOException
このメソッド サービスを呼び出すと応答が見つからず、* コメントの行でさえ出力されませんでした。
この問題を解決するにはどうすればよいですか?