PAR version of springtravel
@@ -0,0 +1,31 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-SymbolicName: org.springframework.samples.springtravel.webapp
|
||||
Bundle-Name: Spring Travel Web Application Module
|
||||
Import-Bundle:
|
||||
org.springframework.webflow;version="[2.0.3,3.0.0)",
|
||||
org.springframework.js;version="[2.0.3,3.0)",
|
||||
org.springframework.faces;version="[2.0.3,3.0)",
|
||||
com.springsource.org.apache.myfaces;version="[1.2.0,2.0.0)",
|
||||
com.springsource.org.apache.myfaces.javax.faces;version="[1.2.0,2.0.0)",
|
||||
com.springsource.com.sun.facelets;version="[1.1.14,1.2.0)",
|
||||
org.springframework.security;version="[2.0.0,2.1.0)"
|
||||
Import-Library:
|
||||
org.springframework.spring;version="[2.5.4,3.0.0)",
|
||||
org.hibernate.ejb;version="[3.3.1.ga, 3.3.1.ga]"
|
||||
Platform-ModuleType: Web
|
||||
Web-ContextPath: springtravel-faces
|
||||
Web-DispatcherServletUrlPatterns: /spring/*
|
||||
Web-ServletContextListeners:
|
||||
org.apache.myfaces.webapp.StartupServletContextListener
|
||||
Web-Servlets:
|
||||
FacesServlet;servlet-class:="javax.faces.webapp.FacesServlet";load-on-startup:="1";url-patterns:="*.faces",
|
||||
ResourcesServlet;servlet-class:="org.springframework.js.resource.ResourceServlet";load-on-startup:="0";url-patterns:="/resources/*"
|
||||
Web-FilterMappings: springSecurityFilterChain;url-patterns:="/*"
|
||||
Web-ContextParams:
|
||||
javax.faces.DEFAULT_SUFFIX;param-value:=".xhtml",
|
||||
facelets.DEVELOPMENT;param-value:="true",
|
||||
facelets.REFRESH_PERIOD;param-value:="1",
|
||||
facelets.RESOURCE_RESOLVER;param-value:="org.springframework.faces.webflow.FlowResourceResolver"
|
||||
Web-SessionTimeout: 5
|
||||
Web-WelcomeFiles: index.html
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
|
||||
|
||||
<!-- Maps request URIs to controllers -->
|
||||
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
|
||||
<property name="defaultHandler">
|
||||
<!-- Selects view names to render based on the request URI: e.g. /main selects "main" -->
|
||||
<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
|
||||
</property>
|
||||
<property name="order" value="100"/>
|
||||
</bean>
|
||||
|
||||
<!-- Maps logical view names to Facelet templates (e.g. 'search' to '/WEB-INF/search.xhtml') -->
|
||||
<bean id="faceletsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
|
||||
<property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
|
||||
<property name="prefix" value="/WEB-INF/" />
|
||||
<property name="suffix" value=".xhtml" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans
|
||||
xmlns="http://www.springframework.org/schema/osgi"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/osgi
|
||||
http://www.springframework.org/schema/osgi/spring-osgi-1.0.xsd
|
||||
http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
|
||||
|
||||
<reference id="hotelHandlerMappings">
|
||||
<interfaces>
|
||||
<beans:value>org.springframework.web.servlet.HandlerMapping</beans:value>
|
||||
<beans:value>org.springframework.core.Ordered</beans:value>
|
||||
</interfaces>
|
||||
</reference>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:security="http://www.springframework.org/schema/security"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/security
|
||||
http://www.springframework.org/schema/security/spring-security-2.0.xsd">
|
||||
|
||||
<!-- Configure Spring Security -->
|
||||
<security:http auto-config="true">
|
||||
<security:form-login login-page="/spring/login" login-processing-url="/spring/loginProcess" default-target-url="/spring/hotel/search" authentication-failure-url="/spring/login?login_error=1" />
|
||||
<security:logout logout-url="/spring/logout" logout-success-url="/spring/logoutSuccess" />
|
||||
</security:http>
|
||||
|
||||
<!--
|
||||
Define local authentication provider, a real app would use an external provider (JDBC, LDAP, CAS, etc)
|
||||
|
||||
usernames/passwords are:
|
||||
keith/melbourne
|
||||
erwin/leuven
|
||||
jeremy/atlanta
|
||||
scott/rochester
|
||||
-->
|
||||
<security:authentication-provider>
|
||||
<security:password-encoder hash="md5" />
|
||||
<security:user-service>
|
||||
<security:user name="keith" password="417c7382b16c395bc25b5da1398cf076" authorities="ROLE_USER, ROLE_SUPERVISOR" />
|
||||
<security:user name="erwin" password="12430911a8af075c6f41c6976af22b09" authorities="ROLE_USER, ROLE_SUPERVISOR" />
|
||||
<security:user name="jeremy" password="57c6cbff0d421449be820763f03139eb" authorities="ROLE_USER" />
|
||||
<security:user name="scott" password="942f2339bf50796de535a384f0d1af3e" authorities="ROLE_USER" />
|
||||
</security:user-service>
|
||||
</security:authentication-provider>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE faces-config PUBLIC
|
||||
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
|
||||
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
|
||||
|
||||
<faces-config>
|
||||
<application>
|
||||
<!-- Enables Facelets -->
|
||||
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
|
||||
</application>
|
||||
</faces-config>
|
||||
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:sf="http://www.springframework.org/tags/faces"
|
||||
template="layouts/standard.xhtml">
|
||||
|
||||
<ui:define name="content">
|
||||
|
||||
<div class="section">
|
||||
<h1>Welcome to Spring Travel</h1>
|
||||
<p>
|
||||
This reference application illustrates how to use Spring MVC, Spring Web Flow, and Spring Faces
|
||||
together to power rich web applications based on Spring and JavaServerFaces technology.
|
||||
</p>
|
||||
<p>
|
||||
The key features illustrated in this sample include:
|
||||
</p>
|
||||
<ul>
|
||||
<li>A declarative navigation model enabling full browser button support and dynamic navigation rules</li>
|
||||
<li>A fine-grained state management model, including support for ConversationScope and ViewScope</li>
|
||||
<li>Modularization of web application functionality by domain use case, illustrating project structure best-practices</li>
|
||||
<li>Managed persistence contexts with the Java Persistence API (JPA)</li>
|
||||
<li>Unified Expression Language (EL) integration</li>
|
||||
<li>Spring Security integration</li>
|
||||
<li>Declarative page authoring with Facelets, including applying reusable page layouts</li>
|
||||
<li>A lightweight component library for Ajax and client-side validation that employs progressive enhancement techniques</li>
|
||||
<li>Exception handling support across all layers of the application</li>
|
||||
<li>Spring IDE tooling integration, with support for graphical flow modeling and visualization</li>
|
||||
</ul>
|
||||
<p align="right">
|
||||
<a href="hotel/search">Start your Spring Travel experience</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:c="http://java.sun.com/jstl/core"
|
||||
xmlns:sf="http://www.springframework.org/tags/faces">
|
||||
<f:view contentType="text/html">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Spring Faces: Hotel Booking Sample Application</title>
|
||||
<sf:includeStyles/>
|
||||
<sf:resourceGroup>
|
||||
<sf:resource path="/css-framework/css/tools.css"/>
|
||||
<sf:resource path="/css-framework/css/typo.css"/>
|
||||
<sf:resource path="/css-framework/css/forms.css"/>
|
||||
<sf:resource path="/css-framework/css/layout-navtop-localleft.css"/>
|
||||
<sf:resource path="/css-framework/css/layout.css"/>
|
||||
</sf:resourceGroup>
|
||||
<sf:resource path="/styles/booking.css"/>
|
||||
<ui:insert name="headIncludes"/>
|
||||
</head>
|
||||
<body class="tundra spring">
|
||||
<div id="page">
|
||||
<div id="header" class="clearfix spring">
|
||||
<div id="welcome">
|
||||
<div class="left">Spring Travel: A Spring Faces Reference Application</div>
|
||||
<div class="right">
|
||||
<c:if test="${not empty currentUser.name}">
|
||||
Welcome, ${currentUser.name} | <a href="${request.contextPath}/spring/logout">Logout</a>
|
||||
</c:if>
|
||||
<c:if test="${empty currentUser.name}">
|
||||
<a href="${request.contextPath}/spring/login">Login</a>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
<div id="branding" class="spring">
|
||||
<a href="#{request.contextPath}"><img src="${request.contextPath}/resources/images/header.jpg" alt="Spring Travel"/></a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content" class="clearfix spring">
|
||||
<div id="local" class="spring">
|
||||
<a href="http://www.thespringexperience.com">
|
||||
<img src="${request.contextPath}/resources/images/diplomat.jpg" alt="generic hotel" />
|
||||
</a>
|
||||
<a href="http://www.thespringexperience.com">
|
||||
<img src="${request.contextPath}/resources/images/tse.gif" alt="The Spring Experience" />
|
||||
</a>
|
||||
<p>
|
||||
</p>
|
||||
</div>
|
||||
<div id="main">
|
||||
<ui:insert name="content"/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer" class="clearfix spring">
|
||||
<a href="http://www.springframework.org"><img src="${request.contextPath}/resources/images/powered-by-spring.png" alt="Powered by Spring" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</f:view>
|
||||
</html>
|
||||
@@ -0,0 +1,60 @@
|
||||
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:c="http://java.sun.com/jstl/core"
|
||||
template="layouts/standard.xhtml">
|
||||
|
||||
<ui:define name="content">
|
||||
|
||||
<h1>Login Required</h1>
|
||||
|
||||
<div class="section">
|
||||
<c:if test="${not empty param.login_error}">
|
||||
<div class="errors">
|
||||
Your login attempt was not successful, try again.<br />
|
||||
Reason: #{sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message}
|
||||
</div>
|
||||
</c:if>
|
||||
<br/>
|
||||
<p>Valid username/passwords are:</p>
|
||||
<ul>
|
||||
<li>keith/melbourne</li>
|
||||
<li>erwin/leuven</li>
|
||||
<li>jeremy/atlanta</li>
|
||||
<li>scott/rochester</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<form name="f" action="${request.contextPath}/spring/loginProcess" method="post">
|
||||
<fieldset>
|
||||
<div class="field">
|
||||
<div class="label">User:</div>
|
||||
<div class="output">
|
||||
<c:if test="${not empty param.login_error}">
|
||||
<c:set var="username" value="${sessionScope.SPRING_SECURITY_LAST_USERNAME}"/>
|
||||
</c:if>
|
||||
<input type="text" name="j_username" value="#{username}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">Password:</div>
|
||||
<div class="output">
|
||||
<input type="password" name="j_password" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">Don't ask for my password for two weeks:</div>
|
||||
<div class="output">
|
||||
<input type="checkbox" name="_spring_security_remember_me"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="buttonGroup">
|
||||
<input name="submit" type="submit" value="Login" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
template="layouts/standard.xhtml">
|
||||
|
||||
<ui:define name="content">
|
||||
|
||||
<div class="section">
|
||||
<h1>Logout</h1>
|
||||
<p>You have successfully logged out.</p>
|
||||
<p>
|
||||
<a href="#{request.contextPath}/spring/main">Continue</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
After Width: | Height: | Size: 172 B |
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 122 B |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Refresh" content="0; URL=spring/intro">
|
||||
</head>
|
||||
</html>
|
||||
@@ -0,0 +1,154 @@
|
||||
a, a:visited, a:link, a:active {
|
||||
color: #59924B;
|
||||
background-color: transparent;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: white;
|
||||
background-color: #65a242;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
body.spring {
|
||||
background-color: #9cac7c;
|
||||
}
|
||||
|
||||
form div,
|
||||
form p {
|
||||
padding: 0px;
|
||||
margin: 0 0 .5em 0;
|
||||
}
|
||||
|
||||
#header.spring {
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0px 0px;
|
||||
background-color : #414f23;
|
||||
}
|
||||
|
||||
#branding.spring {
|
||||
float: none;
|
||||
width: 100%;
|
||||
margin: 10px 0 0 0;
|
||||
padding: 0 0 0 0;
|
||||
text-align: none;
|
||||
}
|
||||
|
||||
#welcome {
|
||||
padding: 10px 10px;
|
||||
}
|
||||
|
||||
#welcome div.left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#welcome div.right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#content.spring {
|
||||
width: 740px;
|
||||
background: #fff url(../images/bg.gif) 0 0 repeat;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
#content.spring input[type="submit"], input[type="button"], button {
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
background: #fff url(../images/btn.bg.gif) 0 0 repeat-x;
|
||||
border-style: none;
|
||||
padding: 2px 2px 2px 2px;
|
||||
}
|
||||
|
||||
#local.spring{
|
||||
width: 215px;
|
||||
}
|
||||
|
||||
#footer.spring {
|
||||
padding: 25px 0;
|
||||
background-color : white;
|
||||
border-top: 1px solid #C3BBB6;
|
||||
}
|
||||
|
||||
#footer.spring img {
|
||||
float: right;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.errors {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
color: #600;
|
||||
}
|
||||
|
||||
.errors ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.section {
|
||||
text-align: left;
|
||||
width: 505px;
|
||||
float: left;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.field {
|
||||
float:left;
|
||||
}
|
||||
|
||||
.field .label {
|
||||
float: left;
|
||||
padding-top: 5px;
|
||||
padding-right: 5px;
|
||||
font-weight: bold;
|
||||
width: 150px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.field .input {
|
||||
float: left;
|
||||
width: 250px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.field .output {
|
||||
float: left;
|
||||
width: 250px;
|
||||
padding-top: 5px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.buttonGroup {
|
||||
clear: both;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.buttonGroup input[type="submit"], .buttonGroup input[type="button"], .buttonGroup button, .buttonGroup a {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.summary {
|
||||
width: 100%;
|
||||
border: 1px solid #414f23;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.summary thead th {
|
||||
border-left: 1px solid #414f23;
|
||||
background: #fff url(../images/th.bg.gif) 0 100% repeat-x;
|
||||
border-bottom: 1px solid #414f23;
|
||||
padding: 6px;
|
||||
text-align: left;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.summary tbody td {
|
||||
border-left: 1px solid #9cac7c;
|
||||
padding: 4px;
|
||||
border-bottom: 1px solid #9cac7c;
|
||||
font-size: 8pt;
|
||||
}
|
||||