Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions azure-pipelines-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java

trigger:
- master

pool:
vmImage: windows-latest

steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Contents: '**/*.jar'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
32 changes: 32 additions & 0 deletions azure-pipelines-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java

trigger:
- dev

pool:
vmImage: ubuntu-latest

steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Contents: '**/*.jar'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
33 changes: 33 additions & 0 deletions azure-pipelines.yml-bkp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java

trigger:
- dev

pool:
vmImage: windows-latest

steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Contents: '**/*.jar'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'

29 changes: 29 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
resource "azurerm_resource_group" "example" {
name = "ansible"
location = "Central India"
}

resource "azurerm_app_service_plan" "example" {
name = "java-app-serviceplan"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
kind = "Windows"
reserved = true

sku {
tier = "Free"
size = "F1"
}
}

resource "azurerm_app_service" "example" {
name = "java-terraform-app"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
site_config = [{
java_version = "11"
java_container = "JAVA"
java_container_version = "11"
}]
}
10 changes: 5 additions & 5 deletions src/main/java/com/app/IndexController.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//Controller sınıfı
//Temel map olarak /index atanmıştır. Proje ' localhost:8080/index ' adresinde çalışmaktadır.
@Controller
@RequestMapping("/index")
@RequestMapping("")
public class IndexController {


Expand All @@ -42,7 +42,7 @@ public ModelAndView index() {
@RequestMapping(value = "/{id}/delete", method = RequestMethod.GET)
public ModelAndView deleteUsers(@PathVariable long id) {
userService.deleteUser(id);
return new ModelAndView("redirect:/index");
return new ModelAndView("redirect:/");
}


Expand All @@ -60,9 +60,9 @@ public ModelAndView userRegister(@ModelAttribute("user")User user){
model.addObject("danger","Something Going Bad" );

}
return new ModelAndView("redirect:/index");
return new ModelAndView("redirect:");
}
@RequestMapping(value = "/{id}/edit", method = RequestMethod.GET)
@RequestMapping(value = "{id}/edit", method = RequestMethod.GET)
public ModelAndView edit(@PathVariable("id") long id) {
ModelAndView model = new ModelAndView("edit");
User user = userService.getUserById(id);
Expand All @@ -81,7 +81,7 @@ public ModelAndView update(@RequestParam("id") long id,
user.setSurname(surname);
user.setAdress(adress);
userService.saveUser(user);
return new ModelAndView("redirect:/index");
return new ModelAndView("redirect:");
}

}
42 changes: 42 additions & 0 deletions src/main/resources/META-INF/resources/WEB-INF/jsp/edit.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<<jsp:include page="header.jsp"></jsp:include>

<div class="container">

<h3>User Registration</h3>
<form action='/update' method='post'>

<table class='table table-hover table-responsive table-bordered'>

<tr>
<td><b>Name</b></td>
<td><input type='text' name='name' class='form-control' value="${user.name}" /></td>
</tr>

<tr>
<td><b>Surname</b></td>
<td><input type='text' name='surname' class='form-control' value="${user.surname}" /></td>
</tr>

<tr>
<td><b>Adress</b></td>
<td><input type='text' name='adress' class='form-control' size="20" value="${user.adress}" /></td>

</tr>

<input type='hidden' id='id' rows='5' class='form-control' name='id' value="${user.id}"/>
<tr>
<td></td>
<td>
<button type="submit" class="btn btn-primary">Update User Information</button>
</td>
</tr>

</table>
</form>


</div>

<jsp:include page="footer.jsp"></jsp:include>
10 changes: 10 additions & 0 deletions src/main/resources/META-INF/resources/WEB-INF/jsp/footer.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<footer class="footer">
<div class="container">
<p class="text-muted">Fatih Totrakanlı</p>
</div>
</footer>
</body>
</html>
24 changes: 24 additions & 0 deletions src/main/resources/META-INF/resources/WEB-INF/jsp/header.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>TaskList Question 7</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
<link href="/css/sticky-footer-navbar.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" ></script>


</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">

<ul class="nav navbar-nav">
<li class="active"><a href="index">Home</a></li>
</ul>
</div>
</nav>
<div class="container">
77 changes: 77 additions & 0 deletions src/main/resources/META-INF/resources/WEB-INF/jsp/index.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<jsp:include page="header.jsp"></jsp:include>

<h3>User Registration</h3>
<br>
<form action='/add' method='post'>

<table class='table table-hover table-responsive table-bordered'>

<tr>
<td><b>Name</b></td>
<td><input type='text' name='name' class='form-control' required/></td>
</tr>

<tr>
<td><b>Surname</b></td>
<td><input type='text' name='surname' class='form-control' required /></td>
</tr>

<tr>
<td><b>Adress</b></td>
<td><input type='text' name='adress' class='form-control' size="20" required/></td>

</tr>


<tr>
<td></td>
<td>
<button type="submit" class="btn btn-primary">Register</button>
</td>
</tr>

</table>
<b><c:out value="${danger}"></c:out></b>
</form>



<h3>List Of Users</h3>
<br>
<table class="table table-hover">

<thead>
<tr>
<th><b>User Name</b></th>
<th><b>User Surname</b></th>
<th><b>User Adress</b></th>
<th><b>Transactions</b></th>
</tr>
</thead>
<tbody>
<c:forEach items="${list}" var="lou">
<tr>
<td><c:out value="${lou.name}"></c:out></td>
<td><c:out value="${lou.surname}"></c:out></td>
<td><c:out value="${lou.adress}"></c:out></td>

<td>
<a href="/${lou.id}/edit">
<button type="submit" class="btn btn-primary">Edit User</button>
</a>
</td>
<td>
<a href="/${lou.id}/delete">
<button type="submit" class="btn btn-primary">Delete User</button>
</a>
</td>
</tr>

</c:forEach>
</tbody>
</table>
</div>

<jsp:include page="footer.jsp"></jsp:include>
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
spring.view.prefix: /WEB-INF/jsp/
spring.view.prefix:/WEB-INF/jsp/
spring.view.suffix: .jsp
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="container">

<h3>User Registration</h3>
<form action='/index/update' method='post'>
<form action='/update' method='post'>

<table class='table table-hover table-responsive table-bordered'>

Expand Down Expand Up @@ -39,4 +39,4 @@

</div>

<jsp:include page="footer.jsp"></jsp:include>
<jsp:include page="footer.jsp"></jsp:include>
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/jsp/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<h3>User Registration</h3>
<br>
<form action='/index/add' method='post'>
<form action='/add' method='post'>

<table class='table table-hover table-responsive table-bordered'>

Expand Down Expand Up @@ -58,12 +58,12 @@
<td><c:out value="${lou.adress}"></c:out></td>

<td>
<a href="/index/${lou.id}/edit">
<a href="/${lou.id}/edit">
<button type="submit" class="btn btn-primary">Edit User</button>
</a>
</td>
<td>
<a href="/index/${lou.id}/delete">
<a href="/${lou.id}/delete">
<button type="submit" class="btn btn-primary">Delete User</button>
</a>
</td>
Expand All @@ -74,4 +74,4 @@
</table>
</div>

<jsp:include page="footer.jsp"></jsp:include>
<jsp:include page="footer.jsp"></jsp:include>