query-string
  • thymeleaf
  • 2017-05-10 21 views 0 likes 
    0
    ThymeleafにURLを作成する方法

    :thymeleafモデルでThymeleaf:クエリ文字列は

    /user/map?userId=1&mapId=2 
    

    を私は$ {user.id}と$ {} map.idへのアクセス権を持っています。

    私が試してみました:

    th:href="@{'/user/map/update/?userId=' + ${user.id} + '&mapId=' + ${map.id}}" 
    

    をそれは与える:

    The reference to entity "mapId" must end with the ';' delimiter. 
    
    +1

    あなたは常にHTML/XMLに '' &にエンコード&べきです。 – holmis83

    答えて

    3

    Thymeleaf url expressions can do this for you.

    <a th:href="@{/user/map(userId=${user.id},mapId=${map.id})}"> 
    
    +0

    魅力的な作品! – Dachstein

    関連する問題