Compare commits
No commits in common. "3a79d8e2147b847559f82af5c8636457c45fba1b" and "3abef0d59597fda7a27de1cb800453ef917db67c" have entirely different histories.
3a79d8e214
...
3abef0d595
62 changed files with 596 additions and 986 deletions
16
.classpath
16
.classpath
|
@ -2,7 +2,7 @@
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="src" path="test"/>
|
<classpathentry kind="src" path="test"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="module" value="true"/>
|
<attribute name="module" value="true"/>
|
||||||
<attribute name="owner.project.facets" value="java"/>
|
<attribute name="owner.project.facets" value="java"/>
|
||||||
|
@ -13,17 +13,19 @@
|
||||||
<classpathentry kind="lib" path="lib/commons-fileupload-1.3.jar" sourcepath="lib/commons-fileupload-1.3-sources.jar"/>
|
<classpathentry kind="lib" path="lib/commons-fileupload-1.3.jar" sourcepath="lib/commons-fileupload-1.3-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/UnitTesting/hamcrest-core-1.3.jar" sourcepath="lib/UnitTesting/hamcrest-core-1.3-sources.jar"/>
|
<classpathentry kind="lib" path="lib/UnitTesting/hamcrest-core-1.3.jar" sourcepath="lib/UnitTesting/hamcrest-core-1.3-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/UnitTesting/junit-4.12.jar" sourcepath="lib/UnitTesting/junit-4.12-sources.jar"/>
|
<classpathentry kind="lib" path="lib/UnitTesting/junit-4.12.jar" sourcepath="lib/UnitTesting/junit-4.12-sources.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/devinsy-strings-0.11.4.jar" sourcepath="lib/devinsy-strings-0.11.4-sources.zip"/>
|
||||||
|
<classpathentry kind="lib" path="lib/tomcat9-servlet-api-9.0.31.jar" sourcepath="lib/tomcat9-servlet-api-9.0.31-sources.jar"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v9.0.46">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="owner.project.facets" value="jst.utility"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="lib" path="lib/xidyn-1.11.2.jar" sourcepath="lib/xidyn-1.11.2-sources.zip"/>
|
||||||
<classpathentry kind="lib" path="lib/commons-io-2.7.jar" sourcepath="lib/commons-io-2.7-sources.jar"/>
|
<classpathentry kind="lib" path="lib/commons-io-2.7.jar" sourcepath="lib/commons-io-2.7-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/Logs/log4j-api-2.17.0.jar" sourcepath="lib/Logs/log4j-api-2.17.0-sources.jar"/>
|
<classpathentry kind="lib" path="lib/Logs/log4j-api-2.17.0.jar" sourcepath="lib/Logs/log4j-api-2.17.0-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/Logs/log4j-core-2.17.0.jar" sourcepath="lib/Logs/log4j-core-2.17.0-sources.jar"/>
|
<classpathentry kind="lib" path="lib/Logs/log4j-core-2.17.0.jar" sourcepath="lib/Logs/log4j-core-2.17.0-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/Logs/log4j-slf4j-impl-2.17.0.jar" sourcepath="lib/Logs/log4j-slf4j-impl-2.17.0-sources.jar"/>
|
<classpathentry kind="lib" path="lib/Logs/log4j-slf4j-impl-2.17.0.jar" sourcepath="lib/Logs/log4j-slf4j-impl-2.17.0-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/Logs/slf4j-api-1.7.32.jar" sourcepath="lib/Logs/slf4j-api-1.7.32-sources.jar"/>
|
<classpathentry kind="lib" path="lib/Logs/slf4j-api-1.7.32.jar" sourcepath="lib/Logs/slf4j-api-1.7.32-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/commons-lang3-3.13.0.jar" sourcepath="lib/commons-lang3-3.13.0-sources.jar"/>
|
<classpathentry kind="lib" path="lib/commons-lang3-3.13.0.jar" sourcepath="lib/commons-lang3-3.13.0-sources.jar"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/apache-tomcat-10.1.12">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="owner.project.facets" value="jst.utility"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="lib" path="lib/devinsy-strings-0.17.0.jar" sourcepath="lib/devinsy-strings-0.17.0-sources.zip"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
filter_fields=false
|
|
||||||
project_specific_settings=true
|
|
||||||
replacements=<?xml version\="1.0" standalone\="yes"?>\n\n<replacements>\n<replacement key\="get" scope\="1" mode\="0">Gets the</replacement>\n<replacement key\="set" scope\="1" mode\="0">Sets the</replacement>\n<replacement key\="add" scope\="1" mode\="0">Adds the</replacement>\n<replacement key\="edit" scope\="1" mode\="0">Edits the</replacement>\n<replacement key\="remove" scope\="1" mode\="0">Removes the</replacement>\n<replacement key\="init" scope\="1" mode\="0">Inits the</replacement>\n<replacement key\="parse" scope\="1" mode\="0">Parses the</replacement>\n<replacement key\="create" scope\="1" mode\="0">Creates the</replacement>\n<replacement key\="build" scope\="1" mode\="0">Builds the</replacement>\n<replacement key\="is" scope\="1" mode\="0">Checks if is</replacement>\n<replacement key\="print" scope\="1" mode\="0">Prints the</replacement>\n<replacement key\="has" scope\="1" mode\="0">Checks for</replacement>\n</replacements>\n\n
|
|
|
@ -1,9 +1,9 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=17
|
org.eclipse.jdt.core.compiler.compliance=11
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
|
@ -12,10 +12,9 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||||
org.eclipse.jdt.core.compiler.release=enabled
|
org.eclipse.jdt.core.compiler.release=enabled
|
||||||
org.eclipse.jdt.core.compiler.source=17
|
org.eclipse.jdt.core.compiler.source=11
|
||||||
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
|
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
|
||||||
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
|
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
|
||||||
org.eclipse.jdt.core.formatter.align_selector_in_method_invocation_on_expression_first_line=false
|
|
||||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||||
org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
|
org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
|
||||||
org.eclipse.jdt.core.formatter.align_with_spaces=false
|
org.eclipse.jdt.core.formatter.align_with_spaces=false
|
||||||
|
@ -43,8 +42,6 @@ org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=49
|
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=49
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
|
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_arrow=0
|
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_colon=0
|
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
|
org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
|
org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
|
||||||
|
@ -53,7 +50,6 @@ org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
|
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=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_parameters_in_method_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_permitted_types_in_type_declaration=16
|
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_record_components=16
|
org.eclipse.jdt.core.formatter.alignment_for_record_components=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0
|
org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
|
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
|
||||||
|
@ -64,7 +60,6 @@ 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_enum_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=16
|
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_switch_case_with_arrow=0
|
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_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.alignment_for_throws_clause_in_method_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_type_annotations=0
|
org.eclipse.jdt.core.formatter.alignment_for_type_annotations=0
|
||||||
|
@ -116,7 +111,6 @@ org.eclipse.jdt.core.formatter.comment.indent_tag_description=false
|
||||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert
|
||||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||||
org.eclipse.jdt.core.formatter.comment.javadoc_do_not_separate_block_tags=false
|
|
||||||
org.eclipse.jdt.core.formatter.comment.line_length=80
|
org.eclipse.jdt.core.formatter.comment.line_length=80
|
||||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||||
|
@ -196,7 +190,6 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arg
|
||||||
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_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_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_parameterized_type_reference=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_permitted_types=insert
|
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert
|
||||||
|
@ -288,7 +281,6 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_ar
|
||||||
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_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_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_parameterized_type_reference=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_permitted_types=do not insert
|
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=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_superinterfaces=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert
|
||||||
|
@ -372,8 +364,6 @@ org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false
|
||||||
org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
|
org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
|
||||||
org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false
|
org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false
|
||||||
org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
|
org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
|
||||||
org.eclipse.jdt.core.formatter.keep_switch_body_block_on_one_line=one_line_never
|
|
||||||
org.eclipse.jdt.core.formatter.keep_switch_case_with_arrow_on_one_line=one_line_never
|
|
||||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||||
org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never
|
org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never
|
||||||
org.eclipse.jdt.core.formatter.lineSplit=150
|
org.eclipse.jdt.core.formatter.lineSplit=150
|
||||||
|
@ -414,6 +404,5 @@ org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
|
||||||
org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true
|
org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true
|
||||||
org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true
|
org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true
|
||||||
org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
|
org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
|
||||||
org.eclipse.jdt.core.formatter.wrap_before_switch_case_arrow_operator=false
|
|
||||||
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
||||||
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
|
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
|
||||||
|
|
|
@ -8,7 +8,6 @@ cleanup.add_missing_nls_tags=false
|
||||||
cleanup.add_missing_override_annotations=true
|
cleanup.add_missing_override_annotations=true
|
||||||
cleanup.add_missing_override_annotations_interface_methods=true
|
cleanup.add_missing_override_annotations_interface_methods=true
|
||||||
cleanup.add_serial_version_id=true
|
cleanup.add_serial_version_id=true
|
||||||
cleanup.also_simplify_lambda=true
|
|
||||||
cleanup.always_use_blocks=true
|
cleanup.always_use_blocks=true
|
||||||
cleanup.always_use_parentheses_in_expressions=false
|
cleanup.always_use_parentheses_in_expressions=false
|
||||||
cleanup.always_use_this_for_non_static_field_access=true
|
cleanup.always_use_this_for_non_static_field_access=true
|
||||||
|
@ -28,7 +27,6 @@ cleanup.convert_to_enhanced_for_loop=false
|
||||||
cleanup.convert_to_enhanced_for_loop_if_loop_var_used=true
|
cleanup.convert_to_enhanced_for_loop_if_loop_var_used=true
|
||||||
cleanup.convert_to_switch_expressions=false
|
cleanup.convert_to_switch_expressions=false
|
||||||
cleanup.correct_indentation=false
|
cleanup.correct_indentation=false
|
||||||
cleanup.do_while_rather_than_while=true
|
|
||||||
cleanup.double_negation=false
|
cleanup.double_negation=false
|
||||||
cleanup.else_if=false
|
cleanup.else_if=false
|
||||||
cleanup.embedded_if=false
|
cleanup.embedded_if=false
|
||||||
|
@ -62,7 +60,6 @@ cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=true
|
||||||
cleanup.operand_factorization=false
|
cleanup.operand_factorization=false
|
||||||
cleanup.organize_imports=false
|
cleanup.organize_imports=false
|
||||||
cleanup.overridden_assignment=false
|
cleanup.overridden_assignment=false
|
||||||
cleanup.overridden_assignment_move_decl=true
|
|
||||||
cleanup.plain_replacement=false
|
cleanup.plain_replacement=false
|
||||||
cleanup.precompile_regex=false
|
cleanup.precompile_regex=false
|
||||||
cleanup.primitive_comparison=false
|
cleanup.primitive_comparison=false
|
||||||
|
@ -92,7 +89,6 @@ cleanup.remove_unnecessary_casts=true
|
||||||
cleanup.remove_unnecessary_nls_tags=true
|
cleanup.remove_unnecessary_nls_tags=true
|
||||||
cleanup.remove_unused_imports=true
|
cleanup.remove_unused_imports=true
|
||||||
cleanup.remove_unused_local_variables=false
|
cleanup.remove_unused_local_variables=false
|
||||||
cleanup.remove_unused_method_parameters=false
|
|
||||||
cleanup.remove_unused_private_fields=true
|
cleanup.remove_unused_private_fields=true
|
||||||
cleanup.remove_unused_private_members=false
|
cleanup.remove_unused_private_members=false
|
||||||
cleanup.remove_unused_private_methods=true
|
cleanup.remove_unused_private_methods=true
|
||||||
|
@ -105,11 +101,7 @@ cleanup.sort_members_all=false
|
||||||
cleanup.standard_comparison=false
|
cleanup.standard_comparison=false
|
||||||
cleanup.static_inner_class=false
|
cleanup.static_inner_class=false
|
||||||
cleanup.strictly_equal_or_different=false
|
cleanup.strictly_equal_or_different=false
|
||||||
cleanup.stringbuffer_to_stringbuilder=false
|
|
||||||
cleanup.stringbuilder=false
|
cleanup.stringbuilder=false
|
||||||
cleanup.stringbuilder_for_local_vars=true
|
|
||||||
cleanup.stringconcat_stringbuffer_stringbuilder=false
|
|
||||||
cleanup.stringconcat_to_textblock=false
|
|
||||||
cleanup.substring=false
|
cleanup.substring=false
|
||||||
cleanup.switch=false
|
cleanup.switch=false
|
||||||
cleanup.system_property=false
|
cleanup.system_property=false
|
||||||
|
@ -144,11 +136,10 @@ cleanup_settings_version=2
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
|
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
|
||||||
formatter_profile=_Kiss4web
|
formatter_profile=_Kiss4web
|
||||||
formatter_settings_version=23
|
formatter_settings_version=21
|
||||||
jautodoc.cleanup.add_header=false
|
jautodoc.cleanup.add_header=false
|
||||||
jautodoc.cleanup.javadoc=false
|
jautodoc.cleanup.javadoc=false
|
||||||
jautodoc.cleanup.replace_header=false
|
jautodoc.cleanup.replace_header=false
|
||||||
org.eclipse.jdt.ui.text.custom_code_templates=
|
|
||||||
sp_cleanup.add_default_serial_version_id=true
|
sp_cleanup.add_default_serial_version_id=true
|
||||||
sp_cleanup.add_generated_serial_version_id=false
|
sp_cleanup.add_generated_serial_version_id=false
|
||||||
sp_cleanup.add_missing_annotations=true
|
sp_cleanup.add_missing_annotations=true
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<faceted-project>
|
<faceted-project>
|
||||||
<runtime name="apache-tomcat-10.1.12"/>
|
<runtime name="Apache Tomcat v9.0.46"/>
|
||||||
<fixed facet="java"/>
|
<fixed facet="java"/>
|
||||||
<fixed facet="jst.utility"/>
|
<fixed facet="jst.utility"/>
|
||||||
<installed facet="jst.utility" version="1.0"/>
|
<installed facet="jst.utility" version="1.0"/>
|
||||||
<installed facet="java" version="17"/>
|
<installed facet="java" version="11"/>
|
||||||
</faceted-project>
|
</faceted-project>
|
||||||
|
|
116
README.md
116
README.md
|
@ -13,17 +13,9 @@ Kiss4web builds on:
|
||||||
- KissDispatcher: call the good Java Servlet for each HTTP request,
|
- KissDispatcher: call the good Java Servlet for each HTTP request,
|
||||||
- Xidyn: a template solution to dynamize HTML sources.
|
- Xidyn: a template solution to dynamize HTML sources.
|
||||||
|
|
||||||
## Author
|
|
||||||
|
|
||||||
Lead developer: Christian Pierre MOMON <christian.momon@devinsy.fr>
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
Kiss4web is released under the GNU LGPL license.
|
|
||||||
|
|
||||||
## Developing environment
|
## Developing environment
|
||||||
|
|
||||||
Kiss4web project uses strictly Eclipse 4.29, Java 17, tomcat 10.1 and Git.
|
Kiss4web-demo project uses strictly Eclipse Kepler, Java 6, GIT.
|
||||||
|
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
@ -34,109 +26,7 @@ Kiss4web uses Ant and generates a kiss4web-x.y.z folder which contains:
|
||||||
- x-core.jar : only compiled class without any library.
|
- x-core.jar : only compiled class without any library.
|
||||||
- x-core-source.jar : sources.
|
- x-core-source.jar : sources.
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
The kiss4web jar requires:
|
# License
|
||||||
- commons-io
|
|
||||||
- commons-lang3
|
|
||||||
- devinsy-strings
|
|
||||||
|
|
||||||
## Usages
|
Kiss4web is released under the GNU LGPL license.
|
||||||
|
|
||||||
```
|
|
||||||
B --> FooAppLauncher -------------------------> FooApp
|
|
||||||
[ServletContextListener] [Singleton]
|
|
||||||
|
|
|
||||||
| setMode(Mode.OPEN)
|
|
||||||
\ /
|
|
||||||
A --> Kiss4webLauncher ----setMode(Mode.OPEN)---> Kiss4web <Mode.APP_INIT>
|
|
||||||
[ServletContextListener] [Singleton]
|
|
||||||
```
|
|
||||||
|
|
||||||
KissDispatcher is initialized with Mode.APP_INIT.
|
|
||||||
|
|
||||||
### Usage A: default
|
|
||||||
|
|
||||||
The easier way, in case you have no application initialization step. The Kiss4webLauncher set a default log4j2 configuration and set the KissDispatcher to Mode.OPEN state with a default set of hooks.
|
|
||||||
|
|
||||||
Edit `…/WebContent/WEB-INF/web.xml` :
|
|
||||||
```
|
|
||||||
<listener>
|
|
||||||
<listener-class>fr.devinsy.kiss4web.Kiss4webLauncher</listener-class>
|
|
||||||
</listener>
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>Application dispatcher</servlet-name>
|
|
||||||
<servlet-class>fr.devinsy.kiss4web.dispatcher.KissDispatcher</servlet-class>
|
|
||||||
<init-param>
|
|
||||||
<param-name>webClassesRootPackage</param-name>
|
|
||||||
<param-value>website</param-value>
|
|
||||||
</init-param>
|
|
||||||
<load-on-startup>1</load-on-startup>
|
|
||||||
</servlet>
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>Application dispatcher</servlet-name>
|
|
||||||
<url-pattern>/*</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
```
|
|
||||||
|
|
||||||
You can create …/WebContent/WEB-INF/log4j2.properties:
|
|
||||||
```
|
|
||||||
# Log configuration
|
|
||||||
# #################
|
|
||||||
|
|
||||||
# priority setting: DEBUG < INFO < WARN < ERROR
|
|
||||||
name = Log4j2 Properties Config
|
|
||||||
status = ERROR
|
|
||||||
dest = err
|
|
||||||
|
|
||||||
# Logger settings.
|
|
||||||
rootLogger.level = INFO
|
|
||||||
rootLogger.appenderRefs = a, b
|
|
||||||
rootLogger.appenderRef.a.ref = CONSOLE
|
|
||||||
rootLogger.appenderRef.b.ref = LOGFILE
|
|
||||||
|
|
||||||
logger.statoolinfos.name = fr.devinsy.statoolinfos
|
|
||||||
logger.statoolinfos.level = INFO
|
|
||||||
|
|
||||||
logger.xidyn.name = fr.devinsy.xidyn
|
|
||||||
logger.xidyn.level = WARN
|
|
||||||
|
|
||||||
# Appenders settings.
|
|
||||||
appenders = CONSOLE, LOGFILE
|
|
||||||
|
|
||||||
appender.CONSOLE.type = Console
|
|
||||||
appender.CONSOLE.name = CONSOLE
|
|
||||||
appender.CONSOLE.layout.type = PatternLayout
|
|
||||||
appender.CONSOLE.layout.pattern = %d{ISO8601} - FooApp [%-5p] %34.34c.%25M - %m%n
|
|
||||||
|
|
||||||
appender.LOGFILE.type = File
|
|
||||||
appender.LOGFILE.name = LOGFILE
|
|
||||||
appender.LOGFILE.filename = /srv/fooapp/rslisi.log
|
|
||||||
appender.LOGFILE.layout.type = PatternLayout
|
|
||||||
appender.LOGFILE.layout.pattern = %d{ISO8601} - FooApp [%-5p] %34.34c.%25M - %m%n
|
|
||||||
```
|
|
||||||
|
|
||||||
### Usage B: custom init
|
|
||||||
|
|
||||||
If you want manage an application initialization step, do not use the Kiss4webLauncher as class listener. Create your own FooAppLauncher and make it calls `Kiss4web.instance().setMode(Mode.OPEN)` when the init step is over.
|
|
||||||
|
|
||||||
|
|
||||||
Edit `…/WebContent/WEB-INF/web.xml` :
|
|
||||||
```
|
|
||||||
<listener>
|
|
||||||
<listener-class>org.foo.app.FooAppLauncher</listener-class>
|
|
||||||
</listener>
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>Application dispatcher</servlet-name>
|
|
||||||
<servlet-class>fr.devinsy.kiss4web.dispatcher.KissDispatcher</servlet-class>
|
|
||||||
<init-param>
|
|
||||||
<param-name>webClassesRootPackage</param-name>
|
|
||||||
<param-value>website</param-value>
|
|
||||||
</init-param>
|
|
||||||
<load-on-startup>1</load-on-startup>
|
|
||||||
</servlet>
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>Application dispatcher</servlet-name>
|
|
||||||
<url-pattern>/*</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
```
|
|
|
@ -1,3 +1,3 @@
|
||||||
#Build Number for ANT. Do not edit!
|
#Build Number for ANT. Do not edit!
|
||||||
#Wed Nov 29 16:26:05 CET 2023
|
#Wed Sep 21 14:25:05 CEST 2016
|
||||||
build.number=1
|
build.number=1
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
product.name=kiss4web
|
product.name=kiss4web
|
||||||
product.revision.major=0
|
product.revision.major=0
|
||||||
product.revision.minor=17
|
product.revision.minor=3
|
||||||
|
|
Binary file not shown.
Binary file not shown.
BIN
lib/devinsy-xml-0.11.0-sources.zip
Normal file
BIN
lib/devinsy-xml-0.11.0-sources.zip
Normal file
Binary file not shown.
BIN
lib/devinsy-xml-0.11.0.jar
Normal file
BIN
lib/devinsy-xml-0.11.0.jar
Normal file
Binary file not shown.
BIN
lib/servlet-api.jar
Normal file
BIN
lib/servlet-api.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/tomcat9-servlet-api-9.0.31-sources.jar
Normal file
BIN
lib/tomcat9-servlet-api-9.0.31-sources.jar
Normal file
Binary file not shown.
BIN
lib/tomcat9-servlet-api-9.0.31.jar
Normal file
BIN
lib/tomcat9-servlet-api-9.0.31.jar
Normal file
Binary file not shown.
BIN
lib/xidyn-1.11.2-sources.zip
Normal file
BIN
lib/xidyn-1.11.2-sources.zip
Normal file
Binary file not shown.
BIN
lib/xidyn-1.11.2.jar
Normal file
BIN
lib/xidyn-1.11.2.jar
Normal file
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2023 Christian Pierre MOMON
|
* Copyright (C) 2013-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -74,80 +74,43 @@ public class BuildInformation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Author.
|
|
||||||
*
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String author()
|
public String author()
|
||||||
{
|
{
|
||||||
return this.author;
|
return this.author;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Builds the date.
|
|
||||||
*
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String buildDate()
|
public String buildDate()
|
||||||
{
|
{
|
||||||
return this.buildDate;
|
return this.buildDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Builds the number.
|
|
||||||
*
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String buildNumber()
|
public String buildNumber()
|
||||||
{
|
{
|
||||||
return this.buildNumber;
|
return this.buildNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generator.
|
|
||||||
*
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String generator()
|
public String generator()
|
||||||
{
|
{
|
||||||
return this.generator;
|
return this.generator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Major revision.
|
|
||||||
*
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String majorRevision()
|
public String majorRevision()
|
||||||
{
|
{
|
||||||
return this.majorRevision;
|
return this.majorRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Minor revision.
|
|
||||||
*
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String minorRevision()
|
public String minorRevision()
|
||||||
{
|
{
|
||||||
return this.minorRevision;
|
return this.minorRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Product name.
|
|
||||||
*
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String productName()
|
public String productName()
|
||||||
{
|
{
|
||||||
return this.productName;
|
return this.productName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To string.
|
*
|
||||||
*
|
|
||||||
* @return the string
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
|
@ -162,9 +125,8 @@ public class BuildInformation
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version.
|
*
|
||||||
*
|
* @return
|
||||||
* @return the string
|
|
||||||
*/
|
*/
|
||||||
public String version()
|
public String version()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,26 +20,26 @@ package fr.devinsy.kiss4web;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
|
||||||
|
import javax.servlet.http.Cookie;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.http.Cookie;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class CookieHelper.
|
* The Class CookieHelper.
|
||||||
*/
|
*/
|
||||||
public class CookieHelper
|
public class CookieHelper
|
||||||
{
|
{
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(CookieHelper.class);
|
||||||
|
|
||||||
public enum Scope
|
public enum Scope
|
||||||
{
|
{
|
||||||
HTTP_AND_HTTPS,
|
HTTP_AND_HTTPS,
|
||||||
HTTPS_ONLY
|
HTTPS_ONLY
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(CookieHelper.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the cookie.
|
* Builds the cookie.
|
||||||
*
|
*
|
||||||
|
|
|
@ -80,11 +80,11 @@ public class EnvironmentInformation
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result = (String) this.environment.lookup("kiss4web.log4j2.path");
|
result = (String) this.environment.lookup("kiss4web.log4j.path");
|
||||||
}
|
}
|
||||||
catch (NamingException exception)
|
catch (NamingException exception)
|
||||||
{
|
{
|
||||||
throw new ConfigurationException("Context configuration error on log4j2 path.");
|
throw new ConfigurationException("Context configuration error on log4j path.");
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2023 Christian Pierre MOMON
|
* Copyright (C) 2013-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -23,6 +23,7 @@ import java.util.Date;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.KissDispatcher;
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcher;
|
||||||
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
|
||||||
import fr.devinsy.kiss4web.dispatcher.hooks.ApplicationInitFailedHook;
|
import fr.devinsy.kiss4web.dispatcher.hooks.ApplicationInitFailedHook;
|
||||||
import fr.devinsy.kiss4web.dispatcher.hooks.ApplicationInitHook;
|
import fr.devinsy.kiss4web.dispatcher.hooks.ApplicationInitHook;
|
||||||
import fr.devinsy.kiss4web.dispatcher.hooks.BlankHook;
|
import fr.devinsy.kiss4web.dispatcher.hooks.BlankHook;
|
||||||
|
@ -43,6 +44,8 @@ import fr.devinsy.kiss4web.dispatcher.hooks.XHTMLHook;
|
||||||
*/
|
*/
|
||||||
public class Kiss4web
|
public class Kiss4web
|
||||||
{
|
{
|
||||||
|
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Kiss4web.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Enum Mode.
|
* The Enum Mode.
|
||||||
*/
|
*/
|
||||||
|
@ -50,8 +53,8 @@ public class Kiss4web
|
||||||
{
|
{
|
||||||
INIT,
|
INIT,
|
||||||
INIT_FAILED,
|
INIT_FAILED,
|
||||||
APP_INIT,
|
APPLICATION_INIT,
|
||||||
APP_INIT_FAILED,
|
APPLICATION_INIT_FAILED,
|
||||||
OPEN,
|
OPEN,
|
||||||
MAINTENANCE,
|
MAINTENANCE,
|
||||||
FATAL,
|
FATAL,
|
||||||
|
@ -63,8 +66,6 @@ public class Kiss4web
|
||||||
private static final Kiss4web instance = new Kiss4web();
|
private static final Kiss4web instance = new Kiss4web();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Kiss4web.class);
|
|
||||||
|
|
||||||
private BuildInformation buildInformation;
|
private BuildInformation buildInformation;
|
||||||
private Mode mode;
|
private Mode mode;
|
||||||
|
|
||||||
|
@ -78,7 +79,7 @@ public class Kiss4web
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
setMode(Mode.INIT);
|
this.mode = Mode.INIT;
|
||||||
|
|
||||||
//
|
//
|
||||||
currentLog = "Kiss4web";
|
currentLog = "Kiss4web";
|
||||||
|
@ -96,8 +97,8 @@ public class Kiss4web
|
||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
setMode(Mode.APP_INIT);
|
setMode(Mode.APPLICATION_INIT);
|
||||||
logInit("set APP INIT mode", "PASSED");
|
logInit("set APPLICATION INIT mode", "PASSED");
|
||||||
|
|
||||||
//
|
//
|
||||||
currentLog = "Kiss4web";
|
currentLog = "Kiss4web";
|
||||||
|
@ -145,12 +146,6 @@ public class Kiss4web
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case INIT:
|
case INIT:
|
||||||
{
|
|
||||||
if (this.mode == null)
|
|
||||||
{
|
|
||||||
this.mode = Mode.INIT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INIT_FAILED:
|
case INIT_FAILED:
|
||||||
|
@ -165,7 +160,7 @@ public class Kiss4web
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case APP_INIT:
|
case APPLICATION_INIT:
|
||||||
{
|
{
|
||||||
if (this.mode == Mode.INIT)
|
if (this.mode == Mode.INIT)
|
||||||
{
|
{
|
||||||
|
@ -177,9 +172,9 @@ public class Kiss4web
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case APP_INIT_FAILED:
|
case APPLICATION_INIT_FAILED:
|
||||||
{
|
{
|
||||||
if (this.mode == Mode.APP_INIT)
|
if (this.mode == Mode.APPLICATION_INIT_FAILED)
|
||||||
{
|
{
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
HookRegister hooks = new HookRegister("Application Init failed");
|
HookRegister hooks = new HookRegister("Application Init failed");
|
||||||
|
@ -191,22 +186,19 @@ public class Kiss4web
|
||||||
|
|
||||||
case OPEN:
|
case OPEN:
|
||||||
{
|
{
|
||||||
if ((this.mode == Mode.INIT) || (this.mode == Mode.APP_INIT))
|
this.mode = mode;
|
||||||
{
|
|
||||||
this.mode = mode;
|
|
||||||
|
|
||||||
HookRegister hooks = new HookRegister("Open");
|
HookRegister hooks = new HookRegister("Open");
|
||||||
hooks.register(new BlankHook());
|
hooks.register(new BlankHook());
|
||||||
hooks.register(new RootHook());
|
hooks.register(new RootHook());
|
||||||
hooks.register(new LongURLHook());
|
hooks.register(new LongURLHook());
|
||||||
hooks.register(new FolderHook());
|
hooks.register(new FolderHook());
|
||||||
hooks.register(new ShortURLHook());
|
hooks.register(new ShortURLHook());
|
||||||
hooks.register(new XHTMLHook());
|
hooks.register(new XHTMLHook());
|
||||||
hooks.register(new WebContentHook());
|
hooks.register(new WebContentHook());
|
||||||
hooks.register(new WebInfHook());
|
hooks.register(new WebInfHook());
|
||||||
|
|
||||||
KissDispatcher.setHookRegister(hooks);
|
KissDispatcher.setHookRegister(hooks);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -240,7 +232,7 @@ public class Kiss4web
|
||||||
/**
|
/**
|
||||||
* Sets the mode custom.
|
* Sets the mode custom.
|
||||||
*
|
*
|
||||||
* @param hooks
|
* @param register
|
||||||
* the new mode custom
|
* the new mode custom
|
||||||
*/
|
*/
|
||||||
public void setModeCustom(final HookRegister hooks)
|
public void setModeCustom(final HookRegister hooks)
|
||||||
|
|
|
@ -1,26 +1,28 @@
|
||||||
/**
|
/*
|
||||||
* Copyright (C) 2013-2023 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
* Copyright (C) 2021 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Juga, simple key value database.
|
||||||
*
|
*
|
||||||
* Kiss4web is free software: you can redistribute it and/or modify
|
* Juga is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Affero General Public License as
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
* (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Kiss4web is distributed in the hope that it will be useful,
|
* Juga is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU Lesser General Public License for more details.
|
* GNU Affero General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with Kiss4web. If not, see <http://www.gnu.org/licenses/>
|
* along with Juga. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package fr.devinsy.kiss4web;
|
package fr.devinsy.kiss4web;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import javax.naming.ConfigurationException;
|
import javax.naming.ConfigurationException;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletContextEvent;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.logging.log4j.core.config.Configurator;
|
import org.apache.logging.log4j.core.config.Configurator;
|
||||||
|
@ -28,48 +30,24 @@ import org.apache.logging.log4j.core.config.DefaultConfiguration;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.Kiss4web.Mode;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletContextEvent;
|
|
||||||
import jakarta.servlet.ServletContextListener;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class Kiss4WebLauncher.
|
* The Class JugaWebLauncher.
|
||||||
*
|
|
||||||
* The Context element represents a web application. If you have implemented a
|
|
||||||
* Java object that needs to know when this Context is started or stopped, you
|
|
||||||
* can declare it by nesting a Listener element inside this element.
|
|
||||||
*/
|
*/
|
||||||
public class Kiss4webLauncher implements ServletContextListener
|
public class Kiss4webLauncher implements javax.servlet.ServletContextListener
|
||||||
{
|
{
|
||||||
private static Logger logger = LoggerFactory.getLogger(Kiss4webLauncher.class);
|
private static Logger logger = LoggerFactory.getLogger(Kiss4webLauncher.class);
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void contextDestroyed(final ServletContextEvent sce)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void contextInitialized(final ServletContextEvent event)
|
public void contextInitialized(final ServletContextEvent event)
|
||||||
{
|
{
|
||||||
System.out.println("========= KISS4WEB WEBAPP LAUNCHING… ==========");
|
launch(event.getServletContext());
|
||||||
ServletContext context = event.getServletContext();
|
|
||||||
initLogger(context.getRealPath("/"));
|
|
||||||
Kiss4web.instance().setMode(Mode.OPEN);
|
|
||||||
System.out.println("========= KISS4WEB WEBAPP LAUNCHED ==========");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inits the logger.
|
* Inits the logger.
|
||||||
*
|
|
||||||
* @param webappRoot
|
|
||||||
* the webapp root
|
|
||||||
*/
|
*/
|
||||||
public void initLogger(final String webappRoot)
|
public void initLogger(final String webappRoot)
|
||||||
{
|
{
|
||||||
|
@ -124,5 +102,10 @@ public class Kiss4webLauncher implements ServletContextListener
|
||||||
*/
|
*/
|
||||||
public void launch(final ServletContext context)
|
public void launch(final ServletContext context)
|
||||||
{
|
{
|
||||||
|
System.out.println("========= KISS4WEB WEBAPP LAUNCHING… ==========");
|
||||||
|
|
||||||
|
initLogger(context.getRealPath("/"));
|
||||||
|
Kiss4web.instance();
|
||||||
|
System.out.println("========= KISS4WEB WEBAPP LAUNCHED ==========");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,43 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2021-2023 Christian Pierre MOMON
|
* Copyright 2021 Christian Pierre MOMON, DEVINSY, UMR 7186 LESC.
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* christian.momon@devinsy.fr
|
||||||
*
|
*
|
||||||
* Kiss4web is free software: you can redistribute it and/or modify
|
* This file is part of Kiwa. This software (Kiwa) is a computer program whose
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* purpose is to be the Kinsources Web Application, an open interactive platform
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* for archiving, sharing, analyzing and comparing kinship data used in
|
||||||
* (at your option) any later version.
|
* scientific inquiry.
|
||||||
*
|
*
|
||||||
* Kiss4web is distributed in the hope that it will be useful,
|
* This software is governed by the CeCILL license under French law and abiding
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* by the rules of distribution of free software. You can use, modify and/ or
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* redistribute the software under the terms of the CeCILL license as circulated
|
||||||
* GNU Lesser General Public License for more details.
|
* by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* As a counterpart to the access to the source code and rights to copy, modify
|
||||||
* along with Kiss4web. If not, see <http://www.gnu.org/licenses/>
|
* and redistribute granted by the license, users are provided only with a
|
||||||
|
* limited warranty and the software's author, the holder of the economic
|
||||||
|
* rights, and the successive licensors have only limited liability.
|
||||||
|
*
|
||||||
|
* In this respect, the user's attention is drawn to the risks associated with
|
||||||
|
* loading, using, modifying and/or developing or reproducing the software by
|
||||||
|
* the user in light of its specific status of free software, that may mean that
|
||||||
|
* it is complicated to manipulate, and that also therefore means that it is
|
||||||
|
* reserved for developers and experienced professionals having in-depth
|
||||||
|
* computer knowledge. Users are therefore encouraged to load and test the
|
||||||
|
* software's suitability as regards their requirements in conditions enabling
|
||||||
|
* the security of their systems and/or data to be ensured and, more generally,
|
||||||
|
* to use and operate it in the same conditions as regards security.
|
||||||
|
*
|
||||||
|
* The fact that you are presently reading this means that you have had
|
||||||
|
* knowledge of the CeCILL license and that you accept its terms.
|
||||||
*/
|
*/
|
||||||
package fr.devinsy.kiss4web;
|
package fr.devinsy.kiss4web;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import jakarta.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class Page.
|
* The Class Page.
|
||||||
|
@ -35,46 +50,22 @@ public abstract class Page
|
||||||
private HttpServletRequest request;
|
private HttpServletRequest request;
|
||||||
private HttpServletResponse response;
|
private HttpServletResponse response;
|
||||||
|
|
||||||
/**
|
|
||||||
* Instantiates a new page.
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* the request
|
|
||||||
* @param response
|
|
||||||
* the response
|
|
||||||
* @throws ServletException
|
|
||||||
* the servlet exception
|
|
||||||
* @throws IOException
|
|
||||||
* Signals that an I/O exception has occurred.
|
|
||||||
*/
|
|
||||||
public Page(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException
|
public Page(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException
|
||||||
{
|
{
|
||||||
this.request = request;
|
this.request = request;
|
||||||
this.response = response;
|
this.response = response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Do get.
|
|
||||||
*/
|
|
||||||
public void doGet()
|
public void doGet()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Do post.
|
|
||||||
*/
|
|
||||||
public void doPost()
|
public void doPost()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Redirect.
|
|
||||||
*
|
|
||||||
* @param urlPath
|
|
||||||
* the url path
|
|
||||||
*/
|
|
||||||
public void redirect(final String urlPath)
|
public void redirect(final String urlPath)
|
||||||
{
|
{
|
||||||
Redirector.redirect(this.response, urlPath);
|
Redirector.redirect(this.response, urlPath);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -18,16 +18,18 @@
|
||||||
*/
|
*/
|
||||||
package fr.devinsy.kiss4web;
|
package fr.devinsy.kiss4web;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class Redirector.
|
* The Class Redirector.
|
||||||
*/
|
*/
|
||||||
public class Redirector
|
public class Redirector
|
||||||
{
|
{
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(Redirector.class);
|
||||||
|
|
||||||
public enum Type
|
public enum Type
|
||||||
{
|
{
|
||||||
MOVED_PERMANENTLY(HttpServletResponse.SC_MOVED_PERMANENTLY),
|
MOVED_PERMANENTLY(HttpServletResponse.SC_MOVED_PERMANENTLY),
|
||||||
|
@ -40,11 +42,6 @@ public class Redirector
|
||||||
this.statusCode = value;
|
this.statusCode = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Status code.
|
|
||||||
*
|
|
||||||
* @return the int
|
|
||||||
*/
|
|
||||||
public int statusCode()
|
public int statusCode()
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
@ -56,8 +53,6 @@ public class Redirector
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(Redirector.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redirect.
|
* Redirect.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -18,13 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package fr.devinsy.kiss4web;
|
package fr.devinsy.kiss4web;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.strings.StringList;
|
import fr.devinsy.strings.StringList;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class SimpleSecurityAgent.
|
* The Class SimpleSecurityAgent.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,16 +21,17 @@ package fr.devinsy.kiss4web.dispatcher;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.hooks.Hook;
|
import fr.devinsy.kiss4web.dispatcher.hooks.Hook;
|
||||||
import fr.devinsy.kiss4web.dispatcher.hooks.HookRegister;
|
import fr.devinsy.kiss4web.dispatcher.hooks.HookRegister;
|
||||||
import fr.devinsy.kiss4web.dispatcher.hooks.InitHook;
|
import fr.devinsy.kiss4web.dispatcher.hooks.InitHook;
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServlet;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class KissDispatcher.
|
* The Class KissDispatcher.
|
||||||
|
@ -66,15 +67,7 @@ public class KissDispatcher extends HttpServlet
|
||||||
* "/good/morning-/12/toto.jpg" => "good.Morning" ('12' and 'toto.jpg" are detected as a parameter, they
|
* "/good/morning-/12/toto.jpg" => "good.Morning" ('12' and 'toto.jpg" are detected as a parameter, they
|
||||||
* will be decoded in the class called later).
|
* will be decoded in the class called later).
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param request
|
|
||||||
* the request
|
|
||||||
* @param response
|
|
||||||
* the response
|
|
||||||
* @throws IOException
|
|
||||||
* Signals that an I/O exception has occurred.
|
|
||||||
* @throws ServletException
|
|
||||||
* the servlet exception
|
|
||||||
*/
|
*/
|
||||||
public void dispatch(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
public void dispatch(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
||||||
{
|
{
|
||||||
|
@ -160,8 +153,8 @@ public class KissDispatcher extends HttpServlet
|
||||||
logger.debug("TIME: {}ms {}", endTime - startTime, request.getPathInfo());
|
logger.debug("TIME: {}ms {}", endTime - startTime, request.getPathInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see javax.servlet.http.HttpServlet#doDelete(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void doDelete(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
public void doDelete(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
||||||
|
@ -169,8 +162,8 @@ public class KissDispatcher extends HttpServlet
|
||||||
dispatch(request, response);
|
dispatch(request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
||||||
|
@ -178,8 +171,8 @@ public class KissDispatcher extends HttpServlet
|
||||||
dispatch(request, response);
|
dispatch(request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void doPost(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
public void doPost(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
||||||
|
@ -187,8 +180,8 @@ public class KissDispatcher extends HttpServlet
|
||||||
dispatch(request, response);
|
dispatch(request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see javax.servlet.http.HttpServlet#doPut(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void doPut(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
public void doPut(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
||||||
|
@ -196,8 +189,8 @@ public class KissDispatcher extends HttpServlet
|
||||||
dispatch(request, response);
|
dispatch(request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see javax.servlet.GenericServlet#init()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void init() throws ServletException
|
public void init() throws ServletException
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,11 +20,11 @@ package fr.devinsy.kiss4web.dispatcher;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServlet;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class KissDispatcherCache.
|
* The Class KissDispatcherCache.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,28 +21,28 @@ package fr.devinsy.kiss4web.dispatcher;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServlet;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A factory for creating KissDispatcher objects.
|
* A factory for creating KissDispatcher objects.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class KissDispatcherFactory
|
public class KissDispatcherFactory
|
||||||
{
|
{
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(KissDispatcherFactory.class);
|
||||||
|
|
||||||
private static class SingletonHolder
|
private static class SingletonHolder
|
||||||
{
|
{
|
||||||
private static final KissDispatcherFactory instance = new KissDispatcherFactory();
|
private static final KissDispatcherFactory instance = new KissDispatcherFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(KissDispatcherFactory.class);
|
|
||||||
|
|
||||||
private KissDispatcherCache cache;
|
private KissDispatcherCache cache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,9 +53,6 @@ public class KissDispatcherFactory
|
||||||
this.cache = new KissDispatcherCache();
|
this.cache = new KissDispatcherCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Clear cache.
|
|
||||||
*/
|
|
||||||
public void clearCache()
|
public void clearCache()
|
||||||
{
|
{
|
||||||
this.cache.clear();
|
this.cache.clear();
|
||||||
|
@ -95,14 +92,6 @@ public class KissDispatcherFactory
|
||||||
servlet = KissDispatcherUtils.instanciateServlet("website." + className.replaceAll("Xhtml$", "Page"));
|
servlet = KissDispatcherUtils.instanciateServlet("website." + className.replaceAll("Xhtml$", "Page"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (servlet == null)
|
|
||||||
{
|
|
||||||
logger.info("Trying with underscore conservative.");
|
|
||||||
className = translateToClassNameAlternative(urlPath);
|
|
||||||
logger.info("className=[" + className + "]");
|
|
||||||
servlet = KissDispatcherUtils.instanciateServlet("website." + className);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (servlet != null)
|
if (servlet != null)
|
||||||
{
|
{
|
||||||
servlet.init(servletConfig);
|
servlet.init(servletConfig);
|
||||||
|
@ -158,11 +147,21 @@ public class KissDispatcherFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if is available path.
|
* Checks if is availableget path.
|
||||||
*
|
*
|
||||||
|
* @param servletConfig
|
||||||
|
* the servlet config
|
||||||
|
* @param request
|
||||||
|
* the request
|
||||||
|
* @param response
|
||||||
|
* the response
|
||||||
* @param urlPath
|
* @param urlPath
|
||||||
* the url path
|
* the url path
|
||||||
* @return true, if is available path
|
* @return true, if is availableget path
|
||||||
|
* @throws IOException
|
||||||
|
* Signals that an I/O exception has occurred.
|
||||||
|
* @throws ServletException
|
||||||
|
* the servlet exception
|
||||||
*/
|
*/
|
||||||
public boolean isAvailablePath(final String urlPath)
|
public boolean isAvailablePath(final String urlPath)
|
||||||
{
|
{
|
||||||
|
@ -299,101 +298,4 @@ public class KissDispatcherFactory
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Translate to class name.
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
* "/" => "Index_xhtml"
|
|
||||||
* "/good/" => "good.Index_xhtml"
|
|
||||||
* "/good/morning.xhtml" => "good.MorningXhtml"
|
|
||||||
* "/good/morning_girl.xhtml" => "good.Morning-Girl_xhtml"
|
|
||||||
* "/good/morning-girl.xhtml" => "good.Morning_Girl_xhtml"
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @param urlPath
|
|
||||||
* the url path
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public static String translateToClassNameAlternative(final String urlPath)
|
|
||||||
{
|
|
||||||
String result;
|
|
||||||
|
|
||||||
if (urlPath == null)
|
|
||||||
{
|
|
||||||
result = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (urlPath.length() == 1)
|
|
||||||
{
|
|
||||||
result = "IndexXhtml";
|
|
||||||
}
|
|
||||||
else if (urlPath.endsWith("/"))
|
|
||||||
{
|
|
||||||
StringBuffer buffer = new StringBuffer(urlPath.length() + 50);
|
|
||||||
for (int index = 1; index < urlPath.length(); index++)
|
|
||||||
{
|
|
||||||
char letter = urlPath.charAt(index);
|
|
||||||
|
|
||||||
if (letter == '/')
|
|
||||||
{
|
|
||||||
buffer.append('.');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buffer.append(letter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buffer.append(".Index_xhtml");
|
|
||||||
|
|
||||||
result = buffer.toString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int lastToken = urlPath.lastIndexOf('/');
|
|
||||||
|
|
||||||
StringBuffer buffer = new StringBuffer(urlPath.length());
|
|
||||||
for (int index = 1; index <= lastToken; index++)
|
|
||||||
{
|
|
||||||
char letter = urlPath.charAt(index);
|
|
||||||
|
|
||||||
if (letter == '/')
|
|
||||||
{
|
|
||||||
buffer.append('.');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buffer.append(letter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lastToken + 1 < urlPath.length())
|
|
||||||
{
|
|
||||||
buffer.append(Character.toUpperCase(urlPath.charAt(lastToken + 1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int index = lastToken + 2; index < urlPath.length(); index++)
|
|
||||||
{
|
|
||||||
char letter = urlPath.charAt(index);
|
|
||||||
|
|
||||||
if (letter == '.')
|
|
||||||
{
|
|
||||||
buffer.append('_');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buffer.append(letter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
result = buffer.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info(urlPath + " -> " + result);
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -26,31 +26,32 @@ import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.hooks.ShortURLRewriter;
|
import fr.devinsy.kiss4web.dispatcher.hooks.ShortURLRewriter;
|
||||||
import fr.devinsy.strings.StringList;
|
import fr.devinsy.strings.StringList;
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.ServletOutputStream;
|
|
||||||
import jakarta.servlet.http.HttpServlet;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class KissDispatcherUtils.
|
* The Class KissDispatcherUtils.
|
||||||
*/
|
*/
|
||||||
public class KissDispatcherUtils
|
public class KissDispatcherUtils
|
||||||
{
|
{
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(KissDispatcherUtils.class);
|
||||||
|
|
||||||
public enum ContentDispositionType
|
public enum ContentDispositionType
|
||||||
{
|
{
|
||||||
ATTACHMENT,
|
ATTACHMENT,
|
||||||
INLINE
|
INLINE
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(KissDispatcherUtils.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the class name.
|
* Builds the class name.
|
||||||
*
|
*
|
||||||
|
@ -203,9 +204,9 @@ public class KissDispatcherUtils
|
||||||
/**
|
/**
|
||||||
* Instanciate servlet.
|
* Instanciate servlet.
|
||||||
*
|
*
|
||||||
* @param classPathname
|
* @param className
|
||||||
* the class pathname
|
* the class name
|
||||||
* @return the http servlet
|
* @return the http servlet or null if no one found.
|
||||||
*/
|
*/
|
||||||
public static HttpServlet instanciateServlet(final String classPathname)
|
public static HttpServlet instanciateServlet(final String classPathname)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2021-2023 Christian Pierre MOMON
|
* Copyright (C) 2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,12 +20,13 @@ package fr.devinsy.kiss4web.dispatcher;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.strings.StringList;
|
import fr.devinsy.strings.StringList;
|
||||||
import jakarta.servlet.http.HttpServlet;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class WebsiteClasspaths.
|
* The Class WebsiteClasspaths.
|
||||||
|
@ -44,8 +45,8 @@ public class WebsiteClasspaths extends StringList
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see java.util.ArrayList#add(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean add(final String classpath)
|
public boolean add(final String classpath)
|
||||||
|
@ -75,8 +76,8 @@ public class WebsiteClasspaths extends StringList
|
||||||
/**
|
/**
|
||||||
* Instanciate servlet.
|
* Instanciate servlet.
|
||||||
*
|
*
|
||||||
* @param className
|
* @param subClasspath
|
||||||
* the class name
|
* the sub classpath
|
||||||
* @return the http servlet
|
* @return the http servlet
|
||||||
*/
|
*/
|
||||||
public HttpServlet instanciateServlet(final String className)
|
public HttpServlet instanciateServlet(final String className)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2018-2023 Christian Pierre MOMON
|
* Copyright (C) 2018-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -19,18 +19,18 @@
|
||||||
package fr.devinsy.kiss4web.dispatcher.hooks;
|
package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
import fr.devinsy.xidyn.XidynException;
|
||||||
import jakarta.servlet.ServletContext;
|
import fr.devinsy.xidyn.presenters.URLPresenter;
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class InitHook.
|
* The Class InitHook.
|
||||||
|
@ -47,8 +47,8 @@ public class ApplicationInitFailedHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -61,26 +61,32 @@ public class ApplicationInitFailedHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
final HttpServletResponse response) throws IOException, ServletException
|
final HttpServletResponse response) throws IOException, ServletException
|
||||||
{
|
{
|
||||||
logger.debug("Doing catch {}.", this.getClass().getName());
|
try
|
||||||
|
{
|
||||||
|
logger.debug("Doing catch {}.", this.getClass().getName());
|
||||||
|
|
||||||
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
||||||
logger.info("path=[{}]", path);
|
logger.info("path=[{}]", path);
|
||||||
|
|
||||||
// Get page.
|
StringBuffer html = new URLPresenter("/fr/devinsy/kiss4web/dispatcher/hooks/applicationInitFailed.xhtml").dynamize();
|
||||||
URL url = Hook.class.getResource("/fr/devinsy/kiss4web/dispatcher/hooks/applicationInitFailed.xhtml");
|
|
||||||
String xhtml = IOUtils.toString(url, StandardCharsets.UTF_8);
|
|
||||||
|
|
||||||
// Display page.
|
// Display page.
|
||||||
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
||||||
response.getWriter().println(xhtml);
|
response.getWriter().println(html);
|
||||||
|
|
||||||
logger.info("Application Init Failed page returned.");
|
logger.info("Application Init Failed page returned.");
|
||||||
|
}
|
||||||
|
catch (XidynException exception)
|
||||||
|
{
|
||||||
|
exception.printStackTrace();
|
||||||
|
new FatalHook().process(servletConfig, servletContext, request, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2018-2023 Christian Pierre MOMON
|
* Copyright (C) 2018-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -19,18 +19,18 @@
|
||||||
package fr.devinsy.kiss4web.dispatcher.hooks;
|
package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
import fr.devinsy.xidyn.XidynException;
|
||||||
import jakarta.servlet.ServletContext;
|
import fr.devinsy.xidyn.presenters.URLPresenter;
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class InitHook.
|
* The Class InitHook.
|
||||||
|
@ -47,8 +47,8 @@ public class ApplicationInitHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -61,26 +61,32 @@ public class ApplicationInitHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
final HttpServletResponse response) throws IOException, ServletException
|
final HttpServletResponse response) throws IOException, ServletException
|
||||||
{
|
{
|
||||||
logger.debug("Doing catch {}.", this.getClass().getName());
|
try
|
||||||
|
{
|
||||||
|
logger.debug("Doing catch {}.", this.getClass().getName());
|
||||||
|
|
||||||
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
||||||
logger.info("path=[{}]", path);
|
logger.info("path=[{}]", path);
|
||||||
|
|
||||||
// Get page.
|
StringBuffer html = new URLPresenter("/fr/devinsy/kiss4web/dispatcher/hooks/applicationInit.xhtml").dynamize();
|
||||||
URL url = Hook.class.getResource("/fr/devinsy/kiss4web/dispatcher/hooks/applicationInit.xhtml");
|
|
||||||
String xhtml = IOUtils.toString(url, StandardCharsets.UTF_8);
|
|
||||||
|
|
||||||
// Display page.
|
// Display page.
|
||||||
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
||||||
response.getWriter().println(xhtml);
|
response.getWriter().println(html);
|
||||||
|
|
||||||
logger.info("Application Init page returned.");
|
logger.info("Application Init page returned.");
|
||||||
|
}
|
||||||
|
catch (XidynException exception)
|
||||||
|
{
|
||||||
|
exception.printStackTrace();
|
||||||
|
new FatalHook().process(servletConfig, servletContext, request, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,14 +21,14 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class BlankHook.
|
* The Class BlankHook.
|
||||||
*/
|
*/
|
||||||
|
@ -44,8 +44,8 @@ public class BlankHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -67,8 +67,8 @@ public class BlankHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2018-2023 Christian Pierre MOMON
|
* Copyright (C) 2018-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,18 +20,18 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
import fr.devinsy.xidyn.XidynException;
|
||||||
import jakarta.servlet.ServletContext;
|
import fr.devinsy.xidyn.presenters.URLPresenter;
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class ErrorHook.
|
* The Class ErrorHook.
|
||||||
|
@ -48,8 +48,8 @@ public class ErrorHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -69,8 +69,8 @@ public class ErrorHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
@ -78,17 +78,22 @@ public class ErrorHook extends HookCore
|
||||||
{
|
{
|
||||||
logger.debug("Doing catch.");
|
logger.debug("Doing catch.");
|
||||||
|
|
||||||
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
try
|
||||||
logger.info("path=[{}]", path);
|
{
|
||||||
|
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
||||||
|
logger.info("path=[{}]", path);
|
||||||
|
|
||||||
// Get page.
|
StringBuffer html = new URLPresenter("/fr/devinsy/kiss4web/dispatcher/hooks/error.xhtml").dynamize();
|
||||||
URL url = Hook.class.getResource("/fr/devinsy/kiss4web/dispatcher/hooks/error.xhtml");
|
// Display page.
|
||||||
String xhtml = IOUtils.toString(url, StandardCharsets.UTF_8);
|
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
||||||
|
response.getWriter().println(html);
|
||||||
|
|
||||||
// Display page.
|
logger.info("Error page returned for [{}].", path);
|
||||||
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
}
|
||||||
response.getWriter().println(xhtml);
|
catch (XidynException exception)
|
||||||
|
{
|
||||||
logger.info("Error page returned for [{}].", path);
|
exception.printStackTrace();
|
||||||
|
new FatalHook().process(servletConfig, servletContext, request, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2018-2023 Christian Pierre MOMON
|
* Copyright (C) 2018-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,19 +20,17 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.io.PrintWriter;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class FatalHook.
|
* The Class FatalHook.
|
||||||
*/
|
*/
|
||||||
|
@ -48,8 +46,8 @@ public class FatalHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -69,8 +67,8 @@ public class FatalHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
@ -81,14 +79,25 @@ public class FatalHook extends HookCore
|
||||||
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
||||||
logger.info("path=[{}]", path);
|
logger.info("path=[{}]", path);
|
||||||
|
|
||||||
// Get page.
|
// Display fatal error page.
|
||||||
URL url = Hook.class.getResource("/fr/devinsy/kiss4web/dispatcher/hooks/fatal.xhtml");
|
response.setContentType("text/html; charset=UTF-8");
|
||||||
String xhtml = IOUtils.toString(url, StandardCharsets.UTF_8);
|
PrintWriter out = response.getWriter();
|
||||||
|
out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
|
||||||
|
out.println("<!DOCTYPE html >");
|
||||||
|
out.println("<html><header></header><body>");
|
||||||
|
out.println("A fatal error occured:<br/>");
|
||||||
|
out.println("<pre>");
|
||||||
|
// out.println(source.getMessage());
|
||||||
|
out.println("</pre>");
|
||||||
|
out.println("<hr />");
|
||||||
|
// if (source.getMessage() != null)
|
||||||
|
// {
|
||||||
|
// out.println("<pre>" + XidynUtils.restoreEntities(new
|
||||||
|
// StringBuffer(source.getMessage())) + "</pre>");
|
||||||
|
// }
|
||||||
|
out.println("<hr />");
|
||||||
|
out.println("</body></html>");
|
||||||
|
|
||||||
// Display page.
|
logger.info("File returned directly [{}] with mimetype [{}].", path, servletContext.getMimeType(path));
|
||||||
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
|
||||||
response.getWriter().println(xhtml);
|
|
||||||
|
|
||||||
logger.info("Fatal page returned.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,15 +20,16 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class FolderHook.
|
* The Class FolderHook.
|
||||||
|
@ -45,8 +46,8 @@ public class FolderHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -68,8 +69,8 @@ public class FolderHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
|
|
@ -20,11 +20,11 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
import javax.servlet.ServletConfig;
|
||||||
import jakarta.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import jakarta.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Interface Hook.
|
* The Interface Hook.
|
||||||
|
|
|
@ -35,8 +35,8 @@ public abstract class HookCore implements Hook
|
||||||
this.terminal = true;
|
this.terminal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#isTerminal()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isTerminal()
|
public boolean isTerminal()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,8 +20,8 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import jakarta.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class HookRegister.
|
* The Class HookRegister.
|
||||||
|
@ -33,9 +33,6 @@ public class HookRegister
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new hook register.
|
* Instantiates a new hook register.
|
||||||
*
|
|
||||||
* @param name
|
|
||||||
* the name
|
|
||||||
*/
|
*/
|
||||||
public HookRegister(final String name)
|
public HookRegister(final String name)
|
||||||
{
|
{
|
||||||
|
@ -94,11 +91,6 @@ public class HookRegister
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the name.
|
|
||||||
*
|
|
||||||
* @return the name
|
|
||||||
*/
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return this.name;
|
return this.name;
|
||||||
|
@ -124,7 +116,6 @@ public class HookRegister
|
||||||
*
|
*
|
||||||
* @param hook
|
* @param hook
|
||||||
* the hook
|
* the hook
|
||||||
* @return the hook register
|
|
||||||
*/
|
*/
|
||||||
public HookRegister register(final Hook hook)
|
public HookRegister register(final Hook hook)
|
||||||
{
|
{
|
||||||
|
@ -138,12 +129,6 @@ public class HookRegister
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Register all.
|
|
||||||
*
|
|
||||||
* @param register
|
|
||||||
* the register
|
|
||||||
*/
|
|
||||||
public void registerAll(final HookRegister register)
|
public void registerAll(final HookRegister register)
|
||||||
{
|
{
|
||||||
this.hooks.addAll(register.getHooks());
|
this.hooks.addAll(register.getHooks());
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2018-2023 Christian Pierre MOMON
|
* Copyright (C) 2018-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,18 +20,17 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class InitFailedHook.
|
* The Class InitFailedHook.
|
||||||
|
@ -48,8 +47,8 @@ public class InitFailedHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -69,8 +68,8 @@ public class InitFailedHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
@ -81,14 +80,9 @@ public class InitFailedHook extends HookCore
|
||||||
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
||||||
logger.info("path=[{}]", path);
|
logger.info("path=[{}]", path);
|
||||||
|
|
||||||
// Get page.
|
String mimeType = servletContext.getMimeType(path);
|
||||||
URL url = Hook.class.getResource("/fr/devinsy/kiss4web/dispatcher/hooks/initFailed.xhtml");
|
KissDispatcherUtils.returnInlineFile(response, new File(path), mimeType);
|
||||||
String xhtml = IOUtils.toString(url, StandardCharsets.UTF_8);
|
|
||||||
|
|
||||||
// Display page.
|
logger.info("File returned directly [{}] with mimetype [{}].", path, servletContext.getMimeType(path));
|
||||||
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
|
||||||
response.getWriter().println(xhtml);
|
|
||||||
|
|
||||||
logger.info("Init Failed page returned.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2018-2023 Christian Pierre MOMON
|
* Copyright (C) 2018-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -19,18 +19,18 @@
|
||||||
package fr.devinsy.kiss4web.dispatcher.hooks;
|
package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
import fr.devinsy.xidyn.XidynException;
|
||||||
import jakarta.servlet.ServletContext;
|
import fr.devinsy.xidyn.presenters.URLPresenter;
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class InitHook.
|
* The Class InitHook.
|
||||||
|
@ -47,8 +47,8 @@ public class InitHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -61,26 +61,32 @@ public class InitHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
final HttpServletResponse response) throws IOException, ServletException
|
final HttpServletResponse response) throws IOException, ServletException
|
||||||
{
|
{
|
||||||
logger.debug("Doing catch {}.", this.getClass().getName());
|
try
|
||||||
|
{
|
||||||
|
logger.debug("Doing catch {}.", this.getClass().getName());
|
||||||
|
|
||||||
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
||||||
logger.info("path=[{}]", path);
|
logger.info("path=[{}]", path);
|
||||||
|
|
||||||
// Get page.
|
StringBuffer html = new URLPresenter("/fr/devinsy/kiss4web/dispatcher/hooks/init.xhtml").dynamize();
|
||||||
URL url = Hook.class.getResource("/fr/devinsy/kiss4web/dispatcher/hooks/init.xhtml");
|
|
||||||
String xhtml = IOUtils.toString(url, StandardCharsets.UTF_8);
|
|
||||||
|
|
||||||
// Display page.
|
// Display page.
|
||||||
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
||||||
response.getWriter().println(xhtml);
|
response.getWriter().println(html);
|
||||||
|
|
||||||
logger.info("Init page returned.");
|
logger.info("Init page returned.");
|
||||||
|
}
|
||||||
|
catch (XidynException exception)
|
||||||
|
{
|
||||||
|
exception.printStackTrace();
|
||||||
|
new FatalHook().process(servletConfig, servletContext, request, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,15 +20,16 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class LongURLHook.
|
* The Class LongURLHook.
|
||||||
|
@ -45,8 +46,8 @@ public class LongURLHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -61,8 +62,8 @@ public class LongURLHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,11 +21,12 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.strings.StringList;
|
import fr.devinsy.strings.StringList;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class LongURLRewriter.
|
* The Class LongURLRewriter.
|
||||||
|
@ -73,12 +74,7 @@ public class LongURLRewriter
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* Note: "-/" is used to indicate the beginning of parameters.
|
* Note: "-/" is used to indicate the beginning of parameters.
|
||||||
*
|
*
|
||||||
* @param path
|
|
||||||
* the path
|
|
||||||
* @param parameters
|
|
||||||
* the parameters
|
|
||||||
* @return the string
|
|
||||||
*/
|
*/
|
||||||
public static String rewrite(final String path, final String... parameters)
|
public static String rewrite(final String path, final String... parameters)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2018-2023 Christian Pierre MOMON
|
* Copyright (C) 2018-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,18 +20,18 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
import fr.devinsy.xidyn.XidynException;
|
||||||
import jakarta.servlet.ServletContext;
|
import fr.devinsy.xidyn.presenters.URLPresenter;
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class MaintenanceHook.
|
* The Class MaintenanceHook.
|
||||||
|
@ -48,8 +48,8 @@ public class MaintenanceHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -69,26 +69,32 @@ public class MaintenanceHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
final HttpServletResponse response) throws IOException, ServletException
|
final HttpServletResponse response) throws IOException, ServletException
|
||||||
{
|
{
|
||||||
logger.debug("Doing catch {}.", this.getClass().getName());
|
try
|
||||||
|
{
|
||||||
|
logger.debug("Doing catch {}.", this.getClass().getName());
|
||||||
|
|
||||||
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
String path = servletContext.getRealPath("/") + request.getPathInfo();
|
||||||
logger.info("path=[{}]", path);
|
logger.info("path=[{}]", path);
|
||||||
|
|
||||||
// Get page.
|
StringBuffer html = new URLPresenter("/fr/devinsy/kiss4web/dispatcher/hooks/maintenance.xhtml").dynamize();
|
||||||
URL url = Hook.class.getResource("/fr/devinsy/kiss4web/dispatcher/hooks/maintenance.xhtml");
|
|
||||||
String xhtml = IOUtils.toString(url, StandardCharsets.UTF_8);
|
|
||||||
|
|
||||||
// Display page.
|
// Display page.
|
||||||
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
response.setContentType("application/xhtml+xml; charset=UTF-8");
|
||||||
response.getWriter().println(xhtml);
|
response.getWriter().println(html);
|
||||||
|
|
||||||
logger.info("Maintenance page returned.");
|
logger.info("Application Init page returned.");
|
||||||
|
}
|
||||||
|
catch (XidynException exception)
|
||||||
|
{
|
||||||
|
exception.printStackTrace();
|
||||||
|
new FatalHook().process(servletConfig, servletContext, request, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,15 +20,16 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class RootHook.
|
* The Class RootHook.
|
||||||
|
@ -45,8 +46,8 @@ public class RootHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -68,8 +69,8 @@ public class RootHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
|
|
@ -20,15 +20,16 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class ShortURLHook.
|
* The Class ShortURLHook.
|
||||||
|
@ -45,8 +46,8 @@ public class ShortURLHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -68,8 +69,8 @@ public class ShortURLHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,11 +21,12 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.strings.StringList;
|
import fr.devinsy.strings.StringList;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class ShortURLRewriter.
|
* The Class ShortURLRewriter.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,14 +20,14 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class StatisticsHook.
|
* The Class StatisticsHook.
|
||||||
*/
|
*/
|
||||||
|
@ -45,8 +45,8 @@ public class StatisticsHook extends HookCore
|
||||||
setTerminal(false);
|
setTerminal(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -59,8 +59,8 @@ public class StatisticsHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,15 +21,16 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class WebContentHook.
|
* The Class WebContentHook.
|
||||||
|
@ -46,8 +47,8 @@ public class WebContentHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -68,8 +69,8 @@ public class WebContentHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,15 +21,16 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class WebInfHook.
|
* The Class WebInfHook.
|
||||||
|
@ -46,8 +47,8 @@ public class WebInfHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -68,8 +69,8 @@ public class WebInfHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -20,15 +20,16 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
|
||||||
import jakarta.servlet.ServletConfig;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class XHTMLHook.
|
* The Class XHTMLHook.
|
||||||
|
@ -45,8 +46,8 @@ public class XHTMLHook extends HookCore
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
|
||||||
|
@ -68,8 +69,8 @@ public class XHTMLHook extends HookCore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* {@inheritDoc}
|
* @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,7 +21,7 @@ package fr.devinsy.kiss4web.security;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class Group.
|
*
|
||||||
*/
|
*/
|
||||||
public class Group
|
public class Group
|
||||||
{
|
{
|
||||||
|
@ -29,8 +29,8 @@ public class Group
|
||||||
private Vector<String> members;
|
private Vector<String> members;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new group.
|
*
|
||||||
*/
|
*/
|
||||||
public Group()
|
public Group()
|
||||||
{
|
{
|
||||||
this.name = null;
|
this.name = null;
|
||||||
|
@ -38,11 +38,8 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the member.
|
*
|
||||||
*
|
*/
|
||||||
* @param login
|
|
||||||
* the login
|
|
||||||
*/
|
|
||||||
public void addMember(final String login)
|
public void addMember(final String login)
|
||||||
{
|
{
|
||||||
if ((login != null) && (login.length() != 0))
|
if ((login != null) && (login.length() != 0))
|
||||||
|
@ -52,12 +49,8 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains.
|
*
|
||||||
*
|
*/
|
||||||
* @param name
|
|
||||||
* the name
|
|
||||||
* @return true, if successful
|
|
||||||
*/
|
|
||||||
public boolean contains(final String name)
|
public boolean contains(final String name)
|
||||||
{
|
{
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
@ -69,10 +62,8 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Members.
|
*
|
||||||
*
|
*/
|
||||||
* @return the vector
|
|
||||||
*/
|
|
||||||
public Vector<String> members()
|
public Vector<String> members()
|
||||||
{
|
{
|
||||||
Vector<String> result;
|
Vector<String> result;
|
||||||
|
@ -84,10 +75,8 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name.
|
*
|
||||||
*
|
*/
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String name()
|
public String name()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
@ -99,12 +88,8 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the name.
|
*
|
||||||
*
|
*/
|
||||||
* @param name
|
|
||||||
* the name
|
|
||||||
* @return the group
|
|
||||||
*/
|
|
||||||
public Group setName(final String name)
|
public Group setName(final String name)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -114,10 +99,8 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To string.
|
*
|
||||||
*
|
*/
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
@ -129,3 +112,5 @@ public class Group
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -23,19 +23,13 @@ import java.util.Iterator;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class GroupsFileReader.
|
*
|
||||||
*/
|
*/
|
||||||
public class GroupsFileReader
|
public class GroupsFileReader
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Load.
|
*
|
||||||
*
|
*/
|
||||||
* @param fileName
|
|
||||||
* the file name
|
|
||||||
* @return the groups
|
|
||||||
* @throws Exception
|
|
||||||
* the exception
|
|
||||||
*/
|
|
||||||
public static Groups load(final String fileName) throws Exception
|
public static Groups load(final String fileName) throws Exception
|
||||||
{
|
{
|
||||||
Groups result;
|
Groups result;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,7 +21,7 @@ package fr.devinsy.kiss4web.security;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class SecurityAgent.
|
*
|
||||||
*/
|
*/
|
||||||
public class SecurityAgent
|
public class SecurityAgent
|
||||||
{
|
{
|
||||||
|
@ -30,13 +30,8 @@ public class SecurityAgent
|
||||||
private Groups permissions;
|
private Groups permissions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new security agent.
|
*
|
||||||
*
|
*/
|
||||||
* @param path
|
|
||||||
* the path
|
|
||||||
* @throws Exception
|
|
||||||
* the exception
|
|
||||||
*/
|
|
||||||
public SecurityAgent(final String path) throws Exception
|
public SecurityAgent(final String path) throws Exception
|
||||||
{
|
{
|
||||||
this.users = UsersFileReader.load(path + "users.conf");
|
this.users = UsersFileReader.load(path + "users.conf");
|
||||||
|
@ -45,14 +40,8 @@ public class SecurityAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticate.
|
*
|
||||||
*
|
*/
|
||||||
* @param login
|
|
||||||
* the login
|
|
||||||
* @param password
|
|
||||||
* the password
|
|
||||||
* @return true, if successful
|
|
||||||
*/
|
|
||||||
public boolean authenticate(final String login, final String password)
|
public boolean authenticate(final String login, final String password)
|
||||||
{
|
{
|
||||||
boolean result;
|
boolean result;
|
||||||
|
@ -77,14 +66,8 @@ public class SecurityAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check permission.
|
*
|
||||||
*
|
*/
|
||||||
* @param url
|
|
||||||
* the url
|
|
||||||
* @param login
|
|
||||||
* the login
|
|
||||||
* @return true, if successful
|
|
||||||
*/
|
|
||||||
public boolean checkPermission(final String url, final String login)
|
public boolean checkPermission(final String url, final String login)
|
||||||
{
|
{
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
@ -141,10 +124,8 @@ public class SecurityAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Groups.
|
*
|
||||||
*
|
*/
|
||||||
* @return the groups
|
|
||||||
*/
|
|
||||||
public Groups groups()
|
public Groups groups()
|
||||||
{
|
{
|
||||||
Groups result;
|
Groups result;
|
||||||
|
@ -156,10 +137,8 @@ public class SecurityAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permissions.
|
*
|
||||||
*
|
*/
|
||||||
* @return the groups
|
|
||||||
*/
|
|
||||||
public Groups permissions()
|
public Groups permissions()
|
||||||
{
|
{
|
||||||
Groups result;
|
Groups result;
|
||||||
|
@ -171,10 +150,8 @@ public class SecurityAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Users.
|
*
|
||||||
*
|
*/
|
||||||
* @return the users
|
|
||||||
*/
|
|
||||||
public Users users()
|
public Users users()
|
||||||
{
|
{
|
||||||
Users result;
|
Users result;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
package fr.devinsy.kiss4web.security;
|
package fr.devinsy.kiss4web.security;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class User.
|
*
|
||||||
*/
|
*/
|
||||||
public class User
|
public class User
|
||||||
{
|
{
|
||||||
|
@ -29,8 +29,8 @@ public class User
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new user.
|
*
|
||||||
*/
|
*/
|
||||||
public User()
|
public User()
|
||||||
{
|
{
|
||||||
this.login = null;
|
this.login = null;
|
||||||
|
@ -40,10 +40,8 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Email.
|
*
|
||||||
*
|
*/
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String email()
|
public String email()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
@ -55,10 +53,8 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Login.
|
*
|
||||||
*
|
*/
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String login()
|
public String login()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
@ -70,10 +66,8 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Password.
|
*
|
||||||
*
|
*/
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String password()
|
public String password()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
@ -85,10 +79,8 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Real name.
|
*
|
||||||
*
|
*/
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String realName()
|
public String realName()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
@ -100,12 +92,8 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the email.
|
*
|
||||||
*
|
*/
|
||||||
* @param email
|
|
||||||
* the email
|
|
||||||
* @return the user
|
|
||||||
*/
|
|
||||||
public User setEmail(final String email)
|
public User setEmail(final String email)
|
||||||
{
|
{
|
||||||
this.email = email;
|
this.email = email;
|
||||||
|
@ -115,12 +103,8 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the login.
|
*
|
||||||
*
|
*/
|
||||||
* @param login
|
|
||||||
* the login
|
|
||||||
* @return the user
|
|
||||||
*/
|
|
||||||
public User setLogin(final String login)
|
public User setLogin(final String login)
|
||||||
{
|
{
|
||||||
this.login = login;
|
this.login = login;
|
||||||
|
@ -130,12 +114,8 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the password.
|
*
|
||||||
*
|
*/
|
||||||
* @param password
|
|
||||||
* the password
|
|
||||||
* @return the user
|
|
||||||
*/
|
|
||||||
public User setPassword(final String password)
|
public User setPassword(final String password)
|
||||||
{
|
{
|
||||||
this.password = password;
|
this.password = password;
|
||||||
|
@ -145,12 +125,8 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the real name.
|
*
|
||||||
*
|
*/
|
||||||
* @param realName
|
|
||||||
* the real name
|
|
||||||
* @return the user
|
|
||||||
*/
|
|
||||||
public User setRealName(final String realName)
|
public User setRealName(final String realName)
|
||||||
{
|
{
|
||||||
this.realName = realName;
|
this.realName = realName;
|
||||||
|
@ -160,8 +136,8 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
*
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2010, 2013-2014 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -22,26 +22,22 @@ import java.util.Iterator;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class Users.
|
*
|
||||||
*/
|
*/
|
||||||
public class Users extends Vector<User>
|
public class Users extends Vector<User>
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 6140538630004281217L;
|
private static final long serialVersionUID = 6140538630004281217L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new users.
|
*
|
||||||
*/
|
*/
|
||||||
public Users()
|
public Users()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Contains.
|
|
||||||
*
|
*
|
||||||
* @param login
|
|
||||||
* the login
|
|
||||||
* @return true, if successful
|
|
||||||
*/
|
*/
|
||||||
public boolean contains(final String login)
|
public boolean contains(final String login)
|
||||||
{
|
{
|
||||||
|
@ -61,12 +57,8 @@ public class Users extends Vector<User>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the by login.
|
*
|
||||||
*
|
*/
|
||||||
* @param login
|
|
||||||
* the login
|
|
||||||
* @return the by login
|
|
||||||
*/
|
|
||||||
public User getByLogin(final String login)
|
public User getByLogin(final String login)
|
||||||
{
|
{
|
||||||
User result;
|
User result;
|
||||||
|
@ -104,8 +96,8 @@ public class Users extends Vector<User>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
*
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
@ -127,3 +119,5 @@ public class Users extends Vector<User>
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -23,19 +23,13 @@ import java.util.Iterator;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class UsersFileReader.
|
*
|
||||||
*/
|
*/
|
||||||
public class UsersFileReader
|
public class UsersFileReader
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Load.
|
*
|
||||||
*
|
*/
|
||||||
* @param fileName
|
|
||||||
* the file name
|
|
||||||
* @return the users
|
|
||||||
* @throws Exception
|
|
||||||
* the exception
|
|
||||||
*/
|
|
||||||
public static Users load(final String fileName) throws Exception
|
public static Users load(final String fileName) throws Exception
|
||||||
{
|
{
|
||||||
Users result;
|
Users result;
|
||||||
|
@ -75,3 +69,5 @@ public class UsersFileReader
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,7 +21,6 @@ import org.apache.logging.log4j.Level;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.core.config.Configurator;
|
import org.apache.logging.log4j.core.config.Configurator;
|
||||||
import org.apache.logging.log4j.core.config.DefaultConfiguration;
|
import org.apache.logging.log4j.core.config.DefaultConfiguration;
|
||||||
import org.slf4j.Logger;
|
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
|
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
|
||||||
*/
|
*/
|
||||||
public class FooSandbox
|
public class FooSandbox
|
||||||
{
|
{
|
||||||
private static Logger logger;
|
private static org.apache.logging.log4j.Logger logger;
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
|
@ -39,31 +38,25 @@ public class FooSandbox
|
||||||
|
|
||||||
Configurator.initialize(new DefaultConfiguration());
|
Configurator.initialize(new DefaultConfiguration());
|
||||||
Configurator.setRootLevel(Level.INFO);
|
Configurator.setRootLevel(Level.INFO);
|
||||||
logger = LogManager.getLogger(FooSandbox.class.getName());
|
|
||||||
logger.info("Enter");
|
logger.info("Enter");
|
||||||
|
|
||||||
//
|
//
|
||||||
logger.info("Set the log file format...");
|
logger.info("Set the log file format...");
|
||||||
|
|
||||||
|
// log =
|
||||||
|
// org.apache.log4j.Category.getInstance(Application.class.getName());
|
||||||
logger.info("... done.");
|
logger.info("... done.");
|
||||||
|
|
||||||
logger.debug("Exit");
|
logger.debug("Exit");
|
||||||
|
logger = LogManager.getLogger(FooSandbox.class.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check.
|
|
||||||
*
|
*
|
||||||
* @param title
|
|
||||||
* the title
|
|
||||||
* @param source
|
|
||||||
* the source
|
|
||||||
* @param model
|
|
||||||
* the model
|
|
||||||
* @return the string
|
|
||||||
*/
|
*/
|
||||||
public static String check(final String title, final StringBuffer source, final String model)
|
public static String check(final String title, final StringBuffer source, final String model)
|
||||||
{
|
{
|
||||||
logger.info("test");
|
|
||||||
String result;
|
String result;
|
||||||
|
|
||||||
if (source.indexOf(model) == -1)
|
if (source.indexOf(model) == -1)
|
||||||
|
@ -81,10 +74,7 @@ public class FooSandbox
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The main method.
|
|
||||||
*
|
*
|
||||||
* @param args
|
|
||||||
* the arguments
|
|
||||||
*/
|
*/
|
||||||
public static void main(final String[] args)
|
public static void main(final String[] args)
|
||||||
{
|
{
|
||||||
|
@ -97,13 +87,7 @@ public class FooSandbox
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test caller.
|
*
|
||||||
*
|
|
||||||
* @param pathInfo
|
|
||||||
* the path info
|
|
||||||
* @param prefix
|
|
||||||
* the prefix
|
|
||||||
* @return the string
|
|
||||||
*/
|
*/
|
||||||
public static String testCaller(final String pathInfo, final String prefix)
|
public static String testCaller(final String pathInfo, final String prefix)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
package fr.devinsy.kiss4web.mocks;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2016-2023 Christian Pierre MOMON
|
* Copyright (C) 2016-2021 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -16,7 +18,6 @@
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with Kiss4web. If not, see <http://www.gnu.org/licenses/>
|
* along with Kiss4web. If not, see <http://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
package fr.devinsy.kiss4web.mocks;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -27,25 +28,25 @@ import java.util.Enumeration;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.AsyncContext;
|
||||||
|
import javax.servlet.DispatcherType;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.ServletInputStream;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.Cookie;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
import javax.servlet.http.HttpUpgradeHandler;
|
||||||
|
import javax.servlet.http.Part;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import fr.devinsy.kiss4web.dispatcher.hooks.ShortURLHook;
|
import fr.devinsy.kiss4web.dispatcher.hooks.ShortURLHook;
|
||||||
import jakarta.servlet.AsyncContext;
|
|
||||||
import jakarta.servlet.DispatcherType;
|
|
||||||
import jakarta.servlet.RequestDispatcher;
|
|
||||||
import jakarta.servlet.ServletConnection;
|
|
||||||
import jakarta.servlet.ServletContext;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.ServletInputStream;
|
|
||||||
import jakarta.servlet.ServletRequest;
|
|
||||||
import jakarta.servlet.ServletResponse;
|
|
||||||
import jakarta.servlet.http.Cookie;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import jakarta.servlet.http.HttpSession;
|
|
||||||
import jakarta.servlet.http.HttpUpgradeHandler;
|
|
||||||
import jakarta.servlet.http.Part;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class HttpServletRequestMock.
|
* The Class HttpServletRequestMock.
|
||||||
|
@ -293,13 +294,6 @@ public class HttpServletRequestMock implements HttpServletRequest
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getProtocolRequestId()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getQueryString()
|
public String getQueryString()
|
||||||
{
|
{
|
||||||
|
@ -314,6 +308,13 @@ public class HttpServletRequestMock implements HttpServletRequest
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRealPath(final String path)
|
||||||
|
{
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRemoteAddr()
|
public String getRemoteAddr()
|
||||||
{
|
{
|
||||||
|
@ -356,13 +357,6 @@ public class HttpServletRequestMock implements HttpServletRequest
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRequestId()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRequestURI()
|
public String getRequestURI()
|
||||||
{
|
{
|
||||||
|
@ -398,13 +392,6 @@ public class HttpServletRequestMock implements HttpServletRequest
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ServletConnection getServletConnection()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServletContext getServletContext()
|
public ServletContext getServletContext()
|
||||||
{
|
{
|
||||||
|
@ -461,6 +448,13 @@ public class HttpServletRequestMock implements HttpServletRequest
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRequestedSessionIdFromUrl()
|
||||||
|
{
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRequestedSessionIdFromURL()
|
public boolean isRequestedSessionIdFromURL()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue