简体   繁体   English

单击提交按钮时 controller 中的调用方法?

[英]call method in controller when submit button clicked?

I'm quite sure this is possible but I can't find any info on it.我很确定这是可能的,但我找不到任何信息。 Can anyone point me to the right direction please?谁能指出我正确的方向吗?

  • Take a HTML form采取 HTML 表格
  • set action to someServlet将操作设置为 someServlet
  • take method = POST采取方法 = POST
  • override doPost() and write your code there覆盖doPost()并在那里编写您的代码

See

A very sleek MVC example can be found here .可以在这里找到一个非常简洁的 MVC 示例。 You can download it, read the source code yourself to understand and grasp the concept.你可以下载它,自己阅读源代码来理解和掌握这个概念。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM