mvc support - wip preparing for release

This commit is contained in:
Keith Donald
2007-10-28 18:24:50 +00:00
parent e59408ffb3
commit cc0f5dedd0
66 changed files with 2410 additions and 85 deletions

View File

@@ -13,9 +13,9 @@
<!-- global dependencies -->
<dependency org="commons-logging" name="commons-logging" rev="1.0.4"/>
<dependency org="ognl" name="ognl" rev="2.6.9" />
<dependency org="org.springframework" name="spring-beans" rev="2.1-m4" />
<dependency org="org.springframework" name="spring-context" rev="2.1-m4" />
<dependency org="org.springframework" name="spring-core" rev="2.1-m4" />
<dependency org="org.springframework" name="spring-beans" rev="2.5-rc1" />
<dependency org="org.springframework" name="spring-context" rev="2.5-rc1" />
<dependency org="org.springframework" name="spring-core" rev="2.5-rc1" />
<!-- build time only dependencies -->
<dependency org="javax.el" name="el-api" rev="1.0" conf="buildtime->default"/>

View File

@@ -51,8 +51,11 @@ public interface ExpressionParser {
* @param expressionTargetType the class of target object this expression can successfully evaluate; for example,
* <code>Map.class</code> for an expression that is expected to evaluate against Maps.
* @param expectedEvaluationResultType the class of object this expression is expected to return or set: for
* example, <code>Boolean.class</code> for an expression that is expected to get or set a boolean value.
* @param expressionVariables variables providing aliases for this expression during evaluation parsing. Optional.
* example, <code>Boolean.class</code> for an expression that is expected to get or set a boolean value. Typically
* used to facilitate type conversion by the expression evaluator; for example, if a evaluated expression equates to
* a String value 'true', with an expected Boolean result the string value could be converted to a typed Boolean
* value.
* @param expressionVariables variables providing aliases for this expression during evaluation. Optional.
* @return the evaluator for the parsed expression
* @throws ParserException an exception occurred during parsing
*/

View File

@@ -35,7 +35,7 @@ public abstract class AbstractExpressionParser implements ExpressionParser {
/**
* The expression prefix.
*/
private static final String DEFAULT_EXPRESSION_PREFIX = "${";
private static final String DEFAULT_EXPRESSION_PREFIX = "#{";
/**
* The expression suffix.

View File

@@ -10,7 +10,6 @@
<!-- public JSF configurations other projects may use -->
<conf name="default" extends="jsf12" />
<conf name="jsf11" visibility="public" extends="global" />
<conf name="jsf12" visibility="public" extends="global" />
</configurations>
@@ -40,7 +39,7 @@
<dependency org="org.easymock" name="easymock" rev="2.2" conf="test->default" />
<dependency org="jboss" name="jboss-el" rev="1.0" conf="test->default"/>
<dependency org="org.apache.shale" name="shale-test" rev="1.0.4" conf="test->default" />
<dependency org="org.springframework" name="spring-test" rev="2.1-m4" conf="test->default" />
<dependency org="org.springframework" name="spring-test" rev="2.5-rc1" conf="test->default" />
</dependencies>

View File

@@ -5,6 +5,5 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="lib" path="lib/test/junit.jar"/>
<classpathentry kind="lib" path="lib/test/spring-mock.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -14,30 +14,28 @@
<dependency org="log4j" name="log4j" rev="1.2.14"/>
<dependency org="taglibs" name="standard" rev="1.1.2"/>
<dependency org="jstl" name="jstl" rev="1.1.2"/>
<dependency org="com.sun.facelets" name="jsf-facelets" rev="1.1.13"/>
<dependency org="aopalliance" name="aopalliance" rev="1.0" />
<dependency org="org.springframework" name="spring-faces" rev="latest.integration" conf="global->default,jsf12"/>
<dependency org="org.springframework" name="spring-faces" rev="latest.integration" conf="global->default"/>
<dependency org="org.springframework" name="spring-webflow" rev="latest.integration" conf="global->default"/>
<dependency org="org.springframework" name="spring-aop" rev="2.1-m4"/>
<dependency org="org.springframework" name="spring-orm" rev="2.1-m4"/>
<dependency org="org.springframework" name="spring-jdbc" rev="2.1-m4"/>
<dependency org="org.springframework" name="spring-tx" rev="2.1-m4"/>
<dependency org="org.springframework" name="spring-aop" rev="2.5-rc1"/>
<dependency org="org.springframework" name="spring-orm" rev="2.5-rc1"/>
<dependency org="org.springframework" name="spring-jdbc" rev="2.5-rc1"/>
<dependency org="org.springframework" name="spring-tx" rev="2.5-rc1"/>
<dependency org="jboss" name="jboss-el" rev="1.0"/>
<dependency org="org.hibernate" name="hibernate" rev="3.2.4.ga" />
<dependency org="org.hibernate" name="hibernate-entitymanager" rev="3.3.1.ga"/>
<dependency org="org.hibernate" name="hibernate-commons-annotations" rev="3.3.0.ga"/>
<dependency org="javax.persistence" name="persistence-api" rev="1.0b"/>
<dependency org="com.sun.facelets" name="jsf-facelets" rev="1.1.13"/>
<dependency org="javax.persistence" name="persistence-api" rev="1.0b"/>
<dependency org="hsqldb" name="hsqldb" rev="1.8.0.7"/>
<!-- build-time only dependencies -->
<dependency org="javax.servlet" name="servlet-api" rev="2.4" conf="buildtime->default"/>
<dependency org="javax.el" name="el-api" rev="1.0" conf="buildtime->default"/>
<!-- test-time only dependencies -->
<dependency org="junit" name="junit" rev="3.8.2" conf="test->default" />
<dependency org="org.springframework" name="spring-mock" rev="2.0.6" conf="test->default"/>
<dependency org="org.springframework" name="spring-test" rev="2.5-rc1" conf="test->default"/>
</dependencies>
</ivy-module>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="lib" path="lib/test/junit.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-project guid="swf-sellitem-jsf_107f67bf14a_bdd5802912dd9f2" version="5">
<web-app guid="webapp_107f67bf14a_eee4f0d2979070f0">
<root-path-uri>src/webapp</root-path-uri>
<web-app-type>com.m7.webapp.java</web-app-type>
</web-app>
<properties>
<property name="validation.compile" value="true"/>
<property name="validation.missingFile" value="true"/>
<property name="validation.unresolvedVar" value="false"/>
<property name="validation" value="true"/>
<property name="taglib.downloadRemote" value="true"/>
<property name="validation.unresolvedType" value="false"/>
<property name="validation.compile.jspQuotation" value="false"/>
</properties>
</web-project>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>swf-booking-mvc</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.hibernate.eclipse.console.hibernateBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.hibernate.eclipse.console.hibernateNature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,263 @@
#Thu Aug 09 13:12:30 EDT 2007
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
org.eclipse.jdt.core.formatter.comment.line_length=120
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=120
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=mixed
org.eclipse.jdt.core.formatter.tabulation.size=8
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true

View File

@@ -0,0 +1,53 @@
#Thu Aug 09 13:12:30 EDT 2007
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_Spring Java Conventions
formatter_settings_version=11
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
sp_cleanup.add_missing_deprecated_annotations=true
sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.format_source_code=true
sp_cleanup.make_local_variable_final=false
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_variable_declarations_final=true
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.on_save_use_additional_actions=false
sp_cleanup.organize_imports=true
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_trailing_whitespaces=false
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
sp_cleanup.remove_unnecessary_casts=true
sp_cleanup.remove_unnecessary_nls_tags=false
sp_cleanup.remove_unused_imports=false
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.use_blocks=false
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true

View File

@@ -0,0 +1,5 @@
#Thu Aug 09 13:12:30 EDT 2007
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.eclipse.jpt.core.discoverAnnotatedClasses=true
org.eclipse.jpt.core.platform=generic

View File

@@ -0,0 +1,5 @@
#Thu Aug 09 13:12:30 EDT 2007
classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER/owners=jst.java\:5.0
classpath.helper/org.eclipse.jst.server.core.container\:\:org.eclipse.jst.server.tomcat.runtimeTarget\:\:Apache\ Tomcat\ v5.5/owners=jst.web\:2.4
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-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/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/lib" source-path="/lib/global"/>
<property name="java-output-path" value="target/classes"/>
<property name="context-root" value="/swf-booking-mvc"/>
</wb-module>
</project-modules>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="jst.web"/>
<fixed facet="jst.java"/>
<installed facet="jst.web" version="2.4"/>
<installed facet="jst.java" version="5.0"/>
<installed facet="jst.jsf" version="1.1"/>
</faceted-project>

View File

@@ -0,0 +1,7 @@
#Thu Aug 09 13:12:30 EDT 2007
DELEGATES_PREFERENCE=delegateValidatorListorg.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator\=org.eclipse.wst.wsdl.validation.internal.eclipse.Validator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator\=org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator;
USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator;org.eclipse.jst.jsp.core.internal.validation.JSPELValidator;org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator;org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;
USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator;org.eclipse.jst.jsp.core.internal.validation.JSPELValidator;org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator;org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;
USER_PREFERENCE=overrideGlobalPreferencesfalse
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true

View File

@@ -0,0 +1,5 @@
#Thu Aug 09 13:12:30 EDT 2007
default.configuration=swf-booking-jsf
eclipse.preferences.version=1
hibernate3.enabled=true
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true

View File

@@ -0,0 +1,34 @@
#Thu Aug 09 13:12:30 EDT 2007
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.springframework.ide.eclipse.core.builders.enable.aopreferencemodelbuilder=true
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanAlias-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanClass-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanConstructorArgument-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinition-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinitionHolder-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanFactory-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanInitDestroyMethod-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanReference-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.requiredProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.action-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.actionstate-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.attribute-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.attributemapper-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.beanaction-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.evaluationaction-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.evaluationresult-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.exceptionhandler-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.import-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.inputattribute-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.mapping-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.outputattribute-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.set-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.state-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.subflowstate-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.transition-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.variable-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.webflowstate-org.springframework.ide.eclipse.webflow.core.validator=true

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<beansProjectDescription>
<configExtensions>
<configExtension>xml</configExtension>
</configExtensions>
<configs>
<config>src/main/webapp/WEB-INF/config/application-layer-config.xml</config>
<config>src/main/webapp/WEB-INF/config/web-application-config.xml</config>
<config>src/main/webapp/flow/main/main-beans.xml</config>
<config>src/main/webapp/flow/booking/booking-beans.xml</config>
</configs>
<configSets>
<configSet>
<name><![CDATA[webapp-config]]></name>
<allowBeanDefinitionOverriding>true</allowBeanDefinitionOverriding>
<incomplete>false</incomplete>
<configs>
<config>src/main/webapp/WEB-INF/config/application-layer-config.xml</config>
<config>src/main/webapp/WEB-INF/config/web-application-config.xml</config>
</configs>
</configSet>
<configSet>
<name><![CDATA[booking]]></name>
<allowBeanDefinitionOverriding>true</allowBeanDefinitionOverriding>
<incomplete>false</incomplete>
<configs>
<config>src/main/webapp/flow/booking/booking-beans.xml</config>
<config>src/main/webapp/WEB-INF/config/application-layer-config.xml</config>
</configs>
</configSet>
<configSet>
<name><![CDATA[main]]></name>
<allowBeanDefinitionOverriding>true</allowBeanDefinitionOverriding>
<incomplete>false</incomplete>
<configs>
<config>src/main/webapp/flow/main/main-beans.xml</config>
<config>src/main/webapp/WEB-INF/config/application-layer-config.xml</config>
</configs>
</configSet>
</configSets>
</beansProjectDescription>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<webflow-project-description>
<configs>
<config>
<file>src/main/webapp/flow/booking/booking.xml</file>
<name><![CDATA[booking]]></name>
<beans-config><![CDATA[1:BeansModel|2:swf-booking-jsf|4:booking]]></beans-config>
</config>
<config>
<file>src/main/webapp/flow/main/main.xml</file>
<name><![CDATA[main]]></name>
<beans-config><![CDATA[1:BeansModel|2:swf-booking-jsf|4:main]]></beans-config>
</config>
</configs>
</webflow-project-description>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<project name="swf-booking-jsf" default="dist">
<property file="build.properties" />
<property file="project.properties" />
<property file="${common.build.dir}/build.properties" />
<property file="${common.build.dir}/project.properties" />
<property file="${user.home}/build.properties" />
<property name="build.web" value="true" />
<import file="${common.build.dir}/common-targets.xml" />
<import file="${common.build.dir}/tomcat-targets.xml" />
</project>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="bookingDatabase">
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
</session-factory>
</hibernate-configuration>

View File

@@ -0,0 +1,43 @@
<ivy-module version="1.1">
<info organisation="org.springframework" module="swf-booking-mvc"/>
<configurations>
<conf name="default" extends="global"/>
<conf name="global" visibility="private"/>
<conf name="buildtime" visibility="private"/>
<conf name="test" visibility="private"/>
</configurations>
<dependencies defaultconf="global->default">
<!-- global dependencies -->
<dependency org="log4j" name="log4j" rev="1.2.14"/>
<dependency org="taglibs" name="standard" rev="1.1.2"/>
<dependency org="jstl" name="jstl" rev="1.1.2"/>
<dependency org="aopalliance" name="aopalliance" rev="1.0" />
<dependency org="org.apache.tiles" name="tiles-api" rev="2.0.4" />
<dependency org="org.apache.tiles" name="tiles-core" rev="2.0.4" />
<dependency org="org.apache.tiles" name="tiles-jsp" rev="2.0.4" />
<dependency org="org.springframework" name="spring-faces" rev="latest.integration" />
<dependency org="org.springframework" name="spring-webflow" rev="latest.integration" conf="global->mvc"/>
<dependency org="org.springframework" name="spring-aop" rev="2.5-rc1"/>
<dependency org="org.springframework" name="spring-orm" rev="2.5-rc1"/>
<dependency org="org.springframework" name="spring-jdbc" rev="2.5-rc1"/>
<dependency org="org.springframework" name="spring-tx" rev="2.5-rc1"/>
<dependency org="jboss" name="jboss-el" rev="1.0"/>
<dependency org="org.hibernate" name="hibernate" rev="3.2.4.ga" />
<dependency org="org.hibernate" name="hibernate-entitymanager" rev="3.3.1.ga"/>
<dependency org="org.hibernate" name="hibernate-commons-annotations" rev="3.3.0.ga"/>
<dependency org="javax.persistence" name="persistence-api" rev="1.0b"/>
<dependency org="hsqldb" name="hsqldb" rev="1.8.0.7"/>
<!-- build-time only dependencies -->
<dependency org="javax.servlet" name="servlet-api" rev="2.4" conf="buildtime->default"/>
<dependency org="javax.el" name="el-api" rev="1.0" conf="buildtime->default"/>
<!-- test-time only dependencies -->
<dependency org="junit" name="junit" rev="3.8.2" conf="test->default" />
<dependency org="org.springframework" name="spring-test" rev="2.5-rc1" conf="test->default"/>
</dependencies>
</ivy-module>

View File

@@ -0,0 +1,10 @@
# properties defined in this file are overridable by a local build.properties in this project dir
# The location of the common build system
common.build.dir=${basedir}/../../common-build
javac.source=1.5
javac.target=1.5
# Do not publish built artifacts to the integration repository
do.publish=false

View File

@@ -0,0 +1,33 @@
# $Header$
# Contains filterable project settings. Setting placeholders in filterable project text
# files will be replaced with these values when the 'statics' build target is run.
#
# You may add static settings directly to this source file in the format:
# setting=value e.g MY_SETTING=myvalue
# This is appropriate usage if you know the setting value will never change.
#
# At build time this source file is copied to the ${target.dir} where additional
# dynamic settings may be appended using the <propertyfile> task. Use this approach
# when a setting value depends on the build or the local user's environment.
#
# An example of this approach is shown below:
#
# build.xml
# <target name="build.prepare" depends="common-targets.build.prepare">
# <!-- Append additional local settings that are applicable to this project -->
# <propertyfile file="${target.filter.file}">
# <!-- key=the name of the setting
# value=the property in your build.properties file that has the local setting value -->
# <entry key="MY_LOCAL_SETTING" value="${my.local.setting}" />
# </propertyfile>
# </target>
#
# This allows for dynamic replacement values that are sourced from local properties files to facilitate
# local user settings.
#
# To refer to filterable settings within project source files like config files, JSPs, or
# other text files use the standard ant placeholder format:
# @SETTING_NAME@ e.g, @MY_SETTING@ and @MY_LOCAL_SETTING@
#
# Your settings:

View File

@@ -0,0 +1,20 @@
log4j.rootCategory=WARN, stdout, logfile
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.File=${@PROJECT_WEBAPP_NAME@.root}/@PROJECT_WEBAPP_NAME@.log
log4j.appender.logfile.MaxFileSize=512KB
# Keep three backup files
log4j.appender.logfile.MaxBackupIndex=3
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
#Pattern to output : date priority [category] - <message>line_separator
log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - <%m>%n
#Enable webflow debug logging
log4j.category.org.springframework.webflow=DEBUG
log4j.category.org.springframework.binding=DEBUG

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="bookingDatabase">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>org.springframework.webflow.samples.booking.app.User</class>
<class>org.springframework.webflow.samples.booking.app.Booking</class>
<class>org.springframework.webflow.samples.booking.app.Hotel</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
</properties>
</persistence-unit>
</persistence>

View File

@@ -0,0 +1,22 @@
insert into Customer (username, password, name) values ('springer', 'springrocks', 'Springer')
insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 199, 'Westin Diplomat', '3555 S. Ocean Drive', 'Hollywood', 'FL', '33019', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (7, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 160, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain')
insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel')
insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan')
insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 130, 'Hotel Beaulac', ' Esplanade L<>opold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland')
insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia')
insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada')
insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA')
insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia')
insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 250, 'Meli<EFBFBD> White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain')
insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA')

View File

@@ -0,0 +1,176 @@
package org.springframework.webflow.samples.booking.app;
import java.io.Serializable;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
/**
* A Hotel Booking made by a User.
*/
@Entity
public class Booking implements Serializable {
private Long id;
private User user;
private Hotel hotel;
private Date checkinDate;
private Date checkoutDate;
private String creditCard;
private String creditCardName;
private int creditCardExpiryMonth;
private int creditCardExpiryYear;
private boolean smoking;
private int beds;
public Booking() {
}
public Booking(Hotel hotel, User user) {
this.hotel = hotel;
this.user = user;
Calendar calendar = Calendar.getInstance();
setCheckinDate(calendar.getTime());
calendar.add(Calendar.DAY_OF_MONTH, 1);
setCheckoutDate(calendar.getTime());
}
@Transient
public BigDecimal getTotal() {
return hotel.getPrice().multiply(new BigDecimal(getNights()));
}
@Transient
public int getNights() {
return (int) (checkoutDate.getTime() - checkinDate.getTime()) / 1000 / 60 / 60 / 24;
}
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Basic
@Temporal(TemporalType.DATE)
public Date getCheckinDate() {
return checkinDate;
}
public void setCheckinDate(Date datetime) {
this.checkinDate = datetime;
}
@ManyToOne
public Hotel getHotel() {
return hotel;
}
public void setHotel(Hotel hotel) {
this.hotel = hotel;
}
@ManyToOne
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
@Basic
@Temporal(TemporalType.DATE)
public Date getCheckoutDate() {
return checkoutDate;
}
public void setCheckoutDate(Date checkoutDate) {
this.checkoutDate = checkoutDate;
}
public String getCreditCard() {
return creditCard;
}
public void setCreditCard(String creditCard) {
this.creditCard = creditCard;
}
@Transient
public String getDescription() {
DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
return hotel == null ? null : hotel.getName() + ", " + df.format(getCheckinDate()) + " to "
+ df.format(getCheckoutDate());
}
public boolean isSmoking() {
return smoking;
}
public void setSmoking(boolean smoking) {
this.smoking = smoking;
}
public int getBeds() {
return beds;
}
public void setBeds(int beds) {
this.beds = beds;
}
public String getCreditCardName() {
return creditCardName;
}
public void setCreditCardName(String creditCardName) {
this.creditCardName = creditCardName;
}
public int getCreditCardExpiryMonth() {
return creditCardExpiryMonth;
}
public void setCreditCardExpiryMonth(int creditCardExpiryMonth) {
this.creditCardExpiryMonth = creditCardExpiryMonth;
}
public int getCreditCardExpiryYear() {
return creditCardExpiryYear;
}
public void setCreditCardExpiryYear(int creditCardExpiryYear) {
this.creditCardExpiryYear = creditCardExpiryYear;
}
@Override
public String toString() {
return "Booking(" + user + "," + hotel + ")";
}
}

View File

@@ -0,0 +1,39 @@
package org.springframework.webflow.samples.booking.app;
import java.util.List;
/**
* A service interface for retrieving hotels and bookings from a backing repository. Also supports the ability to cancel
* a booking.
*/
public interface BookingService {
/**
* Find bookings made by the given user
* @param username the user's name
* @return their bookings
*/
public List<Booking> findBookings(String username);
/**
* Find hotels available for booking by some criteria.
* @param searchString the search query string to filter hotels by name
* @param pageSize the page size
* @param page the current page
* @return a list of hotels not exceeding the page size
*/
public List<Hotel> findHotels(String searchString, int pageSize, int page);
/**
* Find hotels by their identifier.
* @param id the hotel id
* @return the hotel
*/
public Hotel findHotelById(Long id);
/**
* Cancel an existing booking.
* @param id the booking id
*/
public void cancelBooking(Long id);
}

View File

@@ -0,0 +1,103 @@
package org.springframework.webflow.samples.booking.app;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* A hotel where users may book stays.
*/
@Entity
public class Hotel implements Serializable {
private Long id;
private String name;
private String address;
private String city;
private String state;
private String zip;
private String country;
private BigDecimal price;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
@Column(precision = 6, scale = 2)
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
@Override
public String toString() {
return "Hotel(" + name + "," + address + "," + city + "," + zip + ")";
}
}

View File

@@ -0,0 +1,58 @@
package org.springframework.webflow.samples.booking.app;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
/**
* A JPA-based implementation of the Booking Service. Delegates to a JPA entity manager to issue data access calls
* against the backing repository. The EntityManager reference is provided by the managing container (Spring)
* automatically.
*/
@Repository
public class JpaBookingService implements BookingService {
private EntityManager em;
@PersistenceContext
public void setEntityManager(EntityManager em) {
this.em = em;
}
@Transactional(readOnly = true)
@SuppressWarnings("unchecked")
public List<Booking> findBookings(String username) {
return em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate")
.setParameter("username", username).getResultList();
}
@Transactional(readOnly = true)
@SuppressWarnings("unchecked")
public List<Hotel> findHotels(String searchString, int pageSize, int page) {
String pattern = !StringUtils.hasText(searchString) ? "'%'" : "'%"
+ searchString.toLowerCase().replace('*', '%') + "%'";
return em.createQuery(
"select h from Hotel h where lower(h.name) like " + pattern + " or lower(h.city) like " + pattern
+ " or lower(h.zip) like " + pattern + " or lower(h.address) like " + pattern).setMaxResults(
pageSize).setFirstResult(page * pageSize).getResultList();
}
@Transactional(readOnly = true)
public Hotel findHotelById(Long id) {
return em.find(Hotel.class, id);
}
// this one is a read/write transaction
@Transactional
public void cancelBooking(Long id) {
Booking booking = em.find(Booking.class, id);
if (booking != null) {
em.remove(booking);
}
}
}

View File

@@ -0,0 +1,59 @@
package org.springframework.webflow.samples.booking.app;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* A user who can book hotels.
*/
@Entity
@Table(name = "Customer")
public class User implements Serializable {
private String username;
private String password;
private String name;
public User() {
}
public User(String username, String password, String name) {
this.username = username;
this.password = password;
this.name = name;
}
@Id
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "User(" + username + ")";
}
}

View File

@@ -0,0 +1,67 @@
package org.springframework.webflow.samples.booking.flow.booking;
import java.util.Calendar;
import javax.persistence.EntityManager;
import org.springframework.binding.message.Messages;
import org.springframework.binding.message.Severity;
import org.springframework.webflow.action.MultiAction;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
import org.springframework.webflow.samples.booking.app.Booking;
import org.springframework.webflow.samples.booking.app.Hotel;
import org.springframework.webflow.samples.booking.app.User;
/**
* Actions invoked by the booking flow. These actions are extensions of the flow definition, called by the flow
* definition at the appropriate points. Actions allow an externalized flow definition to delegate out to Java code to
* perform processing.
*/
public class BookingActions extends MultiAction {
/**
* Create a new booking object and register it with the flow-managed entity manager. The booking is not actually
* flushed to the database at this time; that only occurs when the booking flow reaches its "bookingAuthorized"
* end-state, which is a "commit" state.
*
* It is expected a future milestone of Spring Web Flow 2.0 will support Flows being defined fully in Java and
* Groovy, allowing logic like this to be defined with the flow definition and without the attribute lookup code you
* see here.
* @param context the current flow execution request context
* @return success if the booking was created successfully.
*/
public Event createBooking(RequestContext context) {
Hotel hotel = (Hotel) context.getFlowScope().get("hotel");
User user = (User) context.getConversationScope().get("user");
Booking booking = new Booking(hotel, user);
EntityManager em = (EntityManager) context.getFlowScope().get("entityManager");
em.persist(booking);
context.getFlowScope().put("booking", booking);
return success();
}
/**
* Perform some custom server-side validation on the flow-scoped Booking object updated by the booking form.
*
* It is expected a future milestone of Spring Web Flow 2.0 will add a Messages abstraction that decouples SWF
* artifacts from environment-specific constructs like the FacesContext.
* @param context the current flow execution request context
* @return success if validation was successful, error if not
*/
public Event validateBooking(RequestContext context) {
Booking booking = (Booking) context.getFlowScope().get("booking");
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -1);
if (booking.getCheckinDate().before(calendar.getTime())) {
context.getMessageContext().addMessage(
Messages.text("checkinDate", "Check in date must be a future date", Severity.ERROR));
return error();
} else if (!booking.getCheckinDate().before(booking.getCheckoutDate())) {
context.getMessageContext().addMessage(
Messages.text("checkoutDate", "Check out date must be later than check in date", Severity.ERROR));
return error();
}
return success();
}
}

