initial mvc message display

This commit is contained in:
Keith Donald
2008-04-01 18:50:56 +00:00
parent bc35b3d8a6
commit e9f070b3e3
10 changed files with 169 additions and 66 deletions

View File

@@ -4,7 +4,6 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/WEB-INF/lib" source-path="/target/war-expanded/WEB-INF/lib"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/>
<property name="java-output-path" value="target/classes"/>
<property name="context-root" value="/swf-booking-faces"/>
</wb-module>

View File

@@ -2,11 +2,8 @@
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="swf-booking-mvc">
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/WEB-INF/lib" source-path="/lib/global"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/lib" source-path="/target/war-expanded/WEB-INF/lib"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/>
<property name="java-output-path" value="target/classes"/>
<property name="context-root" value="/swf-booking-mvc"/>
</wb-module>

View File

@@ -63,7 +63,11 @@ public class Booking implements Serializable {
@Transient
public int getNights() {
return (int) (checkoutDate.getTime() - checkinDate.getTime()) / 1000 / 60 / 60 / 24;
if (checkinDate == null || checkoutDate == null) {
return 0;
} else {
return (int) (checkoutDate.getTime() - checkinDate.getTime()) / 1000 / 60 / 60 / 24;
}
}
@Id