Merge branch 'main' of http://222.76.244.114:3000/Kane/servlet-learning
init
This commit is contained in:
		
							
								
								
									
										124
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										124
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,3 +1,4 @@
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
target/
 | 
			
		||||
!.mvn/wrapper/maven-wrapper.jar
 | 
			
		||||
!**/src/main/**/target/
 | 
			
		||||
@@ -35,4 +36,125 @@ build/
 | 
			
		||||
.vscode/
 | 
			
		||||
 | 
			
		||||
### Mac OS ###
 | 
			
		||||
.DS_Store
 | 
			
		||||
.DS_Store
 | 
			
		||||
=======
 | 
			
		||||
# ---> JetBrains
 | 
			
		||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
 | 
			
		||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
 | 
			
		||||
 | 
			
		||||
# User-specific stuff
 | 
			
		||||
.idea/**/workspace.xml
 | 
			
		||||
.idea/**/tasks.xml
 | 
			
		||||
.idea/**/usage.statistics.xml
 | 
			
		||||
.idea/**/dictionaries
 | 
			
		||||
.idea/**/shelf
 | 
			
		||||
 | 
			
		||||
# AWS User-specific
 | 
			
		||||
.idea/**/aws.xml
 | 
			
		||||
 | 
			
		||||
# Generated files
 | 
			
		||||
.idea/**/contentModel.xml
 | 
			
		||||
 | 
			
		||||
# Sensitive or high-churn files
 | 
			
		||||
.idea/**/dataSources/
 | 
			
		||||
.idea/**/dataSources.ids
 | 
			
		||||
.idea/**/dataSources.local.xml
 | 
			
		||||
.idea/**/sqlDataSources.xml
 | 
			
		||||
.idea/**/dynamic.xml
 | 
			
		||||
.idea/**/uiDesigner.xml
 | 
			
		||||
.idea/**/dbnavigator.xml
 | 
			
		||||
 | 
			
		||||
# Gradle
 | 
			
		||||
.idea/**/gradle.xml
 | 
			
		||||
.idea/**/libraries
 | 
			
		||||
 | 
			
		||||
# Gradle and Maven with auto-import
 | 
			
		||||
# When using Gradle or Maven with auto-import, you should exclude module files,
 | 
			
		||||
# since they will be recreated, and may cause churn.  Uncomment if using
 | 
			
		||||
# auto-import.
 | 
			
		||||
# .idea/artifacts
 | 
			
		||||
# .idea/compiler.xml
 | 
			
		||||
# .idea/jarRepositories.xml
 | 
			
		||||
# .idea/modules.xml
 | 
			
		||||
# .idea/*.iml
 | 
			
		||||
# .idea/modules
 | 
			
		||||
# *.iml
 | 
			
		||||
# *.ipr
 | 
			
		||||
 | 
			
		||||
# CMake
 | 
			
		||||
cmake-build-*/
 | 
			
		||||
 | 
			
		||||
# Mongo Explorer plugin
 | 
			
		||||
.idea/**/mongoSettings.xml
 | 
			
		||||
 | 
			
		||||
# File-based project format
 | 
			
		||||
*.iws
 | 
			
		||||
 | 
			
		||||
# IntelliJ
 | 
			
		||||
out/
 | 
			
		||||
 | 
			
		||||
# mpeltonen/sbt-idea plugin
 | 
			
		||||
.idea_modules/
 | 
			
		||||
 | 
			
		||||
# JIRA plugin
 | 
			
		||||
atlassian-ide-plugin.xml
 | 
			
		||||
 | 
			
		||||
# Cursive Clojure plugin
 | 
			
		||||
.idea/replstate.xml
 | 
			
		||||
 | 
			
		||||
# SonarLint plugin
 | 
			
		||||
.idea/sonarlint/
 | 
			
		||||
 | 
			
		||||
# Crashlytics plugin (for Android Studio and IntelliJ)
 | 
			
		||||
com_crashlytics_export_strings.xml
 | 
			
		||||
crashlytics.properties
 | 
			
		||||
crashlytics-build.properties
 | 
			
		||||
