2015-06-07 46 views
-1

我想這個轉PHP句話的jsp:等價的PHP的把jsp

if(!empty($_POST){ 
} 

請我一直在努力,我並沒有得到解決。

+0

我寧願一個Servlet,並覆蓋'doPost'然後用'RequestDispatcher'來轉發到適當的JSP。 –

回答

-1

只要做到這一點是這樣的:

boolean isSet = (request.getParameter("your_parameter_goes_here") == null); 
+0

這是回到前面。 – EJP

0

這取決於您的環境。

如果您使用Servlet,那麼您可以參考this method

完全相同的代碼爲你

// In doGet or doPost method of Servlet class 
Map<String, String[]> map = request.getParameterMap(); 

if (map != null && !map.isEmpty()) { 
} 

如果你不上的Servlet然後完成你的答案