View File

@@ -0,0 +1,66 @@
package org.springframework.webflow.samples.booking.flow.main;
import java.util.List;
import org.springframework.webflow.action.MultiAction;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
import org.springframework.webflow.samples.booking.app.Booking;
import org.springframework.webflow.samples.booking.app.BookingService;
import org.springframework.webflow.samples.booking.app.Hotel;
import org.springframework.webflow.samples.booking.app.User;
/**
* Actions invoked by the main flow. These actions are extensions of the flow definition, called by the flow definition
* at the appropriate points. Actions allow an externalized flow definition to delegate out to Java code to perform
* processing.
*/
public class MainActions extends MultiAction {
private BookingService bookingService;
/**
* Constructs a new multi-action for the main flow that will delegate to the provided booking service
* @param bookingService the booking service
*/
public MainActions(BookingService bookingService) {
this.bookingService = bookingService;
}
/**
* Simply put a dummy user in conversation scope to simulate a user login. In the future this sample may add user
* authentication support.
* @param context the current flow execution request context
* @return success
*/
public Event initCurrentUser(RequestContext context) {
User user = new User("springer", "springrocks", "Springer");
context.getConversationScope().put("user", user);
return success();
}
/**
* Find all active bookings made by the current user.
* @param context the current flow execution request context
* @return success
*/
public Event findCurrentUserBookings(RequestContext context) {
User user = (User) context.getConversationScope().get("user");
List<Booking> bookings = bookingService.findBookings(user.getUsername());
context.getFlowScope().put("bookings", bookings);
return success();
}
/**
* Find all hotels that meet the current search criteria in flow scope.
* @param context the current flow execution request context
* @return success
*/
public Event findHotels(RequestContext context) {
SearchCriteria search = (SearchCriteria) context.getFlowScope().get("searchCriteria");
List<Hotel> hotels = bookingService
.findHotels(search.getSearchString(), search.getPageSize(), search.getPage());
context.getFlowScope().put("hotels", hotels);
return success();
}
}