fabric.properties
 | 
			
		||||
 | 
			
		||||
# Editor-based Rest Client
 | 
			
		||||
.idea/httpRequests
 | 
			
		||||
 | 
			
		||||
# Android studio 3.1+ serialized cache file
 | 
			
		||||
.idea/caches/build_file_checksums.ser
 | 
			
		||||
 | 
			
		||||
# ---> VisualStudioCode
 | 
			
		||||
.vscode/*
 | 
			
		||||
!.vscode/settings.json
 | 
			
		||||
!.vscode/tasks.json
 | 
			
		||||
!.vscode/launch.json
 | 
			
		||||
!.vscode/extensions.json
 | 
			
		||||
!.vscode/*.code-snippets
 | 
			
		||||
 | 
			
		||||
# Local History for Visual Studio Code
 | 
			
		||||
.history/
 | 
			
		||||
 | 
			
		||||
# Built Visual Studio Code Extensions
 | 
			
		||||
*.vsix
 | 
			
		||||
 | 
			
		||||
# ---> Java
 | 
			
		||||
# Compiled class file
 | 
			
		||||
*.class
 | 
			
		||||
 | 
			
		||||
# Log file
 | 
			
		||||
*.log
 | 
			
		||||
 | 
			
		||||
# BlueJ files
 | 
			
		||||
*.ctxt
 | 
			
		||||
 | 
			
		||||
# Mobile Tools for Java (J2ME)
 | 
			
		||||
.mtj.tmp/
 | 
			
		||||
 | 
			
		||||
# Package Files #
 | 
			
		||||
*.jar
 | 
			
		||||
*.war
 | 
			
		||||
*.nar
 | 
			
		||||
*.ear
 | 
			
		||||
*.zip
 | 
			
		||||
*.tar.gz
 | 
			
		||||
*.rar
 | 
			
		||||
 | 
			
		||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
 | 
			
		||||
hs_err_pid*
 | 
			
		||||
replay_pid*
 | 
			
		||||
 | 
			
		||||
>>>>>>> 7c427b2170f211eae47685a52137b707646d48f1
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										48
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										48
									
								
								pom.xml
									
									
									
									
									
								
							@@ -1,48 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
 | 
			
		||||
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
			
		||||
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
 | 
			
		||||
  <modelVersion>4.0.0</modelVersion>
 | 
			
		||||
 | 
			
		||||
  <groupId>com.cpic</groupId>
 | 
			
		||||
  <artifactId>servlet-learning</artifactId>
 | 
			
		||||
  <version>1.0-SNAPSHOT</version>
 | 
			
		||||
  <name>servlet-learning</name>
 | 
			
		||||
  <packaging>war</packaging>
 | 
			
		||||
 | 
			
		||||
  <properties>
 | 
			
		||||
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 | 
			
		||||
    <maven.compiler.target>1.8</maven.compiler.target>
 | 
			
		||||
    <maven.compiler.source>1.8</maven.compiler.source>
 | 
			
		||||
      <junit.version>5.8.2</junit.version>
 | 
			
		||||
      </properties>
 | 
			
		||||
 | 
			
		||||
  <dependencies>
 | 
			
		||||
                                                                        <dependency>
 | 
			
		||||
      <groupId>javax.servlet</groupId>
 | 
			
		||||
      <artifactId>javax.servlet-api</artifactId>
 | 
			
		||||
      <version>4.0.1</version>
 | 
			
		||||
      <scope>provided</scope>
 | 
			
		||||
    </dependency>                                                                        
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>org.junit.jupiter</groupId>
 | 
			
		||||
      <artifactId>junit-jupiter-api</artifactId>
 | 
			
		||||
      <version>${junit.version}</version>
 | 
			
		||||
      <scope>test</scope>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>org.junit.jupiter</groupId>
 | 
			
		||||
      <artifactId>junit-jupiter-engine</artifactId>
 | 
			
		||||
      <version>${junit.version}</version>
 | 
			
		||||
      <scope>test</scope>
 | 
			
		||||
    </dependency>      </dependencies>
 | 
			
		||||
 | 
			
		||||
  <build>
 | 
			
		||||
        <plugins>
 | 
			
		||||
      <plugin>
 | 
			
		||||
        <groupId>org.apache.maven.plugins</groupId>
 | 
			
		||||
        <artifactId>maven-war-plugin</artifactId>
 | 
			
		||||
        <version>3.3.2</version>
 | 
			
		||||
      </plugin>                </plugins>
 | 
			
		||||
  </build>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										38
									
								
								servlet-01/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								servlet-01/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
			
		||||
target/
 | 
			
		||||
!.mvn/wrapper/maven-wrapper.jar
 | 
			
		||||
!**/src/main/**/target/
 | 
			
		||||
