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
package com.sakadream.jsf.controller; | |
import com.sakadream.jsf.func.Functions; | |
import javax.faces.application.FacesMessage; | |
import javax.faces.bean.ManagedBean; | |
import javax.faces.bean.RequestScoped; | |
import javax.faces.context.FacesContext; | |
import javax.servlet.http.HttpSession; | |
import java.io.Serializable; |
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
package com.sakadream.jsf.bean; | |
/** | |
* Created by Phan Ba Hai on 17/07/2017. | |
*/ | |
public class Employee { | |
private int id; | |
private String fullName; | |
private String address; | |
private String email; |
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
package com.sakadream.jsf.bean; | |
/** | |
* Created by Phan Ba Hai on 17/07/2017. | |
*/ | |
public class User { | |
private int id; | |
private String username; | |
private String password; |
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
package com.sakadream.jsf.func; | |
import com.sakadream.jsf.bean.Employee; | |
import javax.faces.context.FacesContext; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpSession; | |
import java.sql.*; | |
import java.util.ArrayList; | |
import java.util.List; |
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
CREATE TABLE USERS ( | |
ID INT IDENTITY (1,1) PRIMARY KEY NOT NULL , | |
USERNAME VARCHAR(50) NOT NULL , | |
PASSWORD VARCHAR(50) NOT NULL | |
); | |
INSERT INTO USERS(USERNAME, PASSWORD) | |
VALUES | |
('haipb', 'haipb'), | |
('kietpp', 'kietpp') |
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
<?xml version='1.0' encoding='UTF-8'?> | |
<faces-config version="2.2" 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-facesconfig_2_2.xsd"> | |
<navigation-rule> | |
<from-view-id>/login.xhtml</from-view-id> | |
<navigation-case> |
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
<!DOCTYPE web-app PUBLIC | |
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | |
"http://java.sun.com/dtd/web-app_2_3.dtd" > | |
<web-app> | |
<display-name>Archetype Created Web Application</display-name> | |
<context-param> | |
<param-name>javax.faces.PROJECT_STAGE</param-name> | |
<param-value>Development</param-value> |
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
<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/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>YOUR_PROJECT_GROUP_ID</groupId> | |
<artifactId>YOUR_PROJECT_ARTIFACT_ID</artifactId> | |
<packaging>war</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<name>jsf Maven Webapp</name> | |
<url>http://maven.apache.org</url> | |
<dependencies> |
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
<?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.sakadream</groupId> | |
<artifactId>Java-Security-Sample</artifactId> | |
<version>1.0.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<maven.compiler.source>1.8</maven.compiler.source> |
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
<repositories> | |
<repository> | |
<id>YOUR-PROJECT-NAME-mvn-repo</id> | |
<url>https://raw.github.com/YOUR-USERNAME/YOUR-PROJECT-NAME/mvn-repo/</url> | |
<snapshots> | |
<enabled>true</enabled> | |
<updatePolicy>always</updatePolicy> | |
</snapshots> | |
</repository> | |
</repositories> |