View File

@@ -0,0 +1,58 @@
package org.springframework.webflow.samples.booking.flow.main;
import java.io.Serializable;
import org.springframework.webflow.samples.booking.app.BookingService;
/**
* A backing bean for the main hotel search form. Encapsulates the criteria needed to perform a hotel search.
*
* It is expected a future milestone of Spring Web Flow 2.0 will allow flow-scoped beans like this one to hold
* references to transient services that are restored automatically when the flow is resumed on subsequent requests.
* This would allow this SearchCriteria object to delegate to the {@link BookingService} directly, for example,
* eliminating the need for the actions in {@link MainActions}.
*/
public class SearchCriteria implements Serializable {
private static final long serialVersionUID = 1L;
/**
* The user-provided search criteria for finding Hotels.
*/
private String searchString;
/**
* The maximum page size of the Hotel result list
*/
private int pageSize;
/**
* The current page of the Hotel result list.
*/
private int page;
public String getSearchString() {
return searchString;
}
public void setSearchString(String searchString) {
this.searchString = searchString;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
}

View File

@@ -0,0 +1,2 @@
Manifest-Version: 1.0

View File

@@ -0,0 +1,11 @@
log4j.rootCategory=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
# Enable web flow logging
log4j.category.org.springframework.webflow=DEBUG
log4j.category.org.springframework.faces=DEBUG
log4j.category.org.springframework.binding=DEBUG
log4j.category.org.springframework.transaction=DEBUG

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:tx="http://www.springframework.org/schema/tx"
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.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<!-- The central service of this application that can query hotels and bookings, as well as cancel bookings -->
<bean id="bookingService" class="org.springframework.webflow.samples.booking.app.JpaBookingService" />
<!-- Creates a EntityManagerFactory for use with the Hibernate JPA provider and a simple in-memory data source populated with test data -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
</property>
</bean>
<!-- Deploys a in-memory "booking" datasource -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.hsqldb.jdbcDriver" />
<property name="url" value="jdbc:hsqldb:mem:booking" />
<property name="username" value="sa" />
<property name="password" value="" />
</bean>
<!-- Executes transactions around @Transactional methods -->
<tx:annotation-driven transaction-manager="transactionManager"/>
<!-- Drives transactions using local JPA APIs -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<!-- Automatically injects EntityManager references into data access objects that require one -->
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<!-- Maps JPA exceptions that occur to Spring's DataAccessException hierarchy -->
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
</beans>

View File

@@ -0,0 +1,53 @@
<?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:web="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd">
<!-- Imports the "application-layer" definining business logic and data access services -->
<import resource="application-layer-config.xml"/>
<bean name="/*" class="org.springframework.webflow.mvc.FlowController">
<property name="flowExecutor" ref="flowExecutor" />
</bean>
<web:flow-executor id="flowExecutor" flow-registry="flowRegistry">
<web:flow-execution-listeners>
<web:listener ref="jpaFlowExecutionListener" criteria="*"/>
</web:flow-execution-listeners>
</web:flow-executor>
<web:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
<web:flow-location path="flow/main/main.xml" />
<web:flow-location path="flow/booking/booking.xml" />
<web:flow-builder class="org.springframework.faces.ui.resource.ResourcesFlowBuilder" />
</web:flow-registry>
<bean id="flowBuilderServices" class="org.springframework.webflow.engine.builder.support.FlowBuilderServices">
<property name="expressionParser">
<bean class="org.springframework.webflow.core.expression.el.WebFlowELExpressionParser">
<constructor-arg >
<bean class="org.jboss.el.ExpressionFactoryImpl"/>
</constructor-arg>
</bean>
</property>
<property name="viewFactoryCreator">
<bean class="org.springframework.webflow.mvc.MvcViewFactoryCreator"/>
</property>
</bean>
<!-- Installs a listener that manages JPA persistence contexts for flows that require them -->
<bean id="jpaFlowExecutionListener" class="org.springframework.webflow.persistence.JpaFlowExecutionListener">
<constructor-arg>
<ref bean="entityManagerFactory"/>
</constructor-arg>
<constructor-arg>
<ref bean="transactionManager"/>
</constructor-arg>
</bean>
</beans>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!-- The front controller of the Spring MVC Web application, responsible for handling all application requests -->
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/web-application-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map all *.spring requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>

View File

@@ -0,0 +1,265 @@
/* Setup defaults since variable in browsers
----------------------------------------------- */
body, div, dd, dt, dl, img, ul, ol, li, p, h1, h2, h3, h4, h5, form, hr, fieldset {
margin: 0;
padding: 0;
}
/* Element Defaults
----------------------------------------------- */
html {
height: 100%;
background-color: #9cac7c;
}
img {
border: 0;
}
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: small;
line-height: 1.25em;
color: #362F2D;
position: relative;
width: 760px;
height: 100%;
margin-left: auto;
margin-right: auto;
}
label {
font-weight: bold;
color: #5E5147;
}
input {
border: 1px solid #C3BBB6;
padding: 4px;
margin: 5px 0;
background: #fff url(../images/input.bg.gif) 0 0 repeat-x;
}
select {
border: 1px solid #C3BBB6;
padding: 4px;
margin: 5px 0;
background: #fff url(../images/input.bg.gif) 0 0 repeat-x;
}ol, ul {
margin: 10px 0px 10px 6px;
}
li {
margin: 10px 12px;
}
fieldset {
border: 0;
}
/* Layout
----------------------------------------------- */
#document {
padding: 0 1px;
background: #fff url(../images/bg.gif) 0 0 repeat-y;
float: left;
border-bottom: 1px solid #C3BBB6;
}
#header {
float: left;
width: 758px;
height:36px;
background-color: #414f23;
}
#container {
float: left;
width: 758px;
background: url(../images/header.jpg) 0 0 repeat-x;
}
#sidebar {
float: left;
width: 205px;
margin-left: 5px;
margin-top: 185px;
padding-top: 5px;
}
#content {
float: left;
width: 448px;
margin-top: 195px;
padding-top: 5px;
background: #fff url(../images/cnt.bg.gif) 0 0 repeat-x;
}
#footer {
clear: both;
margin-top: 40px;
float: left;
padding: 20px;
border-top: 1px solid #C3BBB6;
background-color: #fff;
width: 718px;
text-align: right;
}
/* General
----------------------------------------------- */
input[type="submit"], input[type="button"] {
font-weight: bold;
color: #fff;
border: 1px solid #5D1414;
height: 26px;
background: #fff url(../images/btn.bg.gif) 0 0 repeat-x;
border-style: none;
}
.center {
text-align: center;
}
.entry {
clear: both;
padding-top: 10px;
}
.entry .label {
float: left;
padding-top: 10px;
padding-right: 5px;
font-weight: bold;
width: 150px;
text-align: right;
}
.entry .output {
float: left;
width: 250px;
padding-top: 10px;
text-align: left;
}
.entry .input {
float: left;
width: 250px;
text-align: left;
}
/* Sidebar
----------------------------------------------- */
.notes {
text-align: center;
font-size: small;
}
.errors {
font-size: small;
font-weight: bold;
text-align: center;
color: #600;
}
.errors div {
text-align: left;
}
.errors input {
border: 1px solid #600;
}
.errors ul {
list-style: none;
}
.buttonBox {
text-align: center;
padding: 5px 0;
}
#sidebar p {
font-size: small;
color: #8B7869;
line-height: 150%;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 5px;
padding-right: 5px;
}
#sidebar li {
font-size: small;
color: #8B7869;
}
#sidebar h1 {
line-height: normal;
font-weight: bold;
font-size: small;
}
/*
#sidebar p:hover {
color: #362F2D;
}
*/
/* Content
----------------------------------------------- */
#content .section {
float: left;
width: 518px;
padding: 15px 15px 0 10px;
}
#content .section h1 {
font-family: "Trebuchet MS", Arial, sans-serif;
line-height: normal;
font-weight: normal;
font-size: large;
}
#content .section p {
line-height: 150%;
padding: 10px 0;
font-size: small;
}
#content table {
width: 100%;
border: 1px solid #D2C9C4;
border-collapse: collapse;
}
#content table caption {
padding-bottom: 6px;
text-align: left;
font-weight: bold;
}
#content table thead th {
border-left: 1px solid #D2C9C4;
background: #fff url(../images/th.bg.gif) 0 100% repeat-x;
border-bottom: 1px solid #D2C9C4;
padding: 6px;
text-align: left;
font-size: small;
}
#content table tbody td {
border-left: 1px solid #E4DBD5;
padding: 4px;
border-bottom: 1px solid #D2C9C4;
font-size: 8pt;
}
#content dt {
font-weight: bold;
float: left;
width: 33%;
}
#content dd {
padding-left: 10px;
float: left;
width: 66%;
}
#radio table {
border: 0px;
}
#radio table tr td {
border: 0px;
border-left: 0px;
border-bottom: 0px;
}
#content .section .prev {
float: left;
width: 120px;
}
#content .section .next {
float: left;
}
/* Header
----------------------------------------------- */
#title {
float: left;
padding: 10px 0 6px 15px;
color: #e9efdb;
}
#status {
color: #e9efdb;
float: right;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: x-small;
text-align: right;
padding-top: 14px;
padding-right: 15px;
}
#status a {
color: #e9efdb;
text-decoration: none;
}