!**/src/test/**/target/
 | 
			
		||||
 | 
			
		||||
### IntelliJ IDEA ###
 | 
			
		||||
.idea/modules.xml
 | 
			
		||||
.idea/jarRepositories.xml
 | 
			
		||||
.idea/compiler.xml
 | 
			
		||||
.idea/libraries/
 | 
			
		||||
*.iws
 | 
			
		||||
*.iml
 | 
			
		||||
*.ipr
 | 
			
		||||
 | 
			
		||||
### Eclipse ###
 | 
			
		||||
.apt_generated
 | 
			
		||||
.classpath
 | 
			
		||||
.factorypath
 | 
			
		||||
.project
 | 
			
		||||
.settings
 | 
			
		||||
.springBeans
 | 
			
		||||
.sts4-cache
 | 
			
		||||
 | 
			
		||||
### NetBeans ###
 | 
			
		||||
/nbproject/private/
 | 
			
		||||
/nbbuild/
 | 
			
		||||
/dist/
 | 
			
		||||
/nbdist/
 | 
			
		||||
/.nb-gradle/
 | 
			
		||||
build/
 | 
			
		||||
!**/src/main/**/build/
 | 
			
		||||
!**/src/test/**/build/
 | 
			
		||||
 | 
			
		||||
### VS Code ###
 | 
			
		||||
.vscode/
 | 
			
		||||
 | 
			
		||||
### Mac OS ###
 | 
			
		||||
.DS_Store
 | 
			
		||||
							
								
								
									
										0
									
								
								.idea/.gitignore → servlet-01/.idea/.gitignore
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										0
									
								
								.idea/.gitignore → servlet-01/.idea/.gitignore
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
								
								
									
										14
									
								
								servlet-01/.idea/artifacts/servlet_01_war.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								servlet-01/.idea/artifacts/servlet_01_war.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
<component name="ArtifactManager">
 | 
			
		||||
  <artifact type="war" name="servlet-01:war">
 | 
			
		||||
    <output-path>$PROJECT_DIR$/target</output-path>
 | 
			
		||||
    <properties id="maven-jee-properties">
 | 
			
		||||
      <options>
 | 
			
		||||
        <module>servlet-01</module>
 | 
			
		||||
        <packaging>war</packaging>
 | 
			
		||||
      </options>
 | 
			
		||||
    </properties>
 | 
			
		||||
    <root id="archive" name="servlet-01-1.0-SNAPSHOT.war">
 | 
			
		||||
      <element id="artifact" artifact-name="servlet-01:war exploded" />
 | 
			
		||||
    </root>
 | 
			
		||||
  </artifact>
 | 
			
		||||
</component>
 | 
			
		||||
							
								
								
									
										23
									
								
								servlet-01/.idea/artifacts/servlet_01_war_exploded.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								servlet-01/.idea/artifacts/servlet_01_war_exploded.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
