java - Spring MVC - 如何将数据从jsp页面的按钮传递到 Controller ?

标签 java jsp spring-mvc button

我在jsp中有一行这样的代码:

<button name="CurrentDelete" value="${ra_split}" type="submit">Delete</button>

在我的 Controller 中我使用:

@RequestParam String CurrentDelete

当我点击“删除”按钮时,我试图将 ${ra_split} 的值传递到 Controller 中,但我得到的只是文本“删除”的值。这是为什么?

最佳答案

这里是解释

If you use the element in an HTML form, Internet Explorer, prior version 8, will submit the text between the and tags, while the other browsers will submit the content of the value attribute.

关于java - Spring MVC - 如何将数据从jsp页面的按钮传递到 Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29045134/

相关文章:

spring-mvc - Spring Security,错误 405 保护当前的 post 方法

java - Java 中的字符串排列(非递归)

java - 无法使用 JSTL 对 session 中的属性使用方法访问器

java - Spring MVC JSP表单错误

jsp形式的Java UTF-8编码

jsp - POJO在jsp中使用后留在内存中

java - 为什么 Spring DispatcherServlet 找不到我的 Controller 方法?

java - 您如何链接到 javadoc 中的_包描述_(不是类)?

java - 如何在另一个类中使用一个类的方法而不扩展

java - Quarkus Multi-Tenancy 应用