View File

@@ -0,0 +1,10 @@
<?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.0.xsd">
<bean id="bookingActions" class="org.springframework.webflow.samples.booking.flow.booking.BookingActions"/>
</beans>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd">
<attribute name="description" value="The flow that handles the process of booking a hotel for a user"/>
<!--
Indicates this flow requires a persistence context
One will be created automatically when this flow starts; all data access will use it automatically
-->
<attribute name="persistenceContext" value="true" />
<input-mapper>
<input-attribute name="id" scope="flow" />
</input-mapper>
<start-state idref="displayHotel"/>
<view-state id="displayHotel" view="hotelDetails.jsp">
<render-actions>
<bean-action method="findHotelById" bean="bookingService">
<method-arguments>
<argument expression="id" />
</method-arguments>
<method-result name="hotel" scope="flow" />
</bean-action>
</render-actions>
<transition on="book" to="createBooking" />
<transition on="cancel" to="cancel" />
</view-state>
<action-state id="createBooking">
<action method="createBooking" bean="bookingActions"/>
<transition on="success" to="enterBookingDetails" />
</action-state>
<view-state id="enterBookingDetails" view="bookingForm.jsp">
<transition on="proceed" to="confirmBooking">
<action method="validateBooking" bean="bookingActions" />
</transition>
<transition on="cancel" to="cancel" />
</view-state>
<view-state id="confirmBooking" view="confirmBooking.jsp">
<transition on="confirm" to="bookingAuthorized" />
<transition on="revise" to="enterBookingDetails" />
<transition on="cancel" to="cancel" />
</view-state>
<end-state id="cancel">
<!-- Indicates any changes to managed persistent entities should NOT be committed to the database -->
<attribute name="commit" value="false" type="boolean" />
</end-state>
<end-state id="bookingAuthorized">
<!-- Indicates changes to managed persistent entities should be committed to the database at this point -->
<attribute name="commit" value="true" type="boolean" />
</end-state>
<import resource="booking-beans.xml"/>
</flow>