<component name="ArtifactManager">
 | 
			
		||||
  <artifact type="exploded-war" name="servlet-01:war exploded">
 | 
			
		||||
    <output-path>$PROJECT_DIR$/target/servlet-01-1.0-SNAPSHOT</output-path>
 | 
			
		||||
    <properties id="maven-jee-properties">
 | 
			
		||||
      <options>
 | 
			
		||||
        <exploded>true</exploded>
 | 
			
		||||
        <module>servlet-01</module>
 | 
			
		||||
        <packaging>war</packaging>
 | 
			
		||||
      </options>
 | 
			
		||||
    </properties>
 | 
			
		||||
    <root id="root">
 | 
			
		||||
      <element id="directory" name="WEB-INF">
 | 
			
		||||
        <element id="directory" name="classes">
 | 
			
		||||
          <element id="module-output" name="servlet-01" />
 | 
			
		||||
        </element>
 | 
			
		||||
      </element>
 | 
			
		||||
      <element id="directory" name="META-INF">
 | 
			
		||||
        <element id="file-copy" path="$PROJECT_DIR$/target/servlet-01-1.0-SNAPSHOT/META-INF/MANIFEST.MF" />
 | 
			
		||||
      </element>
 | 
			
		||||
      <element id="javaee-facet-resources" facet="servlet-01/web/Web" />
 | 
			
		||||
    </root>
 | 
			
		||||
  </artifact>
 | 
			
		||||
</component>
 | 
			
		||||
							
								
								
									
										7
									
								
								servlet-01/.idea/encodings.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								servlet-01/.idea/encodings.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="Encoding">
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										12
									
								
								servlet-01/.idea/junitgenerator-prj-settings.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								servlet-01/.idea/junitgenerator-prj-settings.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="JUnitGeneratorProjectSettings">
 | 
			
		||||
    <option name="selectedTemplateKey" value="JUnit 4" />
 | 
			
		||||
    <option name="vmTemplates">
 | 
			
		||||
      <map>
 | 
			
		||||
        <entry key="JUnit 3" value="######################################################################################## 
## 
## Available variables: 
##         $entryList.methodList - List of method composites 
##         $entryList.privateMethodList - List of private method composites 
##         $entryList.fieldList - ArrayList of class scope field names 
##         $entryList.className - class name 
##         $entryList.packageName - package name 
##         $today - Todays date in MM/dd/yyyy format 
## 
##            MethodComposite variables: 
##                $method.name - Method Name 
##                $method.signature - Full method signature in String form 
##                $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods) 
##                $method.paramNames - List of Strings representing the method's parameters' names 
##                $method.paramClasses - List of Strings representing the method's parameters' classes 
## 
## You can configure the output class name using "testClass" variable below. 
## Here are some examples: 
## Test${entry.ClassName} - will produce TestSomeClass 
## ${entry.className}Test - will produce SomeClassTest 
## 
######################################################################################## 
## 
#macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end 
## Iterate through the list and generate testcase for every entry. 
#foreach ($entry in $entryList) 
#set( $testClass="${entry.className}Test") 
## 
package test.$entry.packageName; 

import junit.framework.Test; 
import junit.framework.TestSuite; 
import junit.framework.TestCase; 

/** 
* ${entry.className} Tester. 
* 
* @author <Authors name> 
* @since <pre>$today</pre> 
* @version 1.0 
*/ 
public class $testClass extends TestCase { 
public $testClass(String name) { 
super(name); 
} 

public void setUp() throws Exception { 
super.setUp(); 
} 

public void tearDown() throws Exception { 
super.tearDown(); 
} 

#foreach($method in $entry.methodList) 
/** 
* 
* Method: $method.signature 
* 
*/ 
public void test#cap(${method.name})() throws Exception { 
//TODO: Test goes here... 
} 

#end 

#foreach($method in $entry.privateMethodList) 
/** 
* 
* Method: $method.signature 
* 
*/ 
public void test#cap(${method.name})() throws Exception { 
//TODO: Test goes here... 
#foreach($string in $method.reflectionCode) 
$string 
#end 
} 

#end 

public static Test suite() { 
return new TestSuite(${testClass}.class); 
} 
} 
#end" />
 | 
			
		||||
        <entry key="JUnit 4" value="######################################################################################## 
