Reputation: 1591
I am looking at the Spring-Petclinic sample code which uses Spring MVC to display and update/create pet owners, etc. I am confused by the following code fragment in a JSP file:
<spring:url value="/owners.html" var="formUrl"/>
<form:form modelAttribute="owner" action="${fn:escapeXml(formUrl)}" method="get" class="form-horizontal"
id="search-owner-form">
<fieldset>
<div class="control-group" id="lastName">
<label class="control-label">Last name </label>
<form:input path="lastName" size="30" maxlength="80"/>
<span class="help-inline"><form:errors path="*"/></span>
</div>
<div class="form-actions">
<button type="submit">Find owner</button>
</div>
</fieldset>
</form:form>
I am wondering if this is trying to create a new file called owners.html because I can't find such a file anywhere in the existing files.
Upvotes: 0
Views: 149
Reputation: 308733
JSPs are an HTML templating solution. Here is how it works:
So you may find a generated .java or .class file if you know where to look and have asked that it be saved appropriately, but the HTML only exists on the wire from the server to the client.
Upvotes: 0
Reputation: 691635
No, it doesn't. The JSP tag <spring:url>
is used to define an attribute (named formUrl
here) referencing an url (which is /<context-path>/owners.html
here).
Upvotes: 1
Reputation: 10562
No, it just generates the url poining to that action. In this case the action name is owners.html, look inside controller and you will find it.
Upvotes: 0