JSTL: Check if Submit was clicked
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");
精彩评论