## 
## Available variables: 
##         $entryList.methodList - List of method composites 
##         $entryList.privateMethodList - List of private method composites 
##         $entryList.fieldList - ArrayList of class scope field names 
##         $entryList.className - class name 
##         $entryList.packageName - package name 
##         $today - Todays date in MM/dd/yyyy format 
## 
##            MethodComposite variables: 
##                $method.name - Method Name 
##                $method.signature - Full method signature in String form 
##                $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods) 
##                $method.paramNames - List of Strings representing the method's parameters' names 
##                $method.paramClasses - List of Strings representing the method's parameters' classes 
## 
## You can configure the output class name using "testClass" variable below. 
## Here are some examples: 
## Test${entry.ClassName} - will produce TestSomeClass 
## ${entry.className}Test - will produce SomeClassTest 
## 
######################################################################################## 
## 
#macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end 
## Iterate through the list and generate testcase for every entry. 
#foreach ($entry in $entryList) 
#set( $testClass="${entry.className}Test") 
## 
package $entry.packageName; 

import org.junit.Test; 
import org.junit.Before; 
import org.junit.After; 

/** 
* ${entry.className} Tester. 
* 
* @author <Authors name> 
* @since <pre>$date</pre> 
* @version 1.0 
*/ 
public class $testClass { 

@Before
public void before() throws Exception { 
} 

@After
public void after() throws Exception { 
} 

#foreach($method in $entry.methodList) 
/** 
* 
* Method: $method.signature 
* 
*/ 
@Test
public void test#cap(${method.name})() throws Exception { 
//TODO: Test goes here... 
} 

#end 

#foreach($method in $entry.privateMethodList) 
/** 
* 
* Method: $method.signature 
* 
*/ 
@Test
public void test#cap(${method.name})() throws Exception { 
//TODO: Test goes here... 
#foreach($string in $method.reflectionCode) 
$string 
#end 
} 

#end 
} 
#end" />
 | 
			
		||||
      </map>
 | 
			
		||||
    </option>
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										3
									
								
								.idea/misc.xml → servlet-01/.idea/misc.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										3
									
								
								.idea/misc.xml → servlet-01/.idea/misc.xml
									
									
									
										generated
									
									
									
								
							@@ -1,5 +1,8 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="FrameworkDetectionExcludesConfiguration">
 | 
			
		||||
    <file type="web" url="file://$PROJECT_DIR$" />
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="MavenProjectsManager">
 | 
			
		||||
    <option name="originalFiles">
 | 
			
		||||
      <list>
 | 
			
		||||
							
								
								
									
										1
									
								
								.idea/vcs.xml → servlet-01/.idea/vcs.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1
									
								
								.idea/vcs.xml → servlet-01/.idea/vcs.xml
									
									
									
										generated
									
									
									
								
							@@ -1,6 +1,7 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="VcsDirectoryMappings">
 | 
			
		||||
    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
 | 
			
		||||
    <mapping directory="$PROJECT_DIR$" vcs="Git" />
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										0
									
								
								mvnw → servlet-01/mvnw
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										0
									
								
								mvnw → servlet-01/mvnw
									
									
									
									
										vendored
									
									
								
							
							
								
								
									
										0
									
								
								mvnw.cmd → servlet-01/mvnw.cmd
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										0
									
								
								mvnw.cmd → servlet-01/mvnw.cmd
									
									
									
									
										vendored
									
									
								
							
							
								
								
									
										50
									
								
								servlet-01/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								servlet-01/pom.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,50 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
 | 
			
		||||
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
			
		||||
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
 | 
			
		||||
    <modelVersion>4.0.0</modelVersion>
 | 
			
		||||
 | 
			
		||||
    <groupId>com.cpic</groupId>
 | 
			
		||||
    <artifactId>servlet-01</artifactId>
 | 
			
		||||
    <version>1.0-SNAPSHOT</version>
 | 
			
		||||
    <name>servlet-01</name>
 | 
			
		||||
    <packaging>war</packaging>
 | 
			
		||||
 | 
			
		||||
    <properties>
 | 
			
		||||
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 | 
			
		||||
        <maven.compiler.target>1.8</maven.compiler.target>
 | 
			
		||||
        <maven.compiler.source>1.8</maven.compiler.source>
 | 
			
		||||
        <junit.version>5.8.2</junit.version>
 | 
			
		||||
    </properties>
 | 
			
		||||
 | 
			
		||||
    <dependencies>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>javax.servlet</groupId>
 | 
			
		||||
            <artifactId>javax.servlet-api</artifactId>
 | 
			
		||||
            <version>4.0.1</version>
 | 
			
		||||
            <scope>provided</scope>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.junit.jupiter</groupId>
 | 
			
		||||
            <artifactId>junit-jupiter-api</artifactId>
 | 
			
		||||
            <version>${junit.version}</version>
 | 
			
		||||
            <scope>test</scope>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.junit.jupiter</groupId>
 | 
			
		||||
            <artifactId>junit-jupiter-engine</artifactId>
 | 
			
		||||
            <version>${junit.version}</version>
 | 
			
		||||
            <scope>test</scope>
 | 
			
		||||
        </dependency>
 | 
			
		||||
    </dependencies>
 | 
			
		||||
 | 
			
		||||
    <build>
 | 
			
		||||
        <plugins>
 | 
			
		||||
            <plugin>
 | 
			
		||||
                <groupId>org.apache.maven.plugins</groupId>
 | 
			
		||||
                <artifactId>maven-war-plugin</artifactId>
 | 
			
		||||
                <version>3.3.2</version>
 | 
			
		||||
            </plugin>
 | 
			
		||||
        </plugins>
 | 
			
		||||
    </build>
 | 
			
		||||