View File

@@ -0,0 +1,154 @@
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tiles:insertTemplate template="/template.jsp">
<tiles:putAttribute name="content">
<div class="section">
<h1>Book Hotel</h1>
</div>
<div class="section">
<h:form id="booking">
<h:messages errorClass="errors" />
<fieldset>
<div class="entry">
<div class="label">Name:</div>
<div class="output">#{hotel.name}</div>
</div>
<div class="entry">
<div class="label">Address:</div>
<div class="output">#{hotel.address}</div>
</div>
<div class="entry">
<div class="label">City, State:</div>
<div class="output">#{hotel.city}, #{hotel.state}</div>
</div>
<div class="entry">
<div class="label">Zip:</div>
<div class="output">#{hotel.zip}</div>
</div>
<div class="entry">
<div class="label">Country:</div>
<div class="output">#{hotel.country}</div>
</div>
<div class="entry">
<div class="label">Nightly rate:</div>
<div class="output">
<h:outputText value="#{hotel.price}">
<f:convertNumber type="currency" currencySymbol="$"/>
</h:outputText>
</div>
</div>
<div class="entry">
<div class="label">
<h:outputLabel for="checkinDate">Check In Date:</h:outputLabel>
</div>
<div class="input">
<sf:clientDateValidator allowBlank="false" msgDisplay="block" msgClass="errors">
<h:inputText id="checkinDate" value="#{booking.checkinDate}" required="true">
<f:convertDateTime pattern="MM/dd/yy" timeZone="EST"/>
</h:inputText>
</sf:clientDateValidator>
</div>
</div>
<div class="entry">
<div class="label">
<h:outputLabel for="checkoutDate">Check Out Date:</h:outputLabel>
</div>
<div class="input">
<sf:clientDateValidator allowBlank="false" msgDisplay="block" msgClass="errors">
<h:inputText id="checkoutDate" value="#{booking.checkoutDate}" required="true">
<f:convertDateTime pattern="MM/dd/yy" timeZone="EST"/>
</h:inputText>
</sf:clientDateValidator>
</div>
</div>
<div class="entry">
<div class="label">
<h:outputLabel for="beds">Room Preference:</h:outputLabel>
</div>
<div class="input">
<h:selectOneMenu id="beds" value="#{booking.beds}">
<f:selectItem itemLabel="One king-size bed" itemValue="1"/>
<f:selectItem itemLabel="Two double beds" itemValue="2"/>
<f:selectItem itemLabel="Three beds" itemValue="3"/>
</h:selectOneMenu>
</div>
</div>
<div class="entry">
<div class="label">
<h:outputLabel for="smoking">Smoking Preference:</h:outputLabel>
</div>
<div id="radio" class="input">
<h:selectOneRadio id="smoking" value="#{booking.smoking}" layout="pageDirection">
<f:selectItem itemLabel="Smoking" itemValue="true"/>
<f:selectItem itemLabel="Non Smoking" itemValue="false"/>
</h:selectOneRadio>
</div>
</div>
<div class="entry">
<div class="label">
<h:outputLabel for="creditCard">Credit Card #:</h:outputLabel>
</div>
<div class="input">
<sf:clientNumberValidator allowBlank="false" allowNegative="false" allowDecimals="false" minLength="16" maxLength="16" msgDisplay="block" msgClass="errors">
<h:inputText id="creditCard" value="#{booking.creditCard}" required="true"/>
</sf:clientNumberValidator>
</div>
</div>
<div class="entry">
<div class="label">
<h:outputLabel for="creditCardName">Credit Card Name:</h:outputLabel>
</div>
<div class="input">
<sf:clientTextValidator allowBlank="false" msgDisplay="block" msgClass="errors">
<h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true"/>
</sf:clientTextValidator>
</div>
</div>
<div class="entry">
<div class="label">
<h:outputLabel for="creditCardExpiryMonth">Credit Card Expiry:</h:outputLabel>
</div>
<div class="input">
<h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
<f:selectItem itemLabel="Jan" itemValue="1"/>
<f:selectItem itemLabel="Feb" itemValue="2"/>
<f:selectItem itemLabel="Mar" itemValue="3"/>
<f:selectItem itemLabel="Apr" itemValue="4"/>
<f:selectItem itemLabel="May" itemValue="5"/>
<f:selectItem itemLabel="Jun" itemValue="6"/>
<f:selectItem itemLabel="Jul" itemValue="7"/>
<f:selectItem itemLabel="Aug" itemValue="8"/>
<f:selectItem itemLabel="Sep" itemValue="9"/>
<f:selectItem itemLabel="Oct" itemValue="10"/>
<f:selectItem itemLabel="Nov" itemValue="11"/>
<f:selectItem itemLabel="Dec" itemValue="12"/>
</h:selectOneMenu>
<h:selectOneMenu id="creditCardExpiryYear" value="#{booking.creditCardExpiryYear}">
<f:selectItem itemLabel="2005" itemValue="2005"/>
<f:selectItem itemLabel="2006" itemValue="2006"/>
<f:selectItem itemLabel="2007" itemValue="2007"/>
<f:selectItem itemLabel="2008" itemValue="2008"/>
<f:selectItem itemLabel="2009" itemValue="2009"/>
</h:selectOneMenu>
</div>
</div>
<div class="entry errors">
<h:messages globalOnly="true"/>
</div>
<div class="entry">
<div class="label">&#160;</div>
<div class="input">
<sf:validateAllOnClick>
<h:commandButton id="proceed" action="proceed" value="Proceed"/>
</sf:validateAllOnClick>&#160;
<h:commandButton id="cancel" immediate="true" value="Cancel" action="cancel"/>
</div>
</div>
</fieldset>
</h:form>
</div>
</tiles:putAttribute>
</tiles:insertTemplate>

