-2
我想創建一個獲取必需參數的方法。我做這樣說:澤西島的例外情況不明確
@Path("/insertPerson")
@GET
@UnitOfWork
public short insertPerson(@NotNull @QueryParam("person") Person per)
{ ... }
當我嘗試發送不帶參數的GET請求,我收到回以下HTML頁面:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 404 Not Found</title>
</head>
<body>
<h2>HTTP ERROR 404</h2>
<p>Problem accessing /person/insertPerson/. Reason:
<pre> Not Found</pre>
</p>
<hr>
<i>
<small>Powered by Jetty://</small>
</i>
<hr/>
</body>
是否有方式來控制我作爲一個空對象的結果發回?錯誤404不夠清楚,無法知道空參數導致此問題。還有一種方法可以發送簡單的字符串而不是HTML頁面嗎?