Skip to content

Instantly share code, notes, and snippets.

Arthur Portas arthurportas

Block or report user

Report or block arthurportas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MavenServlet.java
import org.apache.maven.cli.MavenCli;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.Paths;
View simplelogger.properties
# SLF4J's SimpleLogger configuration file
# Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err.
# Default logging detail level for all instances of SimpleLogger.
# Must be one of ("trace", "debug", "info", "warn", or "error").
# If not specified, defaults to "info".
#org.slf4j.simpleLogger.defaultLogLevel=info
# Logging detail level for a SimpleLogger instance named "xxxxx".
# Must be one of ("trace", "debug", "info", "warn", or "error").
View web.xml
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<welcome-file-list>
<welcome-file>new-employee.html</welcome-file>
</welcome-file-list>
View EmployeeController.java
package com.arthurportas.presentation.servlets;
import com.arthurportas.entities.Employee;
import com.arthurportas.services.EmployeeService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
View new-employee.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>::StaffGest:: - new-employee</title>
<meta name="description" content="StaffGest:: - search-employee">
<meta name="author" content="Arthur Portas">
</head>
<body>
View new-employee.ftl
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>New Employee</title>
</head>
<body>
Employee created with success!
${emp}
</body>
View search-employee.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>::StaffGest:: - search-employee</title>
<meta name="description" content="StaffGest:: - search-employee">
<meta name="author" content="Arthur Portas">
</head>
<body>
View search-employee.ftl
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Search Employee</title>
</head>
<body>
Search results: ${emp}
</body>
</html>
View EmployeeDaoUT.java
package unittests;
import com.arthurportas.persistence.daos.EmployeeDaoImpl;
import com.arthurportas.persistence.entities.Employee;
import com.github.javafaker.Faker;
import org.apache.commons.lang3.StringUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
View EmployeeDaoImpl.java
package com.arthurportas.persistence.daos;
import com.arthurportas.persistence.entities.Employee;
import java.util.List;
/**
* Created by arthurportas on 10/05/2017.
*/
public class EmployeeDaoImpl extends GenericDaoImpl<Employee> implements EmployeeDaoCustom<Employee> {
You can’t perform that action at this time.