View File

@@ -0,0 +1,67 @@
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tiles:insertTemplate template="/template.jsp">
<tiles:putAttribute name="content">
<div class="section">
<h1>Confirm Hotel Booking</h1>
</div>
<div class="section">
<h:form id="confirm">
<fieldset>
<div class="entry">
<div class="label">Name:</div>
<div class="output">#{hotel.name}</div>
</div>
<div class="entry">
<div class="label">Address:</div>
<div class="output">#{hotel.address}</div>
</div>
<div class="entry">
<div class="label">City, State:</div>
<div class="output">#{hotel.city}, #{hotel.state}</div>
</div>
<div class="entry">
<div class="label">Zip:</div>
<div class="output">#{hotel.zip}</div>
</div>
<div class="entry">
<div class="label">Country:</div>
<div class="output">#{hotel.country}</div>
</div>
<div class="entry">
<div class="label">Total payment:</div>
<div class="output">
<h:outputText value="#{booking.total}">
<f:convertNumber type="currency"
currencySymbol="$"/>
</h:outputText>
</div>
</div>
<div class="entry">
<div class="label">Check In Date:</div>
<div class="output"><h:outputText value="#{booking.checkinDate}"/></div>
</div>
<div class="entry">
<div class="label">Check Out Date:</div>
<div class="output"><h:outputText value="#{booking.checkoutDate}"/></div>
</div>
<div class="entry">
<div class="label">Credit Card #:</div>
<div class="output">#{booking.creditCard}</div>
</div>
<div class="entry">
<div class="label">&#160;</div>
<div class="input">
<h:commandButton id="confirm" value="Confirm" action="confirm"/>&#160;
<h:commandButton id="revise" value="Revise" action="revise"/>&#160;
<h:commandButton id="cancel" value="Cancel" action="cancel"/>
</div>
</div>
</fieldset>
</h:form>
</div>
</tiles:putAttribute>
</tiles:insertTemplate>

View File

@@ -0,0 +1,55 @@
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tiles:insertTemplate template="/template.jsp">
<tiles:putAttribute name="content">
<div class="section">
<h1>View Hotel</h1>
</div>
<div class="section">
<div class="entry">
<div class="label">Name:</div>
<div class="output">#{hotel.name}</div>
</div>
<div class="entry">
<div class="label">Address:</div>
<div class="output">#{hotel.address}</div>
</div>
<div class="entry">
<div class="label">City:</div>
<div class="output">#{hotel.city}</div>
</div>
<div class="entry">
<div class="label">State:</div>
<div class="output">#{hotel.state}</div>
</div>
<div class="entry">
<div class="label">Zip:</div>
<div class="output">#{hotel.zip}</div>
</div>
<div class="entry">
<div class="label">Country:</div>
<div class="output">#{hotel.country}</div>
</div>
<div class="entry">
<div class="label">Nightly rate:</div>
<div class="output">
<h:outputText value="#{hotel.price}">
<f:convertNumber type="currency" currencySymbol="$"/>
</h:outputText>
</div>
</div>
</div>
<div class="section">
<h:form id="hotel">
<fieldset class="buttonBox">
<h:commandButton id="book" action="book" value="Book Hotel"/>&#160;
<h:commandButton id="cancel" action="cancel" value="Back to Search"/>
</fieldset>
</h:form>
</div>
</titles:putAttribute>
</tiles:insertTemplate>

View File

@@ -0,0 +1,12 @@
<?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.0.xsd">
<bean id="mainActions" class="org.springframework.webflow.samples.booking.flow.main.MainActions">
<constructor-arg ref="bookingService" />
</bean>
</beans>

View File

