diff --git a/IdentityService/nbproject/build-impl.xml b/IdentityService/nbproject/build-impl.xml index f47cd5c329cb086de2afdaeea58ec6a16d55519b..d4bdbc5dd20ccd13261f24ab51ee45435d53fbc4 100644 --- a/IdentityService/nbproject/build-impl.xml +++ b/IdentityService/nbproject/build-impl.xml @@ -18,6 +18,7 @@ --> <project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="IdentityService-impl"> + <import file="rest-build.xml"/> <import file="ant-deploy.xml"/> <fail message="Please build using Ant 1.7.1 or higher."> <condition> diff --git a/IdentityService/nbproject/genfiles.properties b/IdentityService/nbproject/genfiles.properties index c5c18567210b4c8ae5e23ddccb39d6bd303f32a7..b5addbb27814048ce1cea96ddcb2bfd66b907d72 100644 --- a/IdentityService/nbproject/genfiles.properties +++ b/IdentityService/nbproject/genfiles.properties @@ -1,8 +1,11 @@ -build.xml.data.CRC32=1d45bd4f +build.xml.data.CRC32=686d0898 build.xml.script.CRC32=e342e6c3 build.xml.stylesheet.CRC32=651128d4@1.77.1.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=1d45bd4f -nbproject/build-impl.xml.script.CRC32=21e9d869 +nbproject/build-impl.xml.data.CRC32=686d0898 +nbproject/build-impl.xml.script.CRC32=86f3d309 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 +nbproject/rest-build.xml.data.CRC32=1d45bd4f +nbproject/rest-build.xml.script.CRC32=7681ab86 +nbproject/rest-build.xml.stylesheet.CRC32=0cfeebcc@1.31.1 diff --git a/IdentityService/nbproject/project.properties b/IdentityService/nbproject/project.properties index 08bfe2b1174409bbbef3806674717ce058170c9d..96807a8b0492fe67c5bb960f8addf4fd3a7afea2 100644 --- a/IdentityService/nbproject/project.properties +++ b/IdentityService/nbproject/project.properties @@ -1,5 +1,6 @@ annotation.processing.enabled=true annotation.processing.enabled.in.editor=true +annotation.processing.processor.options=-Aeclipselink.canonicalmodel.use_static_factory=false annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output @@ -53,7 +54,9 @@ javac.compilerargs= javac.debug=true javac.deprecation=false javac.processorpath=\ - ${javac.classpath} + ${javac.classpath}:\ + ${libs.eclipselink.classpath}:\ + ${libs.eclipselinkmodelgen.classpath} javac.source=1.8 javac.target=1.8 javac.test.classpath=\ @@ -77,6 +80,7 @@ lib.dir=${web.docbase.dir}/WEB-INF/lib persistence.xml.dir=${conf.dir} platform.active=default_platform resource.dir=setup +rest.config.type=ide run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} diff --git a/IdentityService/nbproject/project.xml b/IdentityService/nbproject/project.xml index 3c4f3dd97720aec5c46102d51d664ad818daf72d..06c99f8c5781f52b9a2b5a81c60466d21216a3d3 100644 --- a/IdentityService/nbproject/project.xml +++ b/IdentityService/nbproject/project.xml @@ -2,6 +2,9 @@ <project xmlns="http://www.netbeans.org/ns/project/1"> <type>org.netbeans.modules.web.project</type> <configuration> + <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1"> + <extension file="rest-build.xml" id="rest.5"/> + </buildExtensions> <data xmlns="http://www.netbeans.org/ns/web-project/3"> <name>IdentityService</name> <minimum-ant-version>1.6.5</minimum-ant-version> diff --git a/IdentityService/nbproject/rest-build.xml b/IdentityService/nbproject/rest-build.xml new file mode 100644 index 0000000000000000000000000000000000000000..37cd925f8cfe96dc4d872411618ffa49393d6ae4 --- /dev/null +++ b/IdentityService/nbproject/rest-build.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + *** GENERATED - DO NOT EDIT *** + --> +<project name="IdentityService-rest-build" basedir=".." xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:jaxrs="http://www.netbeans.org/ns/jax-rs/1"> + <target name="-check-trim"> + <condition property="do.trim"> + <and> + <isset property="client.urlPart"/> + <length string="${client.urlPart}" when="greater" length="0"/> + </and> + </condition> + </target> + <target name="-trim-url" if="do.trim"> + <pathconvert pathsep="/" property="rest.base.url"> + <propertyset> + <propertyref name="client.url"/> + </propertyset> + <globmapper from="*${client.urlPart}" to="*/"/> + </pathconvert> + </target> + <target name="-spare-url" unless="do.trim"> + <property name="rest.base.url" value="${client.url}"/> + </target> + <target name="test-restbeans" depends="run-deploy,-init-display-browser,-check-trim,-trim-url,-spare-url"> + <replace file="${restbeans.test.file}" token="${base.url.token}" value="${rest.base.url}||${rest.application.path}"/> + <condition property="do.browse-url"> + <istrue value="${display.browser}"/> + </condition> + <antcall target="browse-url"/> + </target> + <target name="browse-url" if="do.browse-url"> + <nbbrowse url="${restbeans.test.url}"/> + </target> +</project> diff --git a/IdentityService/src/conf/persistence.xml b/IdentityService/src/conf/persistence.xml new file mode 100644 index 0000000000000000000000000000000000000000..3555a7c8c5fb6c1e2acff894acdd1889be27aac3 --- /dev/null +++ b/IdentityService/src/conf/persistence.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> + <persistence-unit name="IdentityServicePU" transaction-type="JTA"> + <jta-data-source>java:app/account</jta-data-source> + <exclude-unlisted-classes>false</exclude-unlisted-classes> + <properties/> + </persistence-unit> +</persistence> diff --git a/IdentityService/src/java/validate/SignIn.java b/IdentityService/src/java/validate/SignIn.java index 574d8f850664a2959d6aa7c7c22d3ccb8bd20742..077239a1560620fff7ad13d3854e27808fe60a2e 100644 --- a/IdentityService/src/java/validate/SignIn.java +++ b/IdentityService/src/java/validate/SignIn.java @@ -57,7 +57,7 @@ public class SignIn extends HttpServlet { } try ( Connection conn = DriverManager.getConnection( - "jdbc:mysql://localhost:3306/Account?zeroDateTimeBehavior=convertToNull", + "jdbc:mysql://localhost:3306/account?zeroDateTimeBehavior=convertToNull", "root", ""); Statement stmt = conn.createStatement()) { @@ -78,24 +78,30 @@ public class SignIn extends HttpServlet { boolean ulang = true; PreparedStatement dbStatementCek; - while (ulang) { + //while (ulang) { token = new BigInteger(130, random).toString(32); - sqlCek = "SELECT * FROM token WHERE token = ?"; - dbStatementCek = conn.prepareStatement(sqlCek); - dbStatementCek.setString(1, token); - ResultSet rsCek = dbStatementCek.executeQuery(); - if (rsCek.next()) { - ulang = true; - } else { - ulang = false; - } - } + // sqlCek = "SELECT * FROM token WHERE token = ?"; + // dbStatementCek = conn.prepareStatement(sqlCek); + // dbStatementCek.setString(1, token); + // ResultSet rsCek = dbStatementCek.executeQuery(); + // if (rsCek.next()) { + // ulang = true; + // } else { + // ulang = false; + // } + //} Date dNow = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd"); SimpleDateFormat timeFormat = new SimpleDateFormat ("HH:mm:ss"); String time_expired = timeFormat.format(dNow); String date_expired = dateFormat.format(dNow); + json.put("id",rs.getInt("id")); + json.put("fullname",rs.getString("fullname")); + json.put("username",rs.getString("username")); + json.put("email",rs.getString("email")); + json.put("phone_no",rs.getString("phone_no")); + json.put("token",token); String sqlInputToken; sqlInputToken = "INSERT INTO token(id_account,token,date_expired,time_expired) VALUES(?,?,?,?)"; PreparedStatement dbStatementInputToken = conn.prepareStatement(sqlInputToken); @@ -103,14 +109,9 @@ public class SignIn extends HttpServlet { dbStatementInputToken.setString(2, token); dbStatementInputToken.setString(3, date_expired); dbStatementInputToken.setString(4, time_expired); - int rsInputToken = dbStatementInputToken.executeUpdate(); + dbStatementInputToken.executeUpdate(); - json.put("id",rs.getInt("id")); - json.put("fullname",rs.getString("fullname")); - json.put("username",rs.getString("username")); - json.put("email",rs.getString("email")); - json.put("phone_no",rs.getString("phone_no")); - json.put("token",token); + } else { boolean h = true; if (!h) { diff --git a/IdentityService/src/java/validate/ValidateToken.java b/IdentityService/src/java/validate/ValidateToken.java index eda45132fe90bad915263cde6c9b9ae48698e9e4..669ea49e68b794c304fb23f5cf19b313c61ec3f4 100644 --- a/IdentityService/src/java/validate/ValidateToken.java +++ b/IdentityService/src/java/validate/ValidateToken.java @@ -129,18 +129,16 @@ public class ValidateToken extends HttpServlet { json.put("id",rs.getInt("id")); json.put("fullname",rs.getString("fullname")); json.put("username",rs.getString("username")); - json.put("address",rs.getString("address")); - json.put("postalcode",rs.getString("postalcode")); - json.put("phonenumber",rs.getString("phonenumber")); - json.put("token",tokenExpires); + json.put("email",rs.getString("email")); + json.put("phone_no",rs.getString("phone_no")); + json.put("token",token); json.put("validate",2); } else { json.put("id",rs.getInt("id")); json.put("fullname",rs.getString("fullname")); json.put("username",rs.getString("username")); - json.put("address",rs.getString("address")); - json.put("postalcode",rs.getString("postalcode")); - json.put("phonenumber",rs.getString("phonenumber")); + json.put("email",rs.getString("email")); + json.put("phone_no",rs.getString("phone_no")); json.put("token",""); json.put("validate",1); } @@ -148,9 +146,8 @@ public class ValidateToken extends HttpServlet { json.put("id",0); json.put("fullname",""); json.put("username",""); - json.put("address",""); - json.put("postalcode",""); - json.put("phonenumber",""); + json.put("email",""); + json.put("phone_no",""); json.put("token",""); json.put("validate",3); } diff --git a/IdentityService/web/WEB-INF/glassfish-resources.xml b/IdentityService/web/WEB-INF/glassfish-resources.xml new file mode 100644 index 0000000000000000000000000000000000000000..f781b39e532e670227f83718379a8ea4e2e8e44d --- /dev/null +++ b/IdentityService/web/WEB-INF/glassfish-resources.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd"> +<resources> + <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_account_rootPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false"> + <property name="serverName" value="localhost"/> + <property name="portNumber" value="3306"/> + <property name="databaseName" value="account"/> + <property name="User" value="root"/> + <property name="Password" value=""/> + <property name="URL" value="jdbc:mysql://localhost:3306/account?zeroDateTimeBehavior=convertToNull"/> + <property name="driverClass" value="com.mysql.jdbc.Driver"/> + </jdbc-connection-pool> + <jdbc-resource enabled="true" jndi-name="java:app/account" object-type="user" pool-name="mysql_account_rootPool"/> +</resources> diff --git a/OjekOnlineWebservice/nbproject/build-impl.xml b/OjekOnlineWebservice/nbproject/build-impl.xml index 6e5efe80332ea2bc49aad455d7396cb1d9ea07bb..c8e3582f06739b1cb1c56471852660c295e6b42f 100644 --- a/OjekOnlineWebservice/nbproject/build-impl.xml +++ b/OjekOnlineWebservice/nbproject/build-impl.xml @@ -18,7 +18,6 @@ --> <project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="OjekOnlineWebservice-impl"> - <import file="jaxws-build.xml"/> <import file="ant-deploy.xml"/> <fail message="Please build using Ant 1.7.1 or higher."> <condition> diff --git a/OjekOnlineWebservice/nbproject/genfiles.properties b/OjekOnlineWebservice/nbproject/genfiles.properties index 6a9c26564b96663dd5f8522476188f43d275ce77..06754af887d5e9f7f4a4895b85eeeda5714352e6 100644 --- a/OjekOnlineWebservice/nbproject/genfiles.properties +++ b/OjekOnlineWebservice/nbproject/genfiles.properties @@ -1,9 +1,9 @@ -build.xml.data.CRC32=7ab6bb81 +build.xml.data.CRC32=6b137e31 build.xml.script.CRC32=4d0c4679 build.xml.stylesheet.CRC32=651128d4@1.77.1.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=7ab6bb81 -nbproject/build-impl.xml.script.CRC32=580298ae +nbproject/build-impl.xml.data.CRC32=6b137e31 +nbproject/build-impl.xml.script.CRC32=52b430c8 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 nbproject/jaxws-build.xml.stylesheet.CRC32=6608c2cf diff --git a/OjekOnlineWebservice/nbproject/jax-ws.xml b/OjekOnlineWebservice/nbproject/jax-ws.xml index 9175d5f7daaf33bba50835e5bcf6afd093ed0e7b..0c9842be221eb11c69d58a4948973a4aeb48a226 100644 --- a/OjekOnlineWebservice/nbproject/jax-ws.xml +++ b/OjekOnlineWebservice/nbproject/jax-ws.xml @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <jax-ws xmlns="http://www.netbeans.org/ns/jax-ws/1"> <services> - <service name="OjekWS"> - <implementation-class>org.me.ojek.OjekWS</implementation-class> - </service> </services> <clients/> </jax-ws> diff --git a/OjekOnlineWebservice/nbproject/jaxws-build.xml b/OjekOnlineWebservice/nbproject/jaxws-build.xml deleted file mode 100644 index 8bb19e719dc7ea18a8be4c882fb5679ee645ae91..0000000000000000000000000000000000000000 --- a/OjekOnlineWebservice/nbproject/jaxws-build.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><!-- - *** GENERATED FROM jax-ws.xml - DO NOT EDIT ! *** - *** TO MODIFY wsimport options USE Web Service node -> Edit WS Attributes *** - *** TO CHANGE TARGETS GENERATED TO jaxws-build.xml COPY THOSE *** - *** TARGETS TO ../build.xml AND MODIFY THAT FILE INSTEAD *** - - --><project xmlns:xalan="http://xml.apache.org/xslt" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1"> - <!-- - =================== - JAX-WS WSGEN SECTION - =================== - --> - <target name="wsgen-init" depends="init, -do-compile"> - <mkdir dir="${build.generated.sources.dir}/jax-ws/resources/"/> - <mkdir dir="${build.classes.dir}"/> - <mkdir dir="${build.classes.dir}/META-INF"/> - <property name="j2ee.platform.wsgen.classpath" value="${libs.jaxws21.classpath}"/> - <taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen"> - <classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}"/> - </taskdef> - </target> - <target name="wsgen-OjekWS" depends="wsgen-init"> - <copy todir="${build.classes.dir}/META-INF"> - <fileset dir="${webinf.dir}" includes="wsit-org.me.ojek.OjekWS.xml"/> - </copy> - <wsgen sourcedestdir="${build.generated.sources.dir}/jax-ws" resourcedestdir="${build.generated.sources.dir}/jax-ws/resources/" destdir="${build.generated.sources.dir}/jax-ws" verbose="true" keep="true" genwsdl="true" sei="org.me.ojek.OjekWS" xendorsed="true"> - <classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}"/> - </wsgen> - </target> - <!-- - =================== - JAX-WS WSIMPORT SECTION - =================== - --> -</project> diff --git a/OjekOnlineWebservice/nbproject/project.xml b/OjekOnlineWebservice/nbproject/project.xml index 4b61eb402d658290a1c2313cd44fd8eaa8dce69e..fa910d8033cba386764548cb3cb6a6b245d21416 100644 --- a/OjekOnlineWebservice/nbproject/project.xml +++ b/OjekOnlineWebservice/nbproject/project.xml @@ -2,9 +2,7 @@ <project xmlns="http://www.netbeans.org/ns/project/1"> <type>org.netbeans.modules.web.project</type> <configuration> - <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1"> - <extension file="jaxws-build.xml" id="jaxws"/> - </buildExtensions> + <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1"/> <data xmlns="http://www.netbeans.org/ns/web-project/3"> <name>OjekOnlineWebservice</name> <minimum-ant-version>1.6.5</minimum-ant-version> diff --git a/OjekOnlineWebservice/src/java/Account/accountObject.java b/OjekOnlineWebservice/src/java/Account/accountObject.java deleted file mode 100644 index 419851647592d9003f8eccd27340c8930aee8d24..0000000000000000000000000000000000000000 --- a/OjekOnlineWebservice/src/java/Account/accountObject.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Account; - -import javax.xml.bind.annotation.*; - -/** - * - * @author raudi - */ -@XmlRootElement(name = "accountObject") -public class accountObject { - @XmlElement(name="fullname", required=true) - private String fullname; - @XmlElement(name="username", required=true) - private String username; - @XmlElement(name="email", required=true) - private String email; - @XmlElement(name="phonenumber", required=true) - private String phonenumber; - @XmlElement(name="token", required=true) - private String token; - @XmlElement(name="validate", required=true) - private int validate; - - public accountObject() { - fullname = ""; - username = ""; - email = ""; - phonenumber = ""; - token = ""; - validate = 0; - } - - public accountObject(int id, String fullname, String username, String email, - String postalcode, String phonenumber, String token, int validate) { - this.fullname = fullname; - this.username = username; - this.email = email; - this.phonenumber = phonenumber; - this.token = token; - this.validate = validate; - } - - public String getFullname(){ - return fullname; - } - - public String getUsername() { - return username; - } - - public String getEmail() { - return email; - } - - public String getPhonenumber() { - return phonenumber; - } - - public String getToken() { - return token; - } - - public int getValidate() { - return validate; - } -} diff --git a/OjekOnlineWebservice/src/java/org/me/ojek/OjekWS.java b/OjekOnlineWebservice/src/java/org/me/ojek/OjekWS.java deleted file mode 100644 index c9c4a90fd0258b59ce024f518bc8ada8810daaec..0000000000000000000000000000000000000000 --- a/OjekOnlineWebservice/src/java/org/me/ojek/OjekWS.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.me.ojek; - -import javax.jws.WebService; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.ejb.Stateless; - -/** - * - * @author TIFAH06 - */ -@WebService(serviceName = "OjekWS") -@Stateless() -public class OjekWS { - - /** - * This is a sample web service operation - */ - @WebMethod(operationName = "hello") - public String hello(@WebParam(name = "name") String txt) { - return "Hello " + txt + " !"; - } -} diff --git a/OjekOnlineWebservice/web/WEB-INF/glassfish-resources.xml b/OjekOnlineWebservice/web/WEB-INF/glassfish-resources.xml new file mode 100644 index 0000000000000000000000000000000000000000..f781b39e532e670227f83718379a8ea4e2e8e44d --- /dev/null +++ b/OjekOnlineWebservice/web/WEB-INF/glassfish-resources.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd"> +<resources> + <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_account_rootPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false"> + <property name="serverName" value="localhost"/> + <property name="portNumber" value="3306"/> + <property name="databaseName" value="account"/> + <property name="User" value="root"/> + <property name="Password" value=""/> + <property name="URL" value="jdbc:mysql://localhost:3306/account?zeroDateTimeBehavior=convertToNull"/> + <property name="driverClass" value="com.mysql.jdbc.Driver"/> + </jdbc-connection-pool> + <jdbc-resource enabled="true" jndi-name="java:app/account" object-type="user" pool-name="mysql_account_rootPool"/> +</resources> diff --git a/WebApp/web/index.jsp b/WebApp/web/index.jsp index ccf1f1c1e205117b327a056e1422c074c85a3dee..fe07c470eaeb4164d094c4d31c7129b512cfeaea 100644 --- a/WebApp/web/index.jsp +++ b/WebApp/web/index.jsp @@ -62,7 +62,6 @@ } con.setRequestProperty("User-Agent", USER_AGENT); con.setRequestProperty("Accept-Language", "en-US,en;q=0.5"); - String urlParameters = "username="+username+"&password="+password; // Send post request @@ -92,6 +91,7 @@ } JSONObject JSobjek = null; + out.println(responsebuff.toString()); try { new JSONObject(responsebuff.toString()); } catch (JSONException ex) { @@ -100,7 +100,6 @@ try { new JSONArray(responsebuff.toString()); } catch (JSONException ex1) { - } } if (JSobjek!=null) { @@ -143,7 +142,7 @@ <body> <div class="login" id="form-login"> <h2 class="title">---LOGIN---</h2> - <form name="form-login" action="profile.jsp" method="post"> + <form name="form-login" action="index.jsp" method="post"> <div class="input-form"> <div class="label"> <p style="width: 120px;">Username</p> diff --git a/data/derby.log b/data/derby.log index 76333dcd8fb305d2b67e86e12c74e3d34bf2062f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/data/derby.log +++ b/data/derby.log @@ -1 +0,0 @@ -Wed Nov 08 18:03:05 ICT 2017 : Apache Derby Network Server - 10.11.1.2 - (1629631) started and ready to accept connections on port 1527