Skip to content

Prepend contextPath in form tag [SPR-6944] #11609

Closed
@spring-projects-issues

Description

@spring-projects-issues

Michael Isvy opened SPR-6944 and commented

Currently, if I need to write a form that links to my web application, I usually write it that way:

<c:url value="/client" var="form_url"/>
<form:form action="${form_url}">
...
</form:form>

Generated HTML is as follows:

<form id="command" action="/myWebApp/client" method="post">
	Inside form
</form>

It would be easier if the form tag could include the context path out of the box (for any path starting with "/" for instance). In that way, I would not need to use the <c:url /> tag anymore.


Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions