-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
237 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.example</groupId> | ||
<artifactId>simple-parcel-service-app</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.5.4</version> | ||
<relativePath/> | ||
</parent> | ||
|
||
<properties> | ||
<java.version>8</java.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-thymeleaf</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.example; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class SimpleParcelServiceApp { | ||
public static void main(String[] args) { | ||
SpringApplication.run(SimpleParcelServiceApp.class, args); | ||
} | ||
} | ||
|
38 changes: 38 additions & 0 deletions
38
src/main/java/com/example/controller/ParcelController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.example.controller; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.Model; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@Controller | ||
@RequestMapping("/") | ||
public class ParcelController { | ||
|
||
@GetMapping | ||
public String index() { | ||
return "index"; | ||
} | ||
|
||
@PostMapping("/sendParcel") | ||
public String sendParcel( | ||
@RequestParam("recipientName") String recipientName, | ||
@RequestParam("recipientAddress") String recipientAddress, | ||
@RequestParam("senderName") String senderName, | ||
@RequestParam("senderAddress") String senderAddress, | ||
@RequestParam("parcelContent") String parcelContent, | ||
Model model | ||
) { | ||
// You can do something with the data, e.g., save it to a database | ||
// For now, let's just add it to the model and display a confirmation | ||
model.addAttribute("recipientName", recipientName); | ||
model.addAttribute("recipientAddress", recipientAddress); | ||
model.addAttribute("senderName", senderName); | ||
model.addAttribute("senderAddress", senderAddress); | ||
model.addAttribute("parcelContent", parcelContent); | ||
return "confirmation"; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.example.model; | ||
|
||
public class Parcel { | ||
// Add fields as needed | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.example.service; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class ParcelService { | ||
// Add service methods as needed | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Thymeleaf Configuration | ||
spring.thymeleaf.prefix=classpath:/templates/ | ||
spring.thymeleaf.suffix=.html | ||
spring.thymeleaf.cache=false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<title>Parcel Service App - Confirmation</title> | ||
</head> | ||
<body> | ||
<h1>Parcel Sent Successfully!</h1> | ||
<p>Recipient's Name: <span th:text="${recipientName}"></span></p> | ||
<p>Recipient's Address: <span th:text="${recipientAddress}"></span></p> | ||
<p>Sender's Name: <span th:text="${senderName}"></span></p> | ||
<p>Sender's Address: <span th:text="${senderAddress}"></span></p> | ||
<p>Parcel Content: <span th:text="${parcelContent}"></span></p> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<title>Parcel Service App</title> | ||
</head> | ||
<body> | ||
<h1>Welcome to the Parcel Service App!</h1> | ||
|
||
<form action="/sendParcel" method="post"> | ||
<label for="recipientName">Recipient's Name:</label> | ||
<input type="text" id="recipientName" name="recipientName" required> | ||
<br> | ||
|
||
<label for="recipientAddress">Recipient's Address:</label> | ||
<input type="text" id="recipientAddress" name="recipientAddress" required> | ||
<br> | ||
|
||
<label for="senderName">Sender's Name:</label> | ||
<input type="text" id="senderName" name="senderName" required> | ||
<br> | ||
|
||
<label for="senderAddress">Sender's Address:</label> | ||
<input type="text" id="senderAddress" name="senderAddress" required> | ||
<br> | ||
|
||
<label for="parcelContent">Parcel Content:</label> | ||
<input type="text" id="parcelContent" name="parcelContent" required> | ||
<br> | ||
|
||
<button type="submit">Send Parcel</button> | ||
</form> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Thymeleaf Configuration | ||
spring.thymeleaf.prefix=classpath:/templates/ | ||
spring.thymeleaf.suffix=.html | ||
spring.thymeleaf.cache=false | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<title>Parcel Service App - Confirmation</title> | ||
</head> | ||
<body> | ||
<h1>Parcel Sent Successfully!</h1> | ||
<p>Recipient's Name: <span th:text="${recipientName}"></span></p> | ||
<p>Recipient's Address: <span th:text="${recipientAddress}"></span></p> | ||
<p>Sender's Name: <span th:text="${senderName}"></span></p> | ||
<p>Sender's Address: <span th:text="${senderAddress}"></span></p> | ||
<p>Parcel Content: <span th:text="${parcelContent}"></span></p> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<title>Parcel Service App</title> | ||
</head> | ||
<body> | ||
<h1>Welcome to the Parcel Service App!</h1> | ||
|
||
<form action="/sendParcel" method="post"> | ||
<label for="recipientName">Recipient's Name:</label> | ||
<input type="text" id="recipientName" name="recipientName" required> | ||
<br> | ||
|
||
<label for="recipientAddress">Recipient's Address:</label> | ||
<input type="text" id="recipientAddress" name="recipientAddress" required> | ||
<br> | ||
|
||
<label for="senderName">Sender's Name:</label> | ||
<input type="text" id="senderName" name="senderName" required> | ||
<br> | ||
|
||
<label for="senderAddress">Sender's Address:</label> | ||
<input type="text" id="senderAddress" name="senderAddress" required> | ||
<br> | ||
|
||
<label for="parcelContent">Parcel Content:</label> | ||
<input type="text" id="parcelContent" name="parcelContent" required> | ||
<br> | ||
|
||
<button type="submit">Send Parcel</button> | ||
</form> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
artifactId=simple-parcel-service-app | ||
groupId=com.example | ||
version=1.0-SNAPSHOT |
4 changes: 4 additions & 0 deletions
4
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
com\example\controller\ParcelController.class | ||
com\example\SimpleParcelServiceApp.class | ||
com\example\service\ParcelService.class | ||
com\example\model\Parcel.class |
4 changes: 4 additions & 0 deletions
4
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
C:\Users\POOJA\e-commerce\src\main\java\com\example\SimpleParcelServiceApp.java | ||
C:\Users\POOJA\e-commerce\src\main\java\com\example\model\Parcel.java | ||
C:\Users\POOJA\e-commerce\src\main\java\com\example\service\ParcelService.java | ||
C:\Users\POOJA\e-commerce\src\main\java\com\example\controller\ParcelController.java |
Binary file not shown.
Binary file not shown.