Initial commit of SWF Boooking sample application
13
spring-webflow-samples /swf-booking-jsf/.classpath
Executable file
@@ -0,0 +1,13 @@
|
||||
<?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="lib" path="lib/test/spring-mock.jar"/>
|
||||
<classpathentry kind="lib" path="lib/global/freemarker.jar"/>
|
||||
<classpathentry kind="lib" path="lib/global/hibernate.jar"/>
|
||||
<classpathentry kind="lib" path="lib/global/hibernate-tools.jar"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
16
spring-webflow-samples /swf-booking-jsf/.m7project
Executable 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>
|
||||
42
spring-webflow-samples /swf-booking-jsf/.project
Executable file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>swf-booking-jsf</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>
|
||||
262
spring-webflow-samples /swf-booking-jsf/.settings/org.eclipse.jdt.core.prefs
Executable file
@@ -0,0 +1,262 @@
|
||||
#Tue Jul 31 15:11:23 EDT 2007
|
||||
eclipse.preferences.version=1
|
||||
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
|
||||
52
spring-webflow-samples /swf-booking-jsf/.settings/org.eclipse.jdt.ui.prefs
Executable file
@@ -0,0 +1,52 @@
|
||||
#Tue Jul 31 15:09:12 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
|
||||
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
|
||||
@@ -0,0 +1,4 @@
|
||||
#Fri Aug 03 12:43:55 EDT 2007
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jpt.core.discoverAnnotatedClasses=true
|
||||
org.eclipse.jpt.core.platform=generic
|
||||
@@ -0,0 +1,4 @@
|
||||
#Mon Nov 13 17:23:47 PST 2006
|
||||
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
|
||||
@@ -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-jsf">
|
||||
<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-jsf"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,6 @@
|
||||
#Mon Nov 13 17:29:33 PST 2006
|
||||
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
|
||||
@@ -0,0 +1,4 @@
|
||||
#Fri Aug 03 13:03:09 EDT 2007
|
||||
default.configuration=swf-booking-jsf
|
||||
eclipse.preferences.version=1
|
||||
hibernate3.enabled=true
|
||||
@@ -0,0 +1,33 @@
|
||||
#Thu Aug 02 15:26:32 EDT 2007
|
||||
eclipse.preferences.version=1
|
||||
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
|
||||
19
spring-webflow-samples /swf-booking-jsf/.springBeans
Executable file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beansProjectDescription>
|
||||
<configExtensions>
|
||||
<configExtension>xml</configExtension>
|
||||
</configExtensions>
|
||||
<configs>
|
||||
<config>src/main/webapp/WEB-INF/webflow-config.xml</config>
|
||||
</configs>
|
||||
<configSets>
|
||||
<configSet>
|
||||
<name><![CDATA[webapp]]></name>
|
||||
<allowBeanDefinitionOverriding>true</allowBeanDefinitionOverriding>
|
||||
<incomplete>false</incomplete>
|
||||
<configs>
|
||||
<config>src/main/webapp/WEB-INF/webflow-config.xml</config>
|
||||
</configs>
|
||||
</configSet>
|
||||
</configSets>
|
||||
</beansProjectDescription>
|
||||
9
spring-webflow-samples /swf-booking-jsf/.springWebflow
Executable file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<webflow-project-description>
|
||||
<configs>
|
||||
<config>
|
||||
<file>src/main/webapp/WEB-INF/flows/booking-flow.xml</file>
|
||||
<name><![CDATA[booking-flow]]></name>
|
||||
</config>
|
||||
</configs>
|
||||
</webflow-project-description>
|
||||
16
spring-webflow-samples /swf-booking-jsf/build.xml
Executable 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>
|
||||
9
spring-webflow-samples /swf-booking-jsf/hibernate.cfg.xml
Executable 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>
|
||||
46
spring-webflow-samples /swf-booking-jsf/ivy.xml
Executable file
@@ -0,0 +1,46 @@
|
||||
<ivy-module version="1.1">
|
||||
|
||||
<info organisation="org.springframework" module="swf-sellitem-jsf"/>
|
||||
|
||||
<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.springframework" name="spring-webflow" rev="latest.integration" conf="global->default,jsf"/>
|
||||
<dependency org="org.springframework" name="spring-aop" rev="2.0.6"/>
|
||||
<dependency org="org.springframework" name="spring-dao" rev="2.0.6"/>
|
||||
<dependency org="org.springframework" name="spring-jdbc" rev="2.0.6"/>
|
||||
<dependency org="org.springframework" name="spring-hibernate3" rev="2.0.6"/>
|
||||
<dependency org="org.hibernate" name="hibernate" rev="3.2.4.ga" />
|
||||
<dependency org="org.hibernate" name="hibernate-tools" rev="3.2.0.beta9a" />
|
||||
<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="concurrent" name="concurrent" rev="1.3.4"/>
|
||||
<dependency org="javax.persistence" name="persistence-api" rev="1.0b"/>
|
||||
<dependency org="toplink.essentials" name="toplink-essentials" rev="2.0-56"/>
|
||||
<dependency org="org.springframework" name="spring-jpa" rev="2.0.6"/>
|
||||
<dependency org="commons-digester" name="commons-digester" rev="1.8"/> <!-- MyFaces 1.2 dependency? -->
|
||||
<dependency org="commons-codec" name="commons-codec" rev="1.3"/> <!-- MyFaces 1.2 dependency? -->
|
||||
<dependency org="commons-discovery" name="commons-discovery" rev="0.4"/> <!-- MyFaces 1.2 dependency? -->
|
||||
<dependency org="commons-collections" name="commons-collections" rev="3.2"/> <!-- MyFaces 1.2 dependency? -->
|
||||
<dependency org="com.sun.facelets" name="jsf-facelets" rev="1.1.13"/>
|
||||
<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"/>
|
||||
|
||||
<!-- 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"/>
|
||||
</dependencies>
|
||||
|
||||
</ivy-module>
|
||||
10
spring-webflow-samples /swf-booking-jsf/project.properties
Executable 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
|
||||
33
spring-webflow-samples /swf-booking-jsf/src/etc/filter.properties
Executable 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:
|
||||
@@ -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
|
||||
@@ -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.User</class>
|
||||
<class>org.springframework.webflow.samples.booking.Booking</class>
|
||||
<class>org.springframework.webflow.samples.booking.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>
|
||||
22
spring-webflow-samples /swf-booking-jsf/src/main/java/import.sql
Executable file
@@ -0,0 +1,22 @@
|
||||
insert into Customer (username, password, name) values ('jeremy', 'barfoo', 'Jeremy Grelle')
|
||||
insert into Customer (username, password, name) values ('demo', 'demo', 'Demo User')
|
||||
insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
|
||||
insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
|
||||
insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
|
||||
insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
|
||||
insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
|
||||
insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 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')
|
||||
@@ -0,0 +1,176 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
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.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
//import org.hibernate.validator.Length;
|
||||
//import org.hibernate.validator.NotNull;
|
||||
//import org.hibernate.validator.Pattern;
|
||||
|
||||
@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
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
@Basic
|
||||
@Temporal(TemporalType.DATE)
|
||||
public Date getCheckinDate() {
|
||||
return checkinDate;
|
||||
}
|
||||
|
||||
public void setCheckinDate(Date datetime) {
|
||||
this.checkinDate = datetime;
|
||||
}
|
||||
|
||||
@ManyToOne
|
||||
// @NotNull
|
||||
public Hotel getHotel() {
|
||||
return hotel;
|
||||
}
|
||||
|
||||
public void setHotel(Hotel hotel) {
|
||||
this.hotel = hotel;
|
||||
}
|
||||
|
||||
@ManyToOne
|
||||
// @NotNull
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
@Basic
|
||||
@Temporal(TemporalType.DATE)
|
||||
// @NotNull
|
||||
public Date getCheckoutDate() {
|
||||
return checkoutDate;
|
||||
}
|
||||
|
||||
public void setCheckoutDate(Date checkoutDate) {
|
||||
this.checkoutDate = checkoutDate;
|
||||
}
|
||||
|
||||
// @NotNull(message="Credit card number is required")
|
||||
// @Length(min=16, max=16, message="Credit card number must 16 digits long")
|
||||
// @Pattern(regex="^\\d*$", message="Credit card number must be numeric")
|
||||
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;
|
||||
}
|
||||
|
||||
// @NotNull(message="Credit card name is required")
|
||||
// @Length(min=3, max=70, message="Credit card name is required")
|
||||
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 + ")";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BookingService {
|
||||
|
||||
public List<Booking> findBookings(User user);
|
||||
|
||||
public List<Hotel> findHotels(String searchString, int pageSize, int page);
|
||||
|
||||
public Hotel readHotelById(Long id);
|
||||
|
||||
public Booking bookHotel(Hotel hotel, User user);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import javax.faces.event.PhaseEvent;
|
||||
import javax.faces.event.PhaseId;
|
||||
import javax.faces.event.PhaseListener;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class DebuggingPhaseListener implements PhaseListener {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
Log logger = LogFactory.getLog(DebuggingPhaseListener.class);
|
||||
|
||||
public void afterPhase(PhaseEvent event) {
|
||||
// No-op
|
||||
|
||||
}
|
||||
|
||||
public void beforePhase(PhaseEvent event) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Entering JSF Phase: " + event.getPhaseId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public PhaseId getPhaseId() {
|
||||
return PhaseId.ANY_PHASE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
||||
//import org.hibernate.validator.Length;
|
||||
//import org.hibernate.validator.NotNull;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
// @Length(max=50) @NotNull
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
// @Length(max=100) @NotNull
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
// @Length(max=40) @NotNull
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
// @Length(min=4, max=6) @NotNull
|
||||
public String getZip() {
|
||||
return zip;
|
||||
}
|
||||
|
||||
public void setZip(String zip) {
|
||||
this.zip = zip;
|
||||
}
|
||||
|
||||
// @Length(min=2, max=10) @NotNull
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
// @Length(min=2, max=40) @NotNull
|
||||
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 + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.faces.event.ActionEvent;
|
||||
|
||||
public class HotelSearch 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 void nextPageListener(ActionEvent event) {
|
||||
page++;
|
||||
}
|
||||
|
||||
public void prevPageListener(ActionEvent event) {
|
||||
page--;
|
||||
}
|
||||
|
||||
public void findHotelsListener(ActionEvent event) {
|
||||
page = 0;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
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;
|
||||
|
||||
@Repository
|
||||
public class JpaBookingService implements BookingService {
|
||||
|
||||
private EntityManager em;
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Booking> findBookings(User user) {
|
||||
return em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate")
|
||||
.setParameter("username", user.getUsername()).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 readHotelById(Long id) {
|
||||
return em.find(Hotel.class, id);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public Booking bookHotel(Hotel hotel, User user) {
|
||||
Booking booking = new Booking(hotel, user);
|
||||
return booking;
|
||||
}
|
||||
|
||||
@PersistenceContext
|
||||
public void setEntityManager(EntityManager em) {
|
||||
this.em = em;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.springframework.webflow.action.MultiAction;
|
||||
import org.springframework.webflow.execution.Event;
|
||||
import org.springframework.webflow.execution.RequestContext;
|
||||
|
||||
public class SearchAction extends MultiAction {
|
||||
|
||||
BookingService bookingService;
|
||||
|
||||
public Event findHotels(RequestContext context) {
|
||||
HotelSearch search = (HotelSearch) context.getFlowScope().get("hotelSearch");
|
||||
List<Hotel> hotels = bookingService
|
||||
.findHotels(search.getSearchString(), search.getPageSize(), search.getPage());
|
||||
if (hotels != null) {
|
||||
SerializableListDataModel model = new SerializableListDataModel(hotels);
|
||||
int test = model.getRowCount();
|
||||
context.getFlowScope().put("hotels", new SerializableListDataModel(hotels));
|
||||
} else {
|
||||
context.getFlowScope().put("hotels", null);
|
||||
}
|
||||
return success();
|
||||
}
|
||||
|
||||
public Event findBookings(RequestContext context) {
|
||||
User user = (User) context.getConversationScope().get("user");
|
||||
List<Booking> bookings = bookingService.findBookings(user);
|
||||
if (bookings != null) {
|
||||
context.getFlowScope().put("bookings", new SerializableListDataModel(bookings));
|
||||
} else {
|
||||
context.getFlowScope().put("bookings", null);
|
||||
}
|
||||
return success();
|
||||
}
|
||||
|
||||
public String nextPage() {
|
||||
HotelSearch search = (HotelSearch) FacesContext.getCurrentInstance().getApplication().getVariableResolver()
|
||||
.resolveVariable(FacesContext.getCurrentInstance(), "hotelSearch");
|
||||
|
||||
search.setPage(search.getPage() + 1);
|
||||
|
||||
return "findHotels";
|
||||
}
|
||||
|
||||
public void setBookingService(BookingService bookingService) {
|
||||
this.bookingService = bookingService;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.model.DataModel;
|
||||
import javax.faces.model.DataModelEvent;
|
||||
import javax.faces.model.DataModelListener;
|
||||
|
||||
public class SerializableListDataModel extends DataModel implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int _rowIndex = -1;
|
||||
|
||||
private List _data;
|
||||
|
||||
public SerializableListDataModel() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SerializableListDataModel(List list) {
|
||||
if (list == null)
|
||||
throw new NullPointerException("list");
|
||||
setWrappedData(list);
|
||||
}
|
||||
|
||||
public int getRowCount() {
|
||||
if (_data == null) {
|
||||
return -1;
|
||||
}
|
||||
return _data.size();
|
||||
}
|
||||
|
||||
public Object getRowData() {
|
||||
if (_data == null) {
|
||||
return null;
|
||||
}
|
||||
if (!isRowAvailable()) {
|
||||
throw new IllegalArgumentException("row is unavailable");
|
||||
}
|
||||
return _data.get(_rowIndex);
|
||||
}
|
||||
|
||||
public int getRowIndex() {
|
||||
return _rowIndex;
|
||||
}
|
||||
|
||||
public Object getWrappedData() {
|
||||
return _data;
|
||||
}
|
||||
|
||||
public boolean isRowAvailable() {
|
||||
if (_data == null) {
|
||||
return false;
|
||||
}
|
||||
return _rowIndex >= 0 && _rowIndex < _data.size();
|
||||
}
|
||||
|
||||
public void setRowIndex(int rowIndex) {
|
||||
if (rowIndex < -1) {
|
||||
throw new IllegalArgumentException("illegal rowIndex " + rowIndex);
|
||||
}
|
||||
int oldRowIndex = _rowIndex;
|
||||
_rowIndex = rowIndex;
|
||||
if (_data != null && oldRowIndex != _rowIndex) {
|
||||
Object data = isRowAvailable() ? getRowData() : null;
|
||||
DataModelEvent event = new DataModelEvent(this, _rowIndex, data);
|
||||
DataModelListener[] listeners = getDataModelListeners();
|
||||
for (int i = 0; i < listeners.length; i++) {
|
||||
listeners[i].rowSelected(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setWrappedData(Object data) {
|
||||
_data = (List) data;
|
||||
int rowIndex = _data != null ? 0 : -1;
|
||||
setRowIndex(rowIndex);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
//import org.hibernate.validator.Length;
|
||||
//import org.hibernate.validator.NotNull;
|
||||
//import org.hibernate.validator.Pattern;
|
||||
|
||||
@Entity
|
||||
@Table(name = "Customer")
|
||||
public class User implements Serializable {
|
||||
private String username;
|
||||
private String password;
|
||||
private String name;
|
||||
|
||||
public User(String name, String password, String username) {
|
||||
this.name = name;
|
||||
this.password = password;
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Length(max = 100)
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Length(min = 5, max = 15)
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Id
|
||||
// @Length(min = 5, max = 15)
|
||||
// @Pattern(regex = "^\\w*$", message = "not a valid username")
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User(" + username + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.springframework.webflow.action.AbstractAction;
|
||||
import org.springframework.webflow.execution.Event;
|
||||
import org.springframework.webflow.execution.RequestContext;
|
||||
|
||||
public class ValidateBookingAction extends AbstractAction {
|
||||
|
||||
@Override
|
||||
protected Event doExecute(RequestContext context) throws Exception {
|
||||
Booking booking = (Booking) context.getFlowScope().get("booking");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
if (booking.getCheckinDate().before(calendar.getTime())) {
|
||||
FacesContext.getCurrentInstance().addMessage("checkinDate",
|
||||
new FacesMessage(FacesMessage.SEVERITY_ERROR, "Check in date must be a future date", ""));
|
||||
return error();
|
||||
} else if (!booking.getCheckinDate().before(booking.getCheckoutDate())) {
|
||||
FacesContext.getCurrentInstance()
|
||||
.addMessage(
|
||||
"checkoutDate",
|
||||
new FacesMessage(FacesMessage.SEVERITY_ERROR,
|
||||
"Check out date must be later than check in date", ""));
|
||||
return error();
|
||||
}
|
||||
return success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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">
|
||||
|
||||
<bean
|
||||
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
|
||||
<bean
|
||||
class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
|
||||
|
||||
<bean id="jpaConversationListener" class="org.springframework.webflow.support.persistence.JpaFlowExecutionListener">
|
||||
<constructor-arg>
|
||||
<ref bean="entityManagerFactory"/>
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<ref bean="txManager"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<tx:annotation-driven transaction-manager="txManager"/>
|
||||
|
||||
<bean id="bookingService"
|
||||
class="org.springframework.webflow.samples.booking.JpaBookingService" />
|
||||
|
||||
<bean id="entityManagerFactory"
|
||||
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
|
||||
<property name="dataSource" ref="inMemoryDataSource" />
|
||||
</bean>
|
||||
|
||||
<bean id="inMemoryDataSource"
|
||||
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>
|
||||
|
||||
<bean id="txManager"
|
||||
class="org.springframework.orm.jpa.JpaTransactionManager">
|
||||
<property name="entityManagerFactory" ref="entityManagerFactory" />
|
||||
</bean>
|
||||
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,276 @@
|
||||
package org.springframework.webflow.samples.booking.testdb;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
||||
|
||||
/**
|
||||
* A factory that creates a data source fit for use in a system test environment. Creates a simple data source that
|
||||
* connects to an in-memory database pre-loaded with test data.
|
||||
*
|
||||
* This factory returns a fully-initialized DataSource implementation. When the DataSource is returned, callers are
|
||||
* guaranteed that the database schema and test data will have been loaded by that time.
|
||||
*
|
||||
* Is a FactoryBean, for exposing the fully-initialized test DataSource as a Spring bean. See {@link #getObject()}.
|
||||
*
|
||||
* Is an InitializingBean, for receiving an initialization callback when deployed as a Spring bean. See
|
||||
* {@link #afterPropertiesSet()}.
|
||||
*/
|
||||
public class TestDataSourceFactory implements FactoryBean, InitializingBean {
|
||||
|
||||
private static Log logger = LogFactory.getLog(TestDataSourceFactory.class);
|
||||
|
||||
// configurable properties
|
||||
|
||||
private String testDatabaseName;
|
||||
|
||||
private Resource schemaLocation;
|
||||
|
||||
private Resource testDataLocation;
|
||||
|
||||
/**
|
||||
* The object created by this factory.
|
||||
*/
|
||||
private DataSource dataSource;
|
||||
|
||||
/**
|
||||
* Creates a new TestDataSourceFactory for use in "bean" style. "Bean" style means the default constructor is called
|
||||
* and then properties are set to configure this object. "Bean" style usage is nice when this object is defined as a
|
||||
* Spring bean, as setter-injection can be more descriptive than constructor-injection from the point of view of a
|
||||
* bean definition author.
|
||||
* @see {@link #setTestDatabaseName(String)}
|
||||
* @see {@link #setSchemaLocation(Resource)}
|
||||
* @see {@link #setTestDataLocation(Resource)}
|
||||
*/
|
||||
public TestDataSourceFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TestDataSourceFactory fully-initialized with what it needs to work. Fully-formed constructors are
|
||||
* nice in a programmatic environment, as they result in more concise code and allow for a class to enforce its
|
||||
* required properties.
|
||||
* @param testDatabaseName the name of the test database to create
|
||||
* @param schemaLocation the location of the file containing the schema DDL to export to the database
|
||||
* @param testDataLocation the location of the file containing the test data to load into the database
|
||||
*/
|
||||
public TestDataSourceFactory(String testDatabaseName, Resource schemaLocation, Resource testDataLocation) {
|
||||
setTestDatabaseName(testDatabaseName);
|
||||
setSchemaLocation(schemaLocation);
|
||||
setTestDataLocation(testDataLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of the test database to create.
|
||||
* @param testDatabaseName the name of the test database, i.e. "rewards"
|
||||
*/
|
||||
public void setTestDatabaseName(String testDatabaseName) {
|
||||
this.testDatabaseName = testDatabaseName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location of the file containing the schema DDL to export to the test database.
|
||||
* @param schemaLocation the location of the database schema DDL
|
||||
*/
|
||||
public void setSchemaLocation(Resource schemaLocation) {
|
||||
this.schemaLocation = schemaLocation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location of the file containing the test data to load into the database.
|
||||
* @param testDataLocation the location of the test data file
|
||||
*/
|
||||
public void setTestDataLocation(Resource testDataLocation) {
|
||||
this.testDataLocation = testDataLocation;
|
||||
}
|
||||
|
||||
// implementing InitializingBean
|
||||
|
||||
// this method is automatically called by Spring after configuration to perform a dependency check and init
|
||||
public void afterPropertiesSet() {
|
||||
if (testDatabaseName == null) {
|
||||
throw new IllegalArgumentException("The name of the test database to create is required");
|
||||
}
|
||||
if (schemaLocation == null) {
|
||||
throw new IllegalArgumentException("The path to the database schema DDL is required");
|
||||
}
|
||||
if (testDataLocation == null) {
|
||||
throw new IllegalArgumentException("The path to the test data set is required");
|
||||
}
|
||||
initDataSource();
|
||||
}
|
||||
|
||||
// implementing FactoryBean
|
||||
|
||||
// this method is automatically called by Spring to expose the DataSource as a bean
|
||||
public Object getObject() throws Exception {
|
||||
return getDataSource();
|
||||
}
|
||||
|
||||
public Class getObjectType() {
|
||||
return DataSource.class;
|
||||
}
|
||||
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// other methods
|
||||
|
||||
/**
|
||||
* Factory method that returns the fully-initialized test data source. Useful when this class is used
|
||||
* programatically instead of deployed as a Spring bean.
|
||||
* @return the data source
|
||||
*/
|
||||
public DataSource getDataSource() {
|
||||
if (dataSource == null) {
|
||||
initDataSource();
|
||||
}
|
||||
return dataSource;
|
||||
}
|
||||
|
||||
// static factory methods
|
||||
|
||||
/**
|
||||
* Static factory method that creates a DataSource that connects to a test database populated with test data.
|
||||
* @param testDatabaseName the name of the test database to create
|
||||
* @param schemaLocation the database schema to export
|
||||
* @param testDataLocation the database test data to load
|
||||
* @return the data source
|
||||
*/
|
||||
public static DataSource createDataSource(String testDatabaseName, Resource schemaLocation,
|
||||
Resource testDataLocation) {
|
||||
return new TestDataSourceFactory(testDatabaseName, schemaLocation, testDataLocation).getDataSource();
|
||||
}
|
||||
|
||||
// internal helper methods
|
||||
|
||||
// encapsulates the steps involved in initializing the data source: creating it, and populating it
|
||||
private void initDataSource() {
|
||||
// create the in-memory database source first
|
||||
this.dataSource = createDataSource();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Created in-memory test database '" + testDatabaseName + "'");
|
||||
}
|
||||
// now populate the database by loading the schema and test data
|
||||
populateDataSource();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Exported schema in " + schemaLocation);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Loaded test data in " + testDataLocation);
|
||||
}
|
||||
}
|
||||
|
||||
private DataSource createDataSource() {
|
||||
DriverManagerDataSource dataSource = new DriverManagerDataSource();
|
||||
// use the HsqlDB JDBC driver
|
||||
dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
|
||||
// have it create an in-memory database
|
||||
dataSource.setUrl("jdbc:hsqldb:mem:" + testDatabaseName);
|
||||
dataSource.setUsername("sa");
|
||||
dataSource.setPassword("");
|
||||
return dataSource;
|
||||
}
|
||||
|
||||
private void populateDataSource() {
|
||||
TestDatabasePopulator populator = new TestDatabasePopulator(dataSource);
|
||||
populator.populate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates a in memory data source with test data.
|
||||
*/
|
||||
private class TestDatabasePopulator {
|
||||
|
||||
private DataSource dataSource;
|
||||
|
||||
/**
|
||||
* Creates a new test database populator.
|
||||
* @param dataSource the test data source that will be populated.
|
||||
*/
|
||||
public TestDatabasePopulator(DataSource dataSource) {
|
||||
this.dataSource = dataSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the test database by creating the database schema from 'schema.sql' and inserting the test data in
|
||||
* 'testdata.sql'.
|
||||
*/
|
||||
public void populate() {
|
||||
Connection connection = null;
|
||||
try {
|
||||
connection = dataSource.getConnection();
|
||||
createDatabaseSchema(connection);
|
||||
insertTestData(connection);
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException("SQL exception occurred acquiring connection", e);
|
||||
} finally {
|
||||
if (connection != null) {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (SQLException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// create the application's database schema (tables, indexes, etc.)
|
||||
private void createDatabaseSchema(Connection connection) {
|
||||
try {
|
||||
String sql = parseSqlIn(schemaLocation);
|
||||
executeSql(sql, connection);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("I/O exception occurred accessing the database schema file", e);
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException("SQL exception occurred exporting database schema", e);
|
||||
}
|
||||
}
|
||||
|
||||
// populate the tables with test data
|
||||
private void insertTestData(Connection connection) {
|
||||
try {
|
||||
String sql = parseSqlIn(testDataLocation);
|
||||
executeSql(sql, connection);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("I/O exception occurred accessing the test data file", e);
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException("SQL exception occurred loading test data", e);
|
||||
}
|
||||
}
|
||||
|
||||
// utility method to read a .sql txt input stream
|
||||
private String parseSqlIn(Resource resource) throws IOException {
|
||||
InputStream is = null;
|
||||
try {
|
||||
is = resource.getInputStream();
|
||||
Reader reader = new InputStreamReader(is);
|
||||
char[] cbuf = new char[4096];
|
||||
reader.read(cbuf);
|
||||
return new String(cbuf).trim();
|
||||
} finally {
|
||||
if (is != null) {
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// utility method to run the parsed sql
|
||||
private void executeSql(String sql, Connection connection) throws SQLException {
|
||||
Statement statement = connection.createStatement();
|
||||
statement.execute(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
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.binding=DEBUG
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE faces-config PUBLIC
|
||||
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
|
||||
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
|
||||
|
||||
<faces-config>
|
||||
<application>
|
||||
<navigation-handler>org.springframework.webflow.executor.jsf.FlowNavigationHandler</navigation-handler>
|
||||
<variable-resolver>org.springframework.webflow.executor.jsf.DelegatingFlowVariableResolver</variable-resolver>
|
||||
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
|
||||
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
|
||||
</application>
|
||||
|
||||
<lifecycle>
|
||||
<phase-listener>org.springframework.webflow.samples.booking.DebuggingPhaseListener</phase-listener>
|
||||
<phase-listener>org.springframework.webflow.executor.jsf.FlowPhaseListener</phase-listener>
|
||||
</lifecycle>
|
||||
|
||||
<managed-bean>
|
||||
<managed-bean-name>jsfSearchAction</managed-bean-name>
|
||||
<managed-bean-class>org.springframework.webflow.samples.booking.SearchAction</managed-bean-class>
|
||||
<managed-bean-scope>request</managed-bean-scope>
|
||||
</managed-bean>
|
||||
</faces-config>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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="persistenceContext" value="true"/>
|
||||
|
||||
<input-mapper>
|
||||
<input-attribute name="id" scope="flow"/>
|
||||
</input-mapper>
|
||||
|
||||
<start-state idref="displayHotel"/>
|
||||
|
||||
<!-- NOTE - for some reason leaving off the scope prefix from EL expressions is not working in the subflow -->
|
||||
|
||||
<view-state id="displayHotel" view="/hotel.xhtml">
|
||||
<render-actions>
|
||||
<bean-action bean="bookingService" method="readHotelById">
|
||||
<method-arguments>
|
||||
<argument expression="flowScope.id"/>
|
||||
</method-arguments>
|
||||
<method-result name="hotel" scope="flow"/>
|
||||
</bean-action>
|
||||
</render-actions>
|
||||
<transition on="bookHotel" to="bookHotel"/>
|
||||
<transition on="cancel" to="cancel"/>
|
||||
</view-state>
|
||||
|
||||
<action-state id="bookHotel">
|
||||
<bean-action bean="bookingService" method="bookHotel">
|
||||
<method-arguments>
|
||||
<argument expression="flowScope.hotel"/>
|
||||
<argument expression="conversationScope.user"/>
|
||||
</method-arguments>
|
||||
<method-result name="booking" scope="flow"/>
|
||||
</bean-action>
|
||||
<transition to="enterBookingDetails"/>
|
||||
</action-state>
|
||||
|
||||
<view-state id="enterBookingDetails" view="/book.xhtml">
|
||||
<transition on="reviewDetails" to="validateBooking"/>
|
||||
<transition on="cancel" to="cancel"/>
|
||||
</view-state>
|
||||
|
||||
<action-state id="validateBooking">
|
||||
<action bean="validateBookingAction"/>
|
||||
<transition on="success" to="confirmBooking"/>
|
||||
<transition on="error" to="enterBookingDetails"/>
|
||||
</action-state>
|
||||
|
||||
<view-state id="confirmBooking" view="/confirm.xhtml">
|
||||
<transition on="confirm" to="completeBooking"/>
|
||||
<transition on="revise" to="enterBookingDetails"/>
|
||||
<transition on="cancel" to="cancel"/>
|
||||
</view-state>
|
||||
|
||||
<end-state id="cancel">
|
||||
<attribute name="commit" value="false" type="boolean"/>
|
||||
</end-state>
|
||||
|
||||
<end-state id="completeBooking">
|
||||
<attribute name="commit" value="true" type="boolean"/>
|
||||
</end-state>
|
||||
|
||||
</flow>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?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">
|
||||
|
||||
<var name="username" class="String" scope="flow"/>
|
||||
|
||||
<var name="password" class="String" scope="flow" />
|
||||
|
||||
<start-state idref="login"/>
|
||||
|
||||
<view-state id="login" view="home.xhtml">
|
||||
<transition to="loggedIn"/>
|
||||
</view-state>
|
||||
|
||||
<end-state id="loggedIn"/>
|
||||
|
||||
</flow>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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">
|
||||
|
||||
<var name="hotelSearch" class="org.springframework.webflow.samples.booking.HotelSearch" scope="flow"/>
|
||||
<var name="user" bean="user"/>
|
||||
|
||||
<start-state idref="findBookings"/>
|
||||
|
||||
<action-state id="findBookings">
|
||||
<action bean="searchAction"/>
|
||||
<transition to="main"/>
|
||||
</action-state>
|
||||
|
||||
<view-state id="main" view="/main.xhtml">
|
||||
<transition on="findHotels" to="findHotels"/>
|
||||
<transition on="selectHotel" to="bookHotel-flow"/>
|
||||
</view-state>
|
||||
|
||||
<action-state id="findHotels">
|
||||
<action bean="searchAction"/>
|
||||
<transition to="main"/>
|
||||
</action-state>
|
||||
|
||||
<subflow-state flow="bookHotel-flow" id="bookHotel-flow">
|
||||
<attribute-mapper>
|
||||
<input-mapper>
|
||||
<mapping source="requestParameters.id" target="id" from="string" to="long"/>
|
||||
</input-mapper>
|
||||
</attribute-mapper>
|
||||
<transition to="findBookings"/>
|
||||
</subflow-state>
|
||||
|
||||
<end-state id="loggedIn"/>
|
||||
|
||||
</flow>
|
||||
73
spring-webflow-samples /swf-booking-jsf/src/main/webapp/WEB-INF/web.xml
Executable file
@@ -0,0 +1,73 @@
|
||||
<?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">
|
||||
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
classpath:org/springframework/webflow/samples/booking/services-config-jpa.xml
|
||||
/WEB-INF/webflow-config.xml
|
||||
</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- Use Documents Saved as *.xhtml -->
|
||||
<context-param>
|
||||
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
|
||||
<param-value>.xhtml</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- Special Debug Output for Development -->
|
||||
<context-param>
|
||||
<param-name>facelets.DEVELOPMENT</param-name>
|
||||
<param-value>true</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- Bootstraps the root Spring Web Application Context, responsible for deploying managed beans
|
||||
defined in the configuration files above. These beans represent the services used by the JSF application. -->
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.springframework.web.context.ContextLoaderListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- Listener for enabling request and session scoped beans in Spring -->
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.springframework.web.context.request.RequestContextListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- Guarantees that under all JSF exit conditions, the flow context will be cleaned up -->
|
||||
<filter>
|
||||
<filter-name>Flow System Cleanup Filter</filter-name>
|
||||
<filter-class>
|
||||
org.springframework.webflow.executor.jsf.FlowSystemCleanupFilter
|
||||
</filter-class>
|
||||
</filter>
|
||||
|
||||
<!-- Filters all request to *.faces to the Flow System Cleanup Filter for guarenteed cleanup -->
|
||||
<filter-mapping>
|
||||
<filter-name>Flow System Cleanup Filter</filter-name>
|
||||
<url-pattern>*.swf</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- The front controller for the JSF application, responsible for handling all application requests -->
|
||||
<servlet>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
<url-pattern>*.swf</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<!-- Map all requests to *.faces to the Faces Servlet for handling -->
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
</web-app>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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:flow="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-1.1.xsd">
|
||||
|
||||
|
||||
<flow:enable-scopes/>
|
||||
|
||||
<bean id="user" class="org.springframework.webflow.samples.booking.User" scope="conversation">
|
||||
<property name="username" value="jeremy"/>
|
||||
<property name="password" value="barfoo"/>
|
||||
<property name="name" value="Jeremy Grelle"/>
|
||||
</bean>
|
||||
|
||||
<bean id="searchAction" class="org.springframework.webflow.samples.booking.SearchAction">
|
||||
<property name="bookingService" ref="bookingService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="validateBookingAction" class="org.springframework.webflow.samples.booking.ValidateBookingAction"/>
|
||||
|
||||
<!-- Launches new flow executions and resumes existing executions -->
|
||||
<flow:executor id="flowExecutor" registry-ref="flowRegistry">
|
||||
<flow:execution-attributes>
|
||||
<flow:alwaysRedirectOnPause value="false"/>
|
||||
</flow:execution-attributes>
|
||||
<flow:execution-listeners>
|
||||
<flow:listener ref="jpaConversationListener"/>
|
||||
</flow:execution-listeners>
|
||||
</flow:executor>
|
||||
|
||||
<!-- Creates the registry of flow definitions for this application -->
|
||||
<bean id="flowRegistry" class="org.springframework.webflow.engine.builder.xml.XmlFlowRegistryFactoryBean">
|
||||
<property name="expressionParser" ref="jsfExpressionParser"/>
|
||||
<property name="flowLocations">
|
||||
<list>
|
||||
<value>/WEB-INF/flows/login-flow.xml</value>
|
||||
<value>/WEB-INF/flows/main-flow.xml</value>
|
||||
<value>/WEB-INF/flows/bookHotel-flow.xml</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="jsfExpressionParser" class="org.springframework.webflow.executor.jsf.Jsf12ELExpressionParser">
|
||||
<constructor-arg >
|
||||
<bean class="org.jboss.el.ExpressionFactoryImpl"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
201
spring-webflow-samples /swf-booking-jsf/src/main/webapp/book.xhtml
Executable file
@@ -0,0 +1,201 @@
|
||||
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:s="http://jboss.com/products/seam/taglib"
|
||||
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
|
||||
template="template.xhtml">
|
||||
|
||||
<!-- content -->
|
||||
<ui:define name="content">
|
||||
<div class="section">
|
||||
<h1>Book Hotel</h1>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h:form id="booking">
|
||||
<h:messages/>
|
||||
<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>
|
||||
|
||||
<s:validateAll>
|
||||
|
||||
<f:facet name="aroundInvalidField">
|
||||
<s:span styleClass="errors"/>
|
||||
</f:facet>
|
||||
<f:facet name="afterInvalidField">
|
||||
<s:div styleClass="errors">
|
||||
<s:message/>
|
||||
</s:div>
|
||||
</f:facet>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="checkinDate">Check In Date:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate id="checkinDateDecorate">
|
||||
<h:inputText id="checkinDate" value="#{booking.checkinDate}" required="true">
|
||||
<f:convertDateTime pattern="MM/dd/yyyy"/>
|
||||
<a:support event="onblur" reRender="checkinDateDecorate"/>
|
||||
</h:inputText>
|
||||
<s:selectDate for="checkinDate">
|
||||
<h:graphicImage url="img/dtpick.gif" style="margin-left:5px;cursor:pointer"/>
|
||||
</s:selectDate>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="checkoutDate">Check Out Date:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate id="checkoutDateDecorate">
|
||||
<h:inputText id="checkoutDate" value="#{booking.checkoutDate}" required="true">
|
||||
<f:convertDateTime pattern="MM/dd/yyyy"/>
|
||||
<a:support event="onblur" reRender="checkoutDateDecorate"/>
|
||||
</h:inputText>
|
||||
<s:selectDate for="checkoutDate">
|
||||
<h:graphicImage url="img/dtpick.gif" style="margin-left:5px;cursor:pointer"/>
|
||||
</s:selectDate>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="beds">Room Preference:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate>
|
||||
<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>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="smoking">Smoking Preference:</h:outputLabel></div>
|
||||
<div id="radio" class="input">
|
||||
<s:decorate>
|
||||
<h:selectOneRadio id="smoking" value="#{booking.smoking}" layout="pageDirection">
|
||||
<f:selectItem itemLabel="Smoking" itemValue="true"/>
|
||||
<f:selectItem itemLabel="Non Smoking" itemValue="false"/>
|
||||
</h:selectOneRadio>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="creditCard">Credit Card #:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate id="creditCardDecorate">
|
||||
<h:inputText id="creditCard" value="#{booking.creditCard}" required="true">
|
||||
<a:support event="onblur" reRender="creditCardDecorate"/>
|
||||
</h:inputText>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="creditCardName">Credit Card Name:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate id="creditCardNameDecorate">
|
||||
<h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true">
|
||||
<a:support event="onblur" reRender="creditCardNameDecorate"/>
|
||||
</h:inputText>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="creditCardExpiryMonth">Credit Card Expiry:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate>
|
||||
<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>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</s:validateAll>
|
||||
|
||||
<div class="entry errors">
|
||||
<h:messages globalOnly="true"/>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"> </div>
|
||||
<div class="input">
|
||||
<h:commandButton id="proceed" value="Proceed" action="reviewDetails"/> 
|
||||
<h:commandButton id="cancel" immediate="true" value="Cancel" action="cancel"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</h:form>
|
||||
</div>
|
||||
</ui:define>
|
||||
|
||||
<!-- sidebar -->
|
||||
<ui:define name="sidebar">
|
||||
|
||||
<h1>Workspace management</h1>
|
||||
<p>
|
||||
As you can see, Seam makes it easy to work in multiple windows or multiple browser
|
||||
tabs. But you can even switch between multiple tasks inside a single browser tab!
|
||||
The "Workspaces" section showcases this advanced feature.
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('exp/workspaceExp.html','exp','width=752,height=500,scrollbars=yes');">
|
||||
How does the workspace list work?
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
89
spring-webflow-samples /swf-booking-jsf/src/main/webapp/confirm.xhtml
Executable file
@@ -0,0 +1,89 @@
|
||||
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:s="http://jboss.com/products/seam/taglib"
|
||||
template="template.xhtml">
|
||||
|
||||
<!-- content -->
|
||||
<ui:define 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"> </div>
|
||||
<div class="input">
|
||||
<h:commandButton id="confirm" value="Confirm" action="confirm"/> 
|
||||
<h:commandButton id="revise" value="Revise" action="revise"/> 
|
||||
<h:commandButton id="cancel" value="Cancel" action="cancel"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</h:form>
|
||||
</div>
|
||||
</ui:define>
|
||||
|
||||
<!-- sidebar -->
|
||||
<ui:define name="sidebar">
|
||||
<h1>Back button navigation</h1>
|
||||
<p>
|
||||
When you click "Confirm", the new booking is written to the database, the
|
||||
conversation ends, and state associated with the conversation is automatically
|
||||
destroyed by Seam. After you confirm your booking, try hitting the back button
|
||||
on your web browser and clicking "Confirm" again. Seam makes it easy implement
|
||||
applications that behave elegantly in response to the back, forward and refresh
|
||||
buttons.
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('exp/confirmExp.html','exp','width=752,height=500,scrollbars=yes');">
|
||||
What happens when the conversation ends?
|
||||
</a>
|
||||
</p>
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
34
spring-webflow-samples /swf-booking-jsf/src/main/webapp/conversations.xhtml
Executable file
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE div PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:c="http://java.sun.com/jstl/core"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:s="http://jboss.com/products/seam/taglib">
|
||||
|
||||
<div class="section">
|
||||
<h1><h:outputText rendered="#{not empty conversationList}" value="Workspaces"/></h1>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h:form>
|
||||
<h:dataTable value="#{conversationList}" var="entry">
|
||||
<h:column>
|
||||
<h:commandLink action="#{entry.select}" value="#{entry.description}"/>
|
||||
 
|
||||
<h:outputText value="[current]" rendered="#{entry.current}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<h:outputText value="#{entry.startDatetime}">
|
||||
<s:convertDateTime type="time" pattern="hh:mm"/>
|
||||
</h:outputText>
|
||||
-
|
||||
<h:outputText value="#{entry.lastDatetime}">
|
||||
<s:convertDateTime type="time" pattern="hh:mm"/>
|
||||
</h:outputText>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
</h:form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
185
spring-webflow-samples /swf-booking-jsf/src/main/webapp/css/date.css
Executable file
@@ -0,0 +1,185 @@
|
||||
div.seam-date
|
||||
{
|
||||
margin-top: 5px;
|
||||
border: 1px solid #AAAAAA;
|
||||
background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
|
||||
background-color: #FFFFFF;
|
||||
color: #505050;
|
||||
font-family: Tahoma, Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
table.seam-date td {
|
||||
font-family: Tahoma, Arial, Helvetica, sans-serif;
|
||||
font-weight: 11px;
|
||||
}
|
||||
|
||||
.seam-date-monthNames
|
||||
{
|
||||
width: 70px;
|
||||
border: 1px solid #dddddd;
|
||||
border-right: 3px solid #444444;
|
||||
border-bottom: 3px solid #444444;
|
||||
background-color: #ffffff;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
font-family: Tahoma, Arial, Helvetica, sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
a.seam-date-monthNameLink, a.seam-date-monthNameLink:visited
|
||||
{
|
||||
text-align: center;
|
||||
display: block;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
a.seam-date-monthNameLink:hover
|
||||
{
|
||||
background-color: #CCCCCC;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.seam-date-years
|
||||
{
|
||||
height: 10em;
|
||||
overflow: auto;
|
||||
width: 60px;
|
||||
border: 1px solid #dddddd;
|
||||
border-right: 3px solid #444444;
|
||||
border-bottom: 3px solid #444444;
|
||||
background-color: #ffffff;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
font-family: Tahoma, Arial, Helvetica, sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
a.seam-date-yearLink, a.seam-date-yearLink:visited
|
||||
{
|
||||
text-align: center;
|
||||
display: block;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
a.seam-date-yearLink:hover
|
||||
{
|
||||
background-color: #CCCCCC;
|
||||
color: red;
|
||||
}
|
||||
|
||||
tr.seam-date-header
|
||||
{
|
||||
padding: 2px 0px 2px 0px;
|
||||
}
|
||||
|
||||
td.seam-date-header
|
||||
{
|
||||
padding: 0px 8px 0px 8px;
|
||||
text-align: center;
|
||||
color: gray;
|
||||
font-family: Tahoma, Arial, Helvetica, sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
td.seam-date-header-prevMonth
|
||||
{
|
||||
background-image: url("../img/cal-prev.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
padding: 0px 2px 0px 2px;
|
||||
width: 17px;
|
||||
height: 16px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
td.seam-date-header-nextMonth
|
||||
{
|
||||
background-image: url("../img/cal-next.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
padding: 0px 2px 0px 2px;
|
||||
width: 17px;
|
||||
height: 16px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
tr.seam-date-headerDays
|
||||
{
|
||||
color: white;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
tr.seam-date-headerDays > td
|
||||
{
|
||||
background-color: #CCCCCC;
|
||||
border: 1px solid #AAAAAA;
|
||||
color: white;
|
||||
text-align: center;
|
||||
width: 26px;
|
||||
}
|
||||
|
||||
tr.seam-date-footer
|
||||
{
|
||||
background-color: white;
|
||||
color: #505050;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
tr.seam-date-footer > td
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
td.seam-date-inMonth
|
||||
{
|
||||
background-color: white;
|
||||
color: black;
|
||||
font-weight: normal;
|
||||
cursor: pointer;
|
||||
border: 1px solid #ece9d8;
|
||||
}
|
||||
|
||||
td.seam-date-outMonth
|
||||
{
|
||||
background-color: white;
|
||||
color: #999999;
|
||||
font-weight: normal;
|
||||
cursor: pointer;
|
||||
border: 1px solid #ece9d8;
|
||||
}
|
||||
|
||||
td.seam-date-selected
|
||||
{
|
||||
background-color: #CCCCCC;
|
||||
border: 1px solid #AAAAAA;
|
||||
color: black;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
td.seam-date-dayOff-inMonth
|
||||
{
|
||||
background-color: #efefef;
|
||||
color: black;
|
||||
font-weight: normal;
|
||||
cursor: pointer;
|
||||
border: 1px solid #ece9d8;
|
||||
}
|
||||
|
||||
td.seam-date-dayOff-outMonth
|
||||
{
|
||||
background-color: #efefef;
|
||||
color: #999999;
|
||||
font-weight: normal;
|
||||
cursor: pointer;
|
||||
border: 1px solid #ece9d8;
|
||||
}
|
||||
|
||||
td.seam-date-hover
|
||||
{
|
||||
background-color: #CCCCCC;
|
||||
border: 1px solid #AAAAAA;
|
||||
cursor: pointer;
|
||||
color: red;
|
||||
}
|
||||
268
spring-webflow-samples /swf-booking-jsf/src/main/webapp/css/screen.css
Executable file
@@ -0,0 +1,268 @@
|
||||
/* 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: #DBD4C6;
|
||||
}
|
||||
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(../img/input.bg.gif) 0 0 repeat-x;
|
||||
}
|
||||
select {
|
||||
border: 1px solid #C3BBB6;
|
||||
padding: 4px;
|
||||
margin: 5px 0;
|
||||
background: #fff url(../img/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(../img/bg.gif) 0 0 repeat-y;
|
||||
float: left;
|
||||
border-bottom: 1px solid #C3BBB6;
|
||||
}
|
||||
#header {
|
||||
float: left;
|
||||
width: 758px;
|
||||
height: 46px;
|
||||
background: url(../img/hdr.bg.gif) 0 0 repeat-x;
|
||||
}
|
||||
#container {
|
||||
float: left;
|
||||
width: 758px;
|
||||
background: url(../img/hdr.bar.jpg) 0 0 repeat-x;
|
||||
}
|
||||
#sidebar {
|
||||
float: left;
|
||||
width: 190px;
|
||||
margin-top: 96px;
|
||||
padding: 20px 10px 0 10px;
|
||||
background: url(../img/sdb.bg.gif) 0 0 no-repeat;
|
||||
}
|
||||
#content {
|
||||
float: left;
|
||||
width: 548px;
|
||||
margin-top: 75px;
|
||||
padding-top: 5px;
|
||||
background: #fff url(../img/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(../img/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-bottom: 10px;
|
||||
}
|
||||
#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 15px;
|
||||
}
|
||||
#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(../img/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: small;
|
||||
}
|
||||
#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;
|
||||
}
|
||||
/* Header
|
||||
----------------------------------------------- */
|
||||
#title {
|
||||
float: left;
|
||||
padding: 1px 0 6px 15px;
|
||||
}
|
||||
#status {
|
||||
color: #C7B299;
|
||||
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: #C7B299;
|
||||
text-decoration: none;
|
||||
}
|
||||
/* Homepage Modifications
|
||||
----------------------------------------------- */
|
||||
#pgHome #container {
|
||||
background: url(../img/hdr.ad.jpg) 0 0 repeat-x;
|
||||
}
|
||||
#pgHome #sidebar {
|
||||
margin-top: 207px;
|
||||
}
|
||||
#pgHome #content {
|
||||
margin-top: 183px;
|
||||
}
|
||||
#pgHome input[type="submit"] {
|
||||
height: 30px;
|
||||
}
|
||||
148
spring-webflow-samples /swf-booking-jsf/src/main/webapp/css/trailblazer_main.css
Executable file
@@ -0,0 +1,148 @@
|
||||
* {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
body {
|
||||
font: 1em verdana, arial, sans-serif;
|
||||
background: #CCCCCC;
|
||||
}
|
||||
|
||||
div#main {
|
||||
margin-left: 0px;
|
||||
width: 751px;
|
||||
background: #ecefdf;
|
||||
}
|
||||
|
||||
div#top,div#pictures{
|
||||
}
|
||||
|
||||
div#pictures img {
|
||||
float:left;
|
||||
}
|
||||
|
||||
img#head1 {
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
img#head2 {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
div.trail {
|
||||
clear:both;
|
||||
margin-left: 50px;
|
||||
margin-top: 0px;
|
||||
margin-right: 50px
|
||||
}
|
||||
|
||||
div.foot {
|
||||
margin-left: 50px;
|
||||
margin-right: 50px;
|
||||
margin-top: 50px;
|
||||
text-align: center;
|
||||
font-size: .5em;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
div.trail h1 {
|
||||
margin-top: -30px;
|
||||
margin-left: -50px;
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
padding-left: .4em;
|
||||
}
|
||||
|
||||
div.trail h2 {
|
||||
float: left;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
padding-left: .4em;
|
||||
}
|
||||
|
||||
div.trail h3 {
|
||||
float: left;
|
||||
font-size: .8em;
|
||||
font-weight: bold;
|
||||
margin-left: -1.4em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
|
||||
div.trail p {
|
||||
clear: both;
|
||||
margin-top: 20px;
|
||||
font-size: .8em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div#next_trail {
|
||||
margin-left: 36px;
|
||||
}
|
||||
|
||||
div.numbox {
|
||||
border: thin solid black;
|
||||
margin-left: -.8em;
|
||||
float: left;
|
||||
background: #ffffff;
|
||||
padding: .2em .35em .3em;
|
||||
font-style: normal;
|
||||
font-weight: bold;
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
div.figure {
|
||||
text-align: center;
|
||||
font-size: .6em;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
div.figure img {
|
||||
display: block;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
code {
|
||||
font: 1.1em "Courier New", Courier, mono;
|
||||
}
|
||||
|
||||
code.block {
|
||||
white-space: pre;
|
||||
font: 10pt "Courier New", Courier, mono;
|
||||
display: block;
|
||||
border-style: dashed;
|
||||
border-width: thin;
|
||||
padding: .5em;
|
||||
background: #ffffff;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
div.foot_image {
|
||||
float: left;
|
||||
height: 86px;
|
||||
}
|
||||
|
||||
a:active {
|
||||
color : #666666;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color : #000000;
|
||||
background-color : #D6E0FE;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:link {
|
||||
color : #005EB6;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color : #888888;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
59
spring-webflow-samples /swf-booking-jsf/src/main/webapp/home.xhtml
Executable file
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:s="http://jboss.com/products/seam/taglib">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>Spring Web Stack: Spring Web Flow + JSF</title>
|
||||
<link href="css/screen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body id="pgHome">
|
||||
<f:view>
|
||||
<div id="document">
|
||||
<div id="header">
|
||||
<div id="title"><img src="images/spring-logo.jpg" alt="Spring Web Stack: Spring Web Flow + JSF Demo"/></div>
|
||||
</div>
|
||||
<div id="container">
|
||||
<div id="sidebar">
|
||||
<h:form id="login">
|
||||
<fieldset>
|
||||
<div>
|
||||
<h:outputLabel for="username">Login Name</h:outputLabel>
|
||||
<h:inputText id="username" value="#{username}" style="width: 175px;"/>
|
||||
<div class="errors"><h:message for="username"/></div>
|
||||
</div>
|
||||
<div>
|
||||
<h:outputLabel for="password">Password</h:outputLabel>
|
||||
<h:inputSecret id="password" value="#{password}" style="width: 175px;"/>
|
||||
</div>
|
||||
<div class="errors"><h:messages globalOnly="true"/></div>
|
||||
<div class="buttonBox"><h:commandButton id="login" action="#{identity.login}" value="Account Login"/></div>
|
||||
<div class="notes"><s:link id="register" view="/register.xhtml" value="Register New User"/></div>
|
||||
</fieldset>
|
||||
</h:form>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="section">
|
||||
|
||||
<h1>About this example application</h1>
|
||||
|
||||
<p>
|
||||
This sample application demonstrates how easy it is to develop stateful web
|
||||
applications using Spring Web Flow. Just register, login, and book a room to see
|
||||
SWF in action.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note: Please do NOT enter personal information or your credit card number in
|
||||
this sample application.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">Created with Spring, Spring Web Flow, MyFaces, and Facelets</div>
|
||||
</div>
|
||||
</f:view>
|
||||
</body>
|
||||
</html>
|
||||
82
spring-webflow-samples /swf-booking-jsf/src/main/webapp/hotel.xhtml
Executable file
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
template="template.xhtml">
|
||||
|
||||
<!-- content -->
|
||||
<ui:define 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="bookHotel" action="bookHotel" value="Book Hotel"/> 
|
||||
<h:commandButton id="cancel" action="cancel" value="Back to Search"/>
|
||||
</fieldset>
|
||||
</h:form>
|
||||
</div>
|
||||
</ui:define>
|
||||
|
||||
<!-- sidebar -->
|
||||
<ui:define name="sidebar">
|
||||
|
||||
<h1>Don't kill your database</h1>
|
||||
<p>
|
||||
Keeping conversational state in memory in the middle tier is a great way to
|
||||
improve your application's scalability. It saves hitting the database every
|
||||
time we refresh a page, to re-read the data we were just looking at five
|
||||
seconds ago. By using Seam's conversation context, we get a natural cache
|
||||
of data associated with the what the user is currently doing. By nature,
|
||||
this cache has a more efficient eviction policy than the MRU-type algorithms
|
||||
used by a typical second-level data cache in an O/R mapping engine like
|
||||
Hibernate (at least for some kinds of data). Of course, you should use
|
||||
a clever combination of second-level caching and conversational data
|
||||
caching to achieve the best performance for your application.
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('exp/bookingExp.html','exp','width=752,height=500,scrollbars=yes');">
|
||||
How does the hotel booking wizard work?
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/images/spring-logo.jpg
Executable file
|
After Width: | Height: | Size: 31 KiB |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/images/webflow-logo.jpg
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/bg.gif
Executable file
|
After Width: | Height: | Size: 163 B |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/btn.bg.gif
Executable file
|
After Width: | Height: | Size: 221 B |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/cal-next.png
Executable file
|
After Width: | Height: | Size: 202 B |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/cal-prev.png
Executable file
|
After Width: | Height: | Size: 204 B |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/cnt.bg.gif
Executable file
|
After Width: | Height: | Size: 110 B |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/dtpick.gif
Executable file
|
After Width: | Height: | Size: 127 B |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/hdr.ad.jpg
Executable file
|
After Width: | Height: | Size: 46 KiB |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/hdr.bar.jpg
Executable file
|
After Width: | Height: | Size: 25 KiB |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/hdr.bg.gif
Executable file
|
After Width: | Height: | Size: 218 B |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/hdr.title.gif
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/header_line.gif
Executable file
|
After Width: | Height: | Size: 571 B |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/input.bg.gif
Executable file
|
After Width: | Height: | Size: 122 B |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/sdb.bg.gif
Executable file
|
After Width: | Height: | Size: 618 B |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/spinner.gif
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
spring-webflow-samples /swf-booking-jsf/src/main/webapp/img/th.bg.gif
Executable file
|
After Width: | Height: | Size: 152 B |
5
spring-webflow-samples /swf-booking-jsf/src/main/webapp/index.html
Executable file
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Refresh" content="0; URL=intro.swf">
|
||||
</head>
|
||||
</html>
|
||||
41
spring-webflow-samples /swf-booking-jsf/src/main/webapp/intro.xhtml
Executable file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:h="http://java.sun.com/jsf/html">
|
||||
|
||||
<body>
|
||||
|
||||
<f:view>
|
||||
<div align="left">Booking SWF + JSF - A Spring Web Flow Sample</div>
|
||||
<hr/>
|
||||
<div align="left">
|
||||
<p>
|
||||
<h:form>
|
||||
<h:commandLink value="Book Hotels" action="flowId:main-flow"/> (launch with a JSF command link)
|
||||
</h:form>
|
||||
</p>
|
||||
<p>
|
||||
<a href="controller.faces?_flowId=main-flow">Book Hotels</a> (launch with a regular anchor tag)
|
||||
</p>
|
||||
<p>
|
||||
This Spring Web Flow sample application is the JSF-based version of the familiar "Sell item" sample.
|
||||
It illustrates the following concepts:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Using Spring Web Flow with JSF</li>
|
||||
<li>Implementing a wizard using web flows.</li>
|
||||
<li>Use of conversation scope.</li>
|
||||
<li>Using expressions to apply dynamic flow navigation rules</li>
|
||||
<li>Using continuations to make the flow completely stable, no matter how browser navigation buttons are used.</li>
|
||||
<li>"Always redirect on pause" to benefit from the POST+REDIRECT+GET pattern with no special coding.</li>
|
||||
<li>
|
||||
Using "conversation invalidation after completion" to prevent duplicate submits of the same sale
|
||||
while taking advantage of continuations to allow back button usage while the application transaction is in process.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<hr/>
|
||||
</f:view>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
140
spring-webflow-samples /swf-booking-jsf/src/main/webapp/main.xhtml
Executable file
@@ -0,0 +1,140 @@
|
||||
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:s="http://jboss.com/products/seam/taglib"
|
||||
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
|
||||
template="template.xhtml">
|
||||
|
||||
<!-- content -->
|
||||
<ui:define name="content">
|
||||
<h:form id="main">
|
||||
<div class="section">
|
||||
|
||||
|
||||
<span class="errors">
|
||||
<h:messages/>
|
||||
</span>
|
||||
|
||||
<h1>Search Hotels</h1>
|
||||
<fieldset>
|
||||
<h:inputText id="searchString" value="#{hotelSearch.searchString}" style="width: 165px;"/>
|
||||
|
||||
 
|
||||
<h:commandButton id="findHotels" value="Find Hotels" actionListener="#{hotelSearch.findHotelsListener}"
|
||||
action="findHotels" reRender="searchResults"/>
|
||||
 
|
||||
<a:status>
|
||||
<f:facet name="start">
|
||||
<h:graphicImage value="/img/spinner.gif"/>
|
||||
</f:facet>
|
||||
</a:status>
|
||||
<br/>
|
||||
<h:outputLabel for="pageSize">Maximum results:</h:outputLabel> 
|
||||
<h:selectOneMenu value="#{hotelSearch.pageSize}" id="pageSize">
|
||||
<f:selectItem itemLabel="5" itemValue="5"/>
|
||||
<f:selectItem itemLabel="10" itemValue="10"/>
|
||||
<f:selectItem itemLabel="20" itemValue="20"/>
|
||||
</h:selectOneMenu>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h:outputText value="No Hotels Found" rendered="#{hotels.rowCount==0}"/>
|
||||
<h:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
|
||||
<h:column>
|
||||
<f:facet name="header">Name</f:facet>
|
||||
#{hot.name}
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Address</f:facet>
|
||||
#{hot.address}
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">City, State</f:facet>
|
||||
#{hot.city}, #{hot.state}, #{hot.country}
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Zip</f:facet>
|
||||
#{hot.zip}
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Action</f:facet>
|
||||
<h:commandLink id="viewHotelLink" value="View Hotel" action="selectHotel">
|
||||
<f:param name="id" value="#{hot.id}"/>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
<h:commandLink id="prevPageLink" value="Previous results" actionListener="#{hotelSearch.prevPageListener}"
|
||||
action="findHotels" rendered="#{hotelSearch.page > 0}"/>
|
||||
<h:commandLink id="nextPageLink" value="More results" actionListener="#{hotelSearch.nextPageListener}"
|
||||
action="findHotels" rendered="#{hotels != null and hotels.rowCount == hotelSearch.pageSize}"/>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h1>Current Hotel Bookings</h1>
|
||||
</div>
|
||||
<div class="section">
|
||||
|
||||
<h:outputText value="No Bookings Found" rendered="#{bookings.rowCount==0}"/>
|
||||
<h:dataTable id="bookings" value="#{bookings}" var="book" rendered="#{bookings.rowCount>0}">
|
||||
<h:column>
|
||||
<f:facet name="header">Name</f:facet>
|
||||
#{book.hotel.name}
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Address</f:facet>
|
||||
#{book.hotel.address}
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">City, State</f:facet>
|
||||
#{book.hotel.city}, #{book.hotel.state}
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Check in date</f:facet>
|
||||
<h:outputText value="#{book.checkinDate}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Check out date</f:facet>
|
||||
<h:outputText value="#{book.checkoutDate}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Confirmation number</f:facet>
|
||||
#{book.id}
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Action</f:facet>
|
||||
<h:commandLink id="cancel" value="Cancel" action="cancelBooking"/>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
</div>
|
||||
|
||||
</h:form>
|
||||
|
||||
</ui:define>
|
||||
|
||||
<!-- sidebar -->
|
||||
<ui:define name="sidebar">
|
||||
|
||||
<h1>State management in Seam</h1>
|
||||
<p>
|
||||
State in Seam is <em>contextual</em>. When you click "Find Hotels", the application
|
||||
retrieves a list of hotels from the database and caches it in the session context. When you
|
||||
navigate to one of the hotel records by clicking the "View Hotel" link, a <em>conversation</em>
|
||||
begins. The conversation is attached to a particular tab, in a particular browser window. You can
|
||||
navigate to multiple hotels using "open in new tab" or "open in new window" in your web browser.
|
||||
Each window will execute in the context of a different conversation. The application keeps state
|
||||
associated with your hotel booking in the conversation context, which ensures that the concurrent
|
||||
conversations do not interfere with each other.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="#" onclick="window.open('exp/mainExp.html','exp','width=752,height=500,scrollbars=yes');">
|
||||
How does the search page work?
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
81
spring-webflow-samples /swf-booking-jsf/src/main/webapp/password.xhtml
Executable file
@@ -0,0 +1,81 @@
|
||||
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:s="http://jboss.com/products/seam/taglib"
|
||||
template="template.xhtml">
|
||||
|
||||
<!-- content -->
|
||||
<ui:define name="content">
|
||||
<div class="section">
|
||||
<h1>Change Your Password</h1>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h:form id="setpassword">
|
||||
|
||||
<f:facet name="aroundInvalidField">
|
||||
<s:span styleClass="errors"/>
|
||||
</f:facet>
|
||||
<f:facet name="afterInvalidField">
|
||||
<s:div styleClass="errors">
|
||||
<s:message/>
|
||||
</s:div>
|
||||
</f:facet>
|
||||
|
||||
<fieldset>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="password">Password:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate>
|
||||
<h:inputSecret id="password" value="#{user.password}" required="true">
|
||||
<s:validate/>
|
||||
</h:inputSecret>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="verify">Verify:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate>
|
||||
<h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry errors">
|
||||
<h:messages globalOnly="true"/>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"> </div>
|
||||
<div class="input">
|
||||
<h:commandButton id="change" value="Change" action="#{changePassword.changePassword}"/> 
|
||||
<s:button id="cancel" value="Cancel" view="/main.xhtml"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
</h:form>
|
||||
</div>
|
||||
</ui:define>
|
||||
|
||||
<!-- sidebar -->
|
||||
<ui:define name="sidebar">
|
||||
<h1>Simple things should be easy</h1>
|
||||
<p>
|
||||
(And so should some complex things.) You shouldn't have to write four different classes
|
||||
just to change a password. Traditional J2EE architectures require that developers spend
|
||||
more time writing code to make the frameworks happy, than they ever get to spend writing
|
||||
code to make the user happy. Seam lets you reduce the size of your code dramatically.
|
||||
And that reduces bugs. And it makes refactoring easier. And it makes delivering new
|
||||
functionality quicker. Productivity matters. But with Seam, JSF, EJB 3.0 and jBPM, you
|
||||
don't need to sacrifice the ability to handle complex problems just to achieve great
|
||||
productivity.
|
||||
</p>
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
119
spring-webflow-samples /swf-booking-jsf/src/main/webapp/register.xhtml
Executable file
@@ -0,0 +1,119 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:s="http://jboss.com/products/seam/taglib"
|
||||
xmlns:a="https://ajax4jsf.dev.java.net/ajax">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>JBoss Suites: Seam Framework</title>
|
||||
<link href="css/screen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body id="pgHome">
|
||||
<div id="document">
|
||||
<div id="header">
|
||||
<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
|
||||
</div>
|
||||
<div id="container">
|
||||
<div id="sidebar">
|
||||
<h1>Integrated multi-layer validation</h1>
|
||||
<p>
|
||||
Robust applications need data validation in several different places. Seam integrates Hibernate Validator,
|
||||
a set of annotations for expressing data model constraints in your domain model classes. Then, these
|
||||
constraints are applied almost completely transparently at three levels of the application: by Seam when
|
||||
the user first enters data, by EJB before persisting data to the database, and, if you use Hibernate to
|
||||
generate your database schema, by the database constraints themselves. Multi-layer validation hardens
|
||||
your application and protects your data. Even better, it's self-documenting, and easy to change when
|
||||
your business rules change.
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('exp/registerExp.html','exp','width=752,height=500,scrollbars=yes');">
|
||||
What happens when I register?
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="section">
|
||||
<h1>Register</h1>
|
||||
</div>
|
||||
<div class="section">
|
||||
|
||||
<h:form id="register">
|
||||
<fieldset>
|
||||
|
||||
<s:validateAll>
|
||||
|
||||
<f:facet name="aroundInvalidField">
|
||||
<s:span styleClass="errors"/>
|
||||
</f:facet>
|
||||
<f:facet name="afterInvalidField">
|
||||
<s:div styleClass="errors">
|
||||
<s:message/>
|
||||
</s:div>
|
||||
</f:facet>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="username">Username:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate id="usernameDecorate">
|
||||
<h:inputText id="username" value="#{user.username}" required="true">
|
||||
<a:support event="onblur" reRender="usernameDecorate"/>
|
||||
</h:inputText>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="name">Real Name:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate id="nameDecorate">
|
||||
<h:inputText id="name" value="#{user.name}" required="true">
|
||||
<a:support event="onblur" reRender="nameDecorate"/>
|
||||
</h:inputText>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="password">Password:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate>
|
||||
<h:inputSecret id="password" value="#{user.password}" required="true"/>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"><h:outputLabel for="verify">Verify Password:</h:outputLabel></div>
|
||||
<div class="input">
|
||||
<s:decorate>
|
||||
<h:inputSecret id="verify" value="#{register.verify}" required="true"/>
|
||||
</s:decorate>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</s:validateAll>
|
||||
|
||||
<div class="entry errors">
|
||||
<h:messages globalOnly="true"/>
|
||||
</div>
|
||||
|
||||
<div class="entry">
|
||||
<div class="label"> </div>
|
||||
<div class="input">
|
||||
<h:commandButton id="register" value="Register" action="#{register.register}"/> 
|
||||
<s:button id="cancel" value="Cancel" view="/home.xhtml"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</h:form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
58
spring-webflow-samples /swf-booking-jsf/src/main/webapp/style.css
Executable file
@@ -0,0 +1,58 @@
|
||||
body {
|
||||
width: 720px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
div#logo {
|
||||
width: 720px;
|
||||
height: 73px;
|
||||
background: #86AEA5;
|
||||
}
|
||||
|
||||
div#navigation {
|
||||
width: 720px;
|
||||
height: 15px;
|
||||
background: #E2F3B8;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div#content {
|
||||
width: 720px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
div#insert {
|
||||
width: 120;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.buttonBar {
|
||||
height: 1.5em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div#copyright {
|
||||
width: 720px;
|
||||
}
|
||||
|
||||
div#copyright p {
|
||||
text-align: center;
|
||||
font-family: Tahoma, sans-serif;
|
||||
font-size: 75%;
|
||||
color: div#336633;
|
||||
margin-left: 5px;
|
||||
font-weight: bold;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.readOnly {
|
||||
color: rgb(192, 192, 192);
|
||||
}
|
||||
|
||||
.error {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
35
spring-webflow-samples /swf-booking-jsf/src/main/webapp/template.xhtml
Executable file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:s="http://jboss.com/products/seam/taglib">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>JBoss Suites: Seam Framework</title>
|
||||
<link href="css/screen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="css/date.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="document">
|
||||
<div id="header">
|
||||
<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
|
||||
<div id="status">
|
||||
Welcome #{user.name}
|
||||
| <s:link id="search" view="/main.xhtml" value="Search" propagation="none"/>
|
||||
| <s:link id="settings" view="/password.xhtml" value="Settings" propagation="none"/>
|
||||
| <s:link id="logout" action="#{identity.logout}" value="Logout"/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="container">
|
||||
<div id="sidebar">
|
||||
<ui:insert name="sidebar"/>
|
||||
</div>
|
||||
<div id="content">
|
||||
<ui:insert name="content"/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
9
spring-webflow-samples /swf-booking-jsf/src/test/java/log4j.properties
Executable 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
|
||||