@@ -0,0 +1,106 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tiles:insertTemplate template="/template.jsp">
<tiles:putAttribute name="content">
<form:form modelAttribute="searchCriteria">
<div class="section">
<span class="errors">
<form:errors/>
</span>
<h1>Search Hotels</h1>
<fieldset>
<form:input path="searchString"/>
<label for="pageSize">Maximum results:</label>
<form:select path="pageSize">
<form:option label="5" value="5"/>
<form:option label="10" value="10"/>
<form:option label="20" value="20"/>
</form:select>
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}" />
<input type="submit" class="button" name="_eventId_findHotels" value="Find Hotels" style="width: 165px; height: 15px;" />
</fieldset>
</div>
<div class="section">
<c:if test="#{hotels.empty == 0}">
No Hotels Found
</c:if>
<table>
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>City, State</th>
<th>Zip</th>
</tr>
</thead>
<tbody>
<c:forEach var="hotel" items="#{hotels}">
<tr>
<td>#{hotel.name}</td>
<td>#{hotel.address}</td>
<td>#{hotel.city}, #{hotel.state}, #{hotel.country}</td>
<td>#{hotel.zip}</td>
<td>
<c:url var="viewHotelLink">
<c:param name="hotelId" value="#{hotel.id}"/>
<c:param name="_flowExecutionKey" value="#{flowExecutionKey}" />
</c:url>
<a href="#{viewHotelLink}">View Hotel</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
<div class="section">
<h1>Current Hotel Bookings</h1>
</div>
<div class="section">
<c:if test="#{bookings.empty}">
No Bookings Found
</c:if>
<table>
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>City, State</th>
<th>Check in Date</th>
<th>Check out Date</th>
<th>Confirmation Number</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<c:forEach var="booking" items="#{bookings}">
<tr>
<td>#{booking.hotel.name}</td>
<td>#{booking.hotel.address}</td>
<td>#{booking.hotel.city}, #{booking.hotel.state}</td>
<td>#{booking.checkinDate}</td>
<td>#{booking.checkoutDate}</td>
<td>#{booking.id}</td>
<td>
<c:url var="cancelBookingLink">
<c:param name="bookingId" value="#{booking.id}"/>
<c:param name="_flowExecutionKey" value="#{flowExecutionKey}" />
</c:url>
<a href="#{cancelBookingLink}">Cancel</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</form:form>
</tiles:putAttribute>
</tiles:insertTemplate>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd">
<attribute name="description" value="The main flow of the application that handles searching for hotels to book"/>
<var name="searchCriteria" class="org.springframework.webflow.samples.booking.flow.main.SearchCriteria" scope="flow" />
<start-actions>
<action method="initCurrentUser" bean="mainActions" />
<action method="findCurrentUserBookings" bean="mainActions" />
</start-actions>
<start-state idref="displayMain"/>
<view-state id="displayMain" view="main.jsp">
<transition on="findHotels" to="findHotels" />
<transition on="selectHotel" to="bookHotel" />
<transition on="cancelBooking" to="cancelBooking" />
</view-state>
<action-state id="findHotels">
<action method="findHotels" bean="mainActions" />
<transition on="success" to="displayMain" />
</action-state>
<subflow-state id="bookHotel" flow="booking">
<attribute-mapper>
<input-mapper>
<mapping source="requestParameters.hotelId" target="id" from="string" to="long" />
</input-mapper>
</attribute-mapper>
<transition on="bookingAuthorized" to="reloadCurrentUserBookings" />
<transition on="cancel" to="displayMain" />
</subflow-state>
<action-state id="cancelBooking">
<bean-action method="cancelBooking" bean="bookingService">
<method-arguments>
<argument expression="requestParameters.bookingId" parameter-type="long"/>
</method-arguments>
</bean-action>
<transition on="success" to="reloadCurrentUserBookings" />
</action-state>
<action-state id="reloadCurrentUserBookings">
<action method="findCurrentUserBookings" bean="mainActions" />
<transition on="success" to="displayMain" />
</action-state>
<import resource="main-beans.xml" />
</flow>

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1,5 @@
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=spring/main">
</head>
</html>

View File

@@ -0,0 +1,45 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Spring Faces: Hotel Booking Sample Application</title>
<link href="/swf-booking-jsf/css/screen.css" rel="stylesheet" type="text/css" />
<tiles:insertAttribute name="headIncludes" />
</head>
<body>
<div id="document">
<div id="header">
<div id="title">Spring Faces: Hotel Booking Sample Application</div>
<div id="status">
Welcome #{user.name}
</div>
</div>
<div id="container">
<div id="sidebar">
<a href="http://www.thespringexperience.com">
<c:url value="/images/diplomat.jpg" />
</a>
<a href="http://www.thespringexperience.com">
<c:url value="/images/tse.gif" />
</a>
<p>
The features illustrated in this sample are just the beginning.
To see what is in store for developing rich web applications with Spring, join us at
<a href="http://www.thespringexperience.com">The Spring Experience</a>
December 12 - 15, 2007 at the Westin Diplomat in Hollywood, Florida.
</p>
</div>
<div id="content">
<tiles:insertAttribute name="content" />
</div>
<div id="footer">
<a href="http://www.springframework.org"><img src="/swf-booking-jsf/images/powered-by-spring.png" /></a>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,9 @@
log4j.rootCategory=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
# Enable web flow logging
log4j.category.org.springframework.webflow=DEBUG
log4j.category.org.springframework.binding=DEBUG

View File

@@ -26,32 +26,32 @@
<dependency org="xerces" name="xercesImpl" rev="2.8.0"/>
<dependency org="xml-apis" name="xml-apis" rev="1.3.03"/>
-->
<dependency org="org.springframework" name="spring-beans" rev="2.1-m4" />
<dependency org="org.springframework" name="spring-beans" rev="2.5-rc1" />
<dependency org="org.springframework" name="spring-binding" rev="latest.integration" />
<dependency org="org.springframework" name="spring-core" rev="2.1-m4" />
<dependency org="org.springframework" name="spring-context" rev="2.1-m4" />
<dependency org="org.springframework" name="spring-web" rev="2.1-m4" />
<dependency org="org.springframework" name="spring-core" rev="2.5-rc1" />
<dependency org="org.springframework" name="spring-context" rev="2.5-rc1" />
<dependency org="org.springframework" name="spring-web" rev="2.5-rc1" />
<!-- testing support only dependencies -->
<dependency org="junit" name="junit" rev="3.8.2" conf="buildtime, testing->default" />
<!-- spring mvc only dependencies -->
<dependency org="org.springframework" name="spring-webmvc" rev="2.1-m4" conf="buildtime, mvc->default" />
<dependency org="org.springframework" name="spring-webmvc" rev="2.5-rc1" conf="buildtime, mvc->default" />
<!-- spring portlet mvc only dependencies -->
<dependency org="org.springframework" name="spring-webmvc-portlet" rev="2.1-m4" conf="buildtime, portlet->default" />
<dependency org="org.springframework" name="spring-webmvc-portlet" rev="2.5-rc1" conf="buildtime, portlet->default" />
<!-- struts only dependencies -->
<dependency org="struts" name="struts" rev="1.2.9" conf="buildtime, struts->default" />
<dependency org="org.springframework" name="spring-webmvc-struts" rev="2.1-m4" conf="buildtime, struts->default" />
<dependency org="org.springframework" name="spring-webmvc-struts" rev="2.5-rc1" conf="buildtime, struts->default" />
<!-- build time only dependencies -->
<dependency org="javax.servlet" name="servlet-api" rev="2.4" conf="buildtime->default" />
<dependency org="javax.portlet" name="portlet-api" rev="1.0" conf="buildtime->default" />
<dependency org="javax.el" name="el-api" rev="1.0" conf="buildtime->default" />
<dependency org="org.hibernate" name="hibernate" rev="3.2.4.ga" conf="buildtime->default" />
<dependency org="org.springframework" name="spring-orm" rev="2.1-m4" conf="buildtime->default" />
<dependency org="org.springframework" name="spring-tx" rev="2.1-m4" conf="buildtime->default" />
<dependency org="org.springframework" name="spring-orm" rev="2.5-rc1" conf="buildtime->default" />
<dependency org="org.springframework" name="spring-tx" rev="2.5-rc1" conf="buildtime->default" />
<dependency org="javax.persistence" name="persistence-api" rev="1.0b" conf="buildtime->default" />
<dependency org="concurrent" name="concurrent" rev="1.3.4" conf="buildtime->default" />
@@ -60,8 +60,8 @@
<dependency org="log4j" name="log4j" rev="1.2.14" conf="test->default" />
<dependency org="org.easymock" name="easymock" rev="2.2" conf="test->default" />
<dependency org="com.cenqua.clover" name="clover" rev="1.3.12" conf="test->default" />
<dependency org="org.springframework" name="spring-jdbc" rev="2.1-m4" conf="test->default" />
<dependency org="org.springframework" name="spring-test" rev="2.1-m4" conf="test->default" />
<dependency org="org.springframework" name="spring-jdbc" rev="2.5-rc1" conf="test->default" />
<dependency org="org.springframework" name="spring-test" rev="2.5-rc1" conf="test->default" />
<dependency org="org.hibernate" name="hibernate" rev="3.2.4.ga" conf="test->default" />
<dependency org="org.hibernate" name="hibernate-entitymanager" rev="3.3.1.ga" conf="test->default" />
<dependency org="org.hibernate" name="hibernate-commons-annotations" rev="3.3.0.ga" conf="test->default" />

