【问题标题】:Spring Form mismatched tag errorSpring Form标签不匹配错误
【发布时间】:2015-06-28 02:46:01
【问题描述】:

我有以下(打开的)弹簧形式标签

<form:form action="<%= blobstoreService.createUploadUrl("/register") %>" class = "form-horizontal" method="post" enctype="multipart/form-data">

我在尝试运行应用程序时收到 500 错误:

/WEB-INF/view/registration/register.jsp(50,24) Attribute value  blobstoreService.createUploadUrl("/register")  is quoted with " which must be escaped when used within the value

知道我的标签有什么问题吗?

【问题讨论】:

    标签: html spring jsp spring-mvc


    【解决方案1】:

    在操作中使用单引号,因为您在括号内使用双引号。

    action='<%= blobstoreService.createUploadUrl("/register") %>'
    

    【讨论】:

      【解决方案2】:

      您的错误消息直接指出了问题所在:您的模板内部和外部都有双引号,这会产生一些解析错误。

      您可以通过简单地在外部使用单引号来修复它,例如:

      <form:form action='<%= blobstoreService.createUploadUrl("/register") %>' class = "form-horizontal" method="post" enctype="multipart/form-data">
      

      编辑:

      也可能与simple error due to use of double quotes in a jsp file重复

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-24
        • 2015-07-10
        • 2022-08-21
        • 2019-04-17
        • 1970-01-01
        相关资源
        最近更新 更多