</project>
 | 
			
		||||
@@ -0,0 +1,32 @@
 | 
			
		||||
package com.cpic.servlet01;
 | 
			
		||||
 | 
			
		||||
import java.io.*;
 | 
			
		||||
import javax.servlet.http.*;
 | 
			
		||||
import javax.servlet.annotation.*;
 | 
			
		||||
 | 
			
		||||
@WebServlet(name = "helloServlet", value = "/hello-servlet")
 | 
			
		||||
public class HelloServlet extends HttpServlet
 | 
			
		||||
{
 | 
			
		||||
    private String message;
 | 
			
		||||
 | 
			
		||||
    public void init()
 | 
			
		||||
    {
 | 
			
		||||
        message = "Hello World!";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void doGet( HttpServletRequest request, HttpServletResponse response )
 | 
			
		||||
            throws IOException
 | 
			
		||||
    {
 | 
			
		||||
        response.setContentType( "text/html" );
 | 
			
		||||
 | 
			
		||||
        // Hello
 | 
			
		||||
        PrintWriter out = response.getWriter();
 | 
			
		||||
        out.println( "<html><body>" );
 | 
			
		||||
        out.println( "<h1>" + message + "</h1>" );
 | 
			
		||||
        out.println( "</body></html>" );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void destroy()
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -2,10 +2,11 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
  <title>JSP - Hello World</title>
 | 
			
		||||
    <title>JSP - Hello World</title>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
<h1><%= "Hello World!" %></h1>
 | 
			
		||||
<h1><%= "Hello World!" %>
 | 
			
		||||
</h1>
 | 
			
		||||
<br/>
 | 
			
		||||
<a href="hello-servlet">Hello Servlet</a>
 | 
			
		||||
</body>
 | 
			
		||||
@@ -1,27 +0,0 @@
 | 
			
		||||
package com.cpic.servletlearning;
 | 
			
		||||
 | 
			
		||||
import java.io.*;
 | 
			
		||||
import javax.servlet.http.*;
 | 
			
		||||
import javax.servlet.annotation.*;
 | 
			
		||||
 | 
			
		||||
@WebServlet(name = "helloServlet", value = "/hello-servlet")
 | 
			
		||||
public class HelloServlet extends HttpServlet {
 | 
			
		||||
    private String message;
 | 
			
		||||
 | 
			
		||||
    public void init() {
 | 
			
		||||
        message = "Hello World!";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
 | 
			
		||||
        response.setContentType("text/html");
 | 
			
		||||
 | 
			
		||||
        // Hello
 | 
			
		||||
        PrintWriter out = response.getWriter();
 | 
			
		||||
        out.println("<html><body>");
 | 
			
		||||
        out.println("<h1>" + message + "</h1>");
 | 
			
		||||
        out.println("</body></html>");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void destroy() {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user