开发者

JSTL: Check if Submit was clicked

开发者 https://www.devze.com 2023-01-17 09:02 出处:网络
How can I check if the S开发者_高级运维ubmit button was clicked in JSTL?Make sure the button has a name attribute so that when it\'s pressed, an associated request parameter will be submitted. For JST

How can I check if the S开发者_高级运维ubmit button was clicked in JSTL?


Make sure the button has a name attribute so that when it's pressed, an associated request parameter will be submitted. For JSTL, it then becomes as simple as checking any other request param: ${param.nameOfTheButton}.


I dont think you can check if the submit button was clicked or not using JSTL. But you can know which submit button was clicked inside a servlet etc... for example if the button is

<input type="submit" name="Go"/>

for jsps use ${param.Go} for servlets use request.getParameter("Go");

0

精彩评论

暂无评论...
验证码 换一张
取 消