View File

@@ -90,11 +90,7 @@ public class ServletExternalContext implements ExternalContext {
*/
private SharedAttributeMap applicationMap;
private String flowId;
private String flowExecutionKey;
private RequestPath requestPath;
private FlowRequestInfo flowRequestInfo;
private String encodingScheme = DEFAULT_ENCODING_SCHEME;
@@ -128,25 +124,51 @@ public class ServletExternalContext implements ExternalContext {
this.requestMap = new LocalAttributeMap(new HttpServletRequestMap(this.request));
this.sessionMap = new LocalSharedAttributeMap(new HttpSessionMap(this.request));
this.applicationMap = new LocalSharedAttributeMap(new HttpServletContextMap(context));
parseRequestPathInfo();
this.flowRequestInfo = parseFlowRequestInfo(this.request);
}
public static class FlowRequestInfo {
private String flowId;
private String flowExecutionKey;
private RequestPath requestPath;
public FlowRequestInfo(String flowId, String flowExecutionKey, RequestPath requestPath) {
this.flowId = flowId;
this.flowExecutionKey = flowExecutionKey;
this.requestPath = requestPath;
}
public String getFlowId() {
return flowId;
}
public String getFlowExecutionKey() {
return flowExecutionKey;
}
public RequestPath getRequestPath() {
return requestPath;
}
}
public String getFlowId() {
return flowId;
return flowRequestInfo.getFlowId();
}
public String getFlowExecutionKey() {
return flowExecutionKey;
return flowRequestInfo.getFlowExecutionKey();
}
public RequestPath getRequestPath() {
return flowRequestInfo.getRequestPath();
}
public String getRequestMethod() {
return request.getMethod();
}
public RequestPath getRequestPath() {
return requestPath;
}
public ParameterMap getRequestParameterMap() {
return requestParameterMap;
}
@@ -183,8 +205,6 @@ public class ServletExternalContext implements ExternalContext {
return flowExecutionRedirector != null || flowDefinitionRedirector != null || resourceUri != null;
}
// response requesters
public PrintWriter getResponseWriter() {
try {
return response.getWriter();
@@ -194,6 +214,30 @@ public class ServletExternalContext implements ExternalContext {
}
}
public String encode(String string) {
try {
return URLEncoder.encode(string, encodingScheme);
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("Unsupported encoding errors should never happen", e);
}
}
public String buildFlowDefinitionUrl(FlowDefinitionRequestInfo requestInfo) {
return getFlowExecutorPath() + "/" + requestInfo.getFlowDefinitionId() + requestPath(requestInfo)
+ requestParameters(requestInfo) + fragment(requestInfo);
}
public String buildFlowExecutionUrl(FlowExecutionRequestInfo requestInfo, boolean contextRelative) {
String contextRelativeUrl = getFlowExecutionsPath() + requestInfo.getFlowDefinitionId() + "/"
+ requestInfo.getFlowExecutionKey() + requestPath(requestInfo) + requestParameters(requestInfo)
+ fragment(requestInfo);
if (contextRelative) {
return contextRelativeUrl;
} else {
return request.getScheme() + request.getServerName() + contextRelativeUrl;
}
}
public void sendFlowExecutionRedirect(FlowExecutionRequestInfo request) {
flowExecutionRedirector = new FlowExecutionRedirector(request);
}
@@ -206,32 +250,6 @@ public class ServletExternalContext implements ExternalContext {
this.resourceUri = resourceUri;
}
// helpers
public String encode(String string) {
try {
return URLEncoder.encode(string, encodingScheme);
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("Unsupported encoding errors should never happen", e);
}
}
public String buildFlowDefinitionUrl(FlowDefinitionRequestInfo requestInfo) {
return request.getContextPath() + request.getServletPath() + "/" + requestInfo.getFlowDefinitionId()
+ requestPath(requestInfo) + requestParameters(requestInfo) + fragment(requestInfo);
}
public String buildFlowExecutionUrl(FlowExecutionRequestInfo requestInfo, boolean contextRelative) {
String contextRelativeUrl = request.getContextPath() + request.getServletPath() + "/executions/"
+ requestInfo.getFlowDefinitionId() + "/" + requestInfo.getFlowExecutionKey()
+ requestPath(requestInfo) + requestParameters(requestInfo) + fragment(requestInfo);
if (contextRelative) {
return contextRelativeUrl;
} else {
return request.getScheme() + request.getServerName() + contextRelativeUrl;
}
}
// execution processing result setters
public void setPausedResult(String flowExecutionKey) {
@@ -247,7 +265,7 @@ public class ServletExternalContext implements ExternalContext {
public void setExceptionResult(FlowException e) {
result = 2;
exception = e;
processedFlowExecutionKey = flowExecutionKey;
processedFlowExecutionKey = flowRequestInfo.getFlowExecutionKey();
}
/**
@@ -293,29 +311,45 @@ public class ServletExternalContext implements ExternalContext {
}
}
private void parseRequestPathInfo() {
// hooks subclasses may override
protected FlowRequestInfo parseFlowRequestInfo(HttpServletRequest request) {
String pathInfo = request.getPathInfo();
if (pathInfo == null) {
throw new IllegalArgumentException(
"The requestPathInfo is null: unable to extract flow definition id or flow execution key");
}
String flowId;
String flowExecutionKey;
RequestPath path = new RequestPath(pathInfo);
if (path.getElement(0).equals("executions")) {
flowId = path.getElement(1);
flowExecutionKey = path.getElement(2);
if (path.getElementCount() > 3) {
requestPath = path.pop(3);
path = path.pop(3);
} else {
requestPath = null;
path = null;
}
} else {
flowId = path.getElement(0);
flowExecutionKey = null;
if (path.getElementCount() > 1) {
requestPath = path.pop(1);
path = path.pop(1);
} else {
requestPath = null;
path = null;
}
}
return new FlowRequestInfo(flowId, flowExecutionKey, path);
}
// private helpers
private String getFlowExecutorPath() {
return request.getContextPath() + request.getServletPath();
}
private String getFlowExecutionsPath() {
return getFlowExecutorPath() + "/executions/";
}
private boolean isPausedResult() {
@@ -411,9 +445,7 @@ public class ServletExternalContext implements ExternalContext {
public void issueRedirect() throws IOException {
FlowExecutionRequestInfo requestInfo = (FlowExecutionRequestInfo) getRequestInfo();
String targetUrl = request.getContextPath() + request.getServletPath() + "/executions/"
+ requestInfo.getFlowDefinitionId() + "/" + requestInfo.getFlowExecutionKey()
+ requestPath(getRequestInfo()) + requestParameters(getRequestInfo()) + fragment(getRequestInfo());
String targetUrl = buildFlowExecutionUrl(requestInfo, true);
response.sendRedirect(response.encodeRedirectURL(targetUrl));
}
}
@@ -424,10 +456,8 @@ public class ServletExternalContext implements ExternalContext {
}
public void issueRedirect() throws IOException {
FlowDefinitionRequestInfo redirect = (FlowDefinitionRequestInfo) getRequestInfo();
String targetUrl = request.getContextPath() + request.getServletPath() + "/"
+ redirect.getFlowDefinitionId() + requestPath(getRequestInfo())
+ requestParameters(getRequestInfo()) + fragment(getRequestInfo());
FlowDefinitionRequestInfo requestInfo = (FlowDefinitionRequestInfo) getRequestInfo();
String targetUrl = buildFlowDefinitionUrl(requestInfo);
response.sendRedirect(response.encodeRedirectURL(targetUrl));
}
}

View File

@@ -1,13 +1,14 @@
package org.springframework.webflow.engine.builder;
import org.springframework.binding.expression.Expression;
import org.springframework.core.io.ResourceLoader;
import org.springframework.webflow.execution.Action;
import org.springframework.webflow.execution.ViewFactory;
public interface ViewFactoryCreator {
public ViewFactory createViewFactory(Expression viewId);
public ViewFactory createViewFactory(Expression viewId, ResourceLoader viewResourceLoader);
public Action createFinalResponseAction(Expression viewId);
public Action createFinalResponseAction(Expression viewId, ResourceLoader viewResourceLoader);
}