Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
broken-petclinic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
s61200
broken-petclinic
Commits
07e535a7
Commit
07e535a7
authored
12 years ago
by
Mic
Browse files
Options
Downloads
Patches
Plain Diff
fixed issue in the 'createVisit' form
parent
57c90431
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/springframework/samples/petclinic/Visit.java
+2
-0
2 additions, 0 deletions
...ain/java/org/springframework/samples/petclinic/Visit.java
src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp
+10
-4
10 additions, 4 deletions
src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp
with
12 additions
and
4 deletions
src/main/java/org/springframework/samples/petclinic/Visit.java
+
2
−
0
View file @
07e535a7
...
@@ -10,6 +10,7 @@ import javax.validation.constraints.Size;
...
@@ -10,6 +10,7 @@ import javax.validation.constraints.Size;
import
org.hibernate.annotations.Type
;
import
org.hibernate.annotations.Type
;
import
org.joda.time.DateTime
;
import
org.joda.time.DateTime
;
import
org.springframework.format.annotation.DateTimeFormat
;
/**
/**
* Simple JavaBean domain object representing a visit.
* Simple JavaBean domain object representing a visit.
...
@@ -22,6 +23,7 @@ public class Visit extends BaseEntity {
...
@@ -22,6 +23,7 @@ public class Visit extends BaseEntity {
/** Holds value of property date. */
/** Holds value of property date. */
@Column
(
name
=
"visit_date"
)
@Column
(
name
=
"visit_date"
)
@Type
(
type
=
"org.jadira.usertype.dateandtime.joda.PersistentDateTime"
)
@Type
(
type
=
"org.jadira.usertype.dateandtime.joda.PersistentDateTime"
)
@DateTimeFormat
(
pattern
=
"yyyy/MM/dd"
)
private
DateTime
date
;
private
DateTime
date
;
/** Holds value of property description. */
/** Holds value of property description. */
...
...
This diff is collapsed.
Click to expand it.
src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp
+
10
−
4
View file @
07e535a7
...
@@ -8,13 +8,19 @@
...
@@ -8,13 +8,19 @@
<jsp:include
page=
"../fragments/headTag.jsp"
/>
<jsp:include
page=
"../fragments/headTag.jsp"
/>
<body>
<body>
<script>
$
(
function
()
{
$
(
"
#date
"
).
datepicker
({
dateFormat
:
'
yy/mm/dd
'
});
});
</script>
<div
class=
"container"
>
<div
class=
"container"
>
<jsp:include
page=
"../fragments/bodyHeader.jsp"
/>
<jsp:include
page=
"../fragments/bodyHeader.jsp"
/>
<h2><c:if
test=
"
${
visit
[
'new'
]
}
"
>
New
</c:if>
Visit:
</h2>
<h2><c:if
test=
"
${
visit
[
'new'
]
}
"
>
New
</c:if>
Visit:
</h2>
<form:form
modelAttribute=
"visit"
>
<form:form
modelAttribute=
"visit"
>
<b>
Pet
:
</b>
<b>
Pet
</b>
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
>
<thead>
<thead>
<tr>
<tr>
...
@@ -26,7 +32,7 @@
...
@@ -26,7 +32,7 @@
</thead>
</thead>
<tr>
<tr>
<td><c:out
value=
"
${
visit
.
pet
.
name
}
"
/></td>
<td><c:out
value=
"
${
visit
.
pet
.
name
}
"
/></td>
<td><joda:format
value=
"
${
visit
.
pet
.
birthDate
}
"
pattern=
"yyyy
-
MM
-
dd"
/></td>
<td><joda:format
value=
"
${
visit
.
pet
.
birthDate
}
"
pattern=
"yyyy
/
MM
/
dd"
/></td>
<td><c:out
value=
"
${
visit
.
pet
.
type
.
name
}
"
/></td>
<td><c:out
value=
"
${
visit
.
pet
.
type
.
name
}
"
/></td>
<td><c:out
value=
"
${
visit
.
pet
.
owner
.
firstName
}
${visit.pet.owner.lastName}"
/></td>
<td><c:out
value=
"
${
visit
.
pet
.
owner
.
firstName
}
${visit.pet.owner.lastName}"
/></td>
</tr>
</tr>
...
@@ -39,7 +45,7 @@
...
@@ -39,7 +45,7 @@
<br/><form:errors
path=
"date"
cssClass=
"errors"
/>
<br/><form:errors
path=
"date"
cssClass=
"errors"
/>
</th>
</th>
<td>
<td>
<form:input
path=
"date"
size=
"10"
maxlength=
"10"
/>
(yyyy-mm-dd)
<form:input
path=
"date"
size=
"10"
maxlength=
"10"
/>
</td>
</td>
<tr/>
<tr/>
<tr>
<tr>
...
@@ -70,7 +76,7 @@
...
@@ -70,7 +76,7 @@
<c:forEach
var=
"visit"
items=
"
${
visit
.
pet
.
visits
}
"
>
<c:forEach
var=
"visit"
items=
"
${
visit
.
pet
.
visits
}
"
>
<c:if
test=
"
${
!
visit
[
'new'
]
}
"
>
<c:if
test=
"
${
!
visit
[
'new'
]
}
"
>
<tr>
<tr>
<td><joda:format
value=
"
${
visit
.
date
}
"
pattern=
"yyyy
-
MM
-
dd"
/></td>
<td><joda:format
value=
"
${
visit
.
date
}
"
pattern=
"yyyy
/
MM
/
dd"
/></td>
<td><c:out
value=
"
${
visit
.
description
}
"
/></td>
<td><c:out
value=
"
${
visit
.
description
}
"
/></td>
</tr>
</tr>
</c:if>
</c:if>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment