Skip to content

Commit b71d359

Browse files
author
Reza Rahman
committed
Simplify repository structure.
1 parent ff9ba77 commit b71d359

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+89
-77
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
.classpath
88
.project
99
.settings
10-
**/target
10+
target

README.md

Lines changed: 46 additions & 5 deletions

javaee-javascript-main/README.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

javaee-javascript-main/create-javascript-realm.bat

Lines changed: 0 additions & 2 deletions
This file was deleted.

javaee-javascript-main/src/main/resources/META-INF/persistence.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.
File renamed without changes.

javaee-javascript-main/pom.xml renamed to pom.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@
4040
* holder.
4141
*/
4242
-->
43-
<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">
43+
<project xmlns="http://maven.apache.org/POM/4.0.0"
44+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
45+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4446
<modelVersion>4.0.0modelVersion>
4547

4648
<groupId>org.glassfishgroupId>
47-
<artifactId>javaee-javascript-mainartifactId>
49+
<artifactId>javaee-javascriptartifactId>
4850
<version>1.0-SNAPSHOTversion>
4951
<packaging>warpackaging>
5052

51-
<name>javaee-javascript-mainname>
53+
<name>javaee-javascriptname>
5254

5355
<properties>
5456
<endorsed.dir>${project.build.directory}/endorsedendorsed.dir>
@@ -69,17 +71,18 @@
6971
<version>2.0version>
7072
<type>jartype>
7173
<scope>providedscope>
72-
dependency>
74+
dependency>
7375
<dependency>
7476
<groupId>org.glassfish.jersey.mediagroupId>
7577
<artifactId>jersey-media-moxyartifactId>
7678
<version>2.2version>
7779
<type>jartype>
7880
<scope>providedscope>
79-
dependency>
81+
dependency>
8082
dependencies>
8183

8284
<build>
85+
<finalName>javaee-javascriptfinalName>
8386
<plugins>
8487
<plugin>
8588
<groupId>org.apache.maven.pluginsgroupId>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
xml version="1.0" encoding="UTF-8"?>
2+
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
3+
<persistence-unit name="javaee-javascript-unit">
4+
<properties>
5+
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
6+
<property name="javax.persistence.schema-generation.create-source" value="metadata-then-script"/>
7+
<property name="javax.persistence.schema-generation.drop-source" value="metadata-then-script"/>
8+
<property name="javax.persistence.schema-generation.create-script-source" value="create-script.sql"/>
9+
<property name="javax.persistence.schema-generation.drop-script-source" value="drop-script.sql"/>
10+
<property name="javax.persistence.sql-load-script-source" value="load-script.sql"/>
11+
<property name="eclipselink.logging.level" value="FINEST"/>
12+
properties>
13+
persistence-unit>
14+
persistence>
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
xml version="1.0" encoding="UTF-8"?>
2-
DOCTYPE glassfish-web-app PUBLIC
3-
"-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN"
4-
"http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
5-
<glassfish-web-app>
6-
<context-root>javaee-javascript-maincontext-root>
2+
DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
3+
<glassfish-web-app error-url="">
4+
<context-root>javaee-javascriptcontext-root>
75
<security-role-mapping>
86
<role-name>javascriptrole-name>
97
<group-name>javascriptgroup-name>
@@ -14,4 +12,4 @@
1412
<description>Keep a copy of the generated servlet class' java code.description>
1513
property>
1614
jsp-config>
17-
glassfish-web-app>
15+
glassfish-web-app>

javaee-javascript-main/src/main/webapp/WEB-INF/web.xml renamed to src/main/webapp/WEB-INF/web.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<user-data-constraint>
4343
<transport-guarantee>CONFIDENTIALtransport-guarantee>
4444
user-data-constraint>
45-
security-constraint>
45+
security-constraint>
4646
<deny-uncovered-http-methods/>
4747
<login-config>
4848
<auth-method>BASICauth-method>

javaee-javascript-main/src/main/webapp/backend.html renamed to src/main/webapp/backend.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@

Java EE as JavaScript Backend

1010
API for WebSocket, JSON-P, JAX-RS 2 and Java EE 7.p>
1111
<p>Note that while the endpoints in this application are not fully secured
1212
but uses TLS/SSL, in a real application they should be secured, likely using
13-
some sort of federated security.p>
13+
some sort of federated security scheme.p>
1414
<p>The WebSocket chat endpoint is at:
15-
<a href="wss://localhost:8181/javaee-javascript-main/chat">
16-
wss://localhost:8181/javaee-javascript-main/chata>. The
15+
<a href="wss://localhost:8181/javaee-javascript/chat">
16+
wss://localhost:8181/javaee-javascript/chata>. The
1717
endpoint communicates via JSON. Once connected, a client
1818
can send a chat message using this format:
1919
<pre>
@@ -31,13 +31,13 @@

Java EE as JavaScript Backend

3131
"timestamp": "the server timestamp - MM/dd/yyyy h:mm:ss a z"}
3232
pre>
3333
p>
34-
<p>The REST endpoint is available at <a href="https://localhost:8181/javaee-javascript-main/resources/todo">
35-
https://localhost:8181/javaee-javascript-main/resources/todoa>. The
34+
<p>The REST endpoint is available at <a href="https://localhost:8181/javaee-javascript/resources/todo">
35+
https://localhost:8181/javaee-javascript/resources/todoa>. The
3636
REST endpoint also communicates with the client using JSON.
3737
To do items are stored under various usernames. To retrieve
3838
the current to do items for a given user, the client must issue
39-
a GET request to this URL: <a href="https://localhost:8181/javaee-javascript-main/resources/todo/{username}">
40-
https://localhost:8181/javaee-javascript-main/resources/todo/{username}a>.
39+
a GET request to this URL: <a href="https://localhost:8181/javaee-javascript/resources/todo/{username}">
40+
https://localhost:8181/javaee-javascript/resources/todo/{username}a>.
4141
The server will respond with the list of current to do items for the
4242
user following this format:
4343
<pre>
@@ -50,26 +50,26 @@

Java EE as JavaScript Backend

5050
...]
5151
pre>
5252
To add an item for a user, the client must issue a POST request to
53-
this URL: <a href="https://localhost:8181/javaee-javascript-main/resources/todo/{username}">
54-
https://localhost:8181/javaee-javascript-main/resources/todo/{username}a>.
53+
this URL: <a href="https://localhost:8181/javaee-javascript/resources/todo/{username}">
54+
https://localhost:8181/javaee-javascript/resources/todo/{username}a>.
5555
The POST body must follow this format:
5656
<pre>
5757
{"description": "item description"}
5858
pre>
5959
An ID will be automatically assigned and the item will be assumed to be
6060
incomplete. The POST response will return the ID assigned to the item as plain text (not JSON).
6161
To modify a to do item, the client must issue a PUT
62-
request to this URL: <a href="https://localhost:8181/javaee-javascript-main/resources/todo/{username}/{id}">
63-
https://localhost:8181/javaee-javascript-main/resources/todo/{username}/{id}a>.
62+
request to this URL: <a href="https://localhost:8181/javaee-javascript/resources/todo/{username}/{id}">
63+
https://localhost:8181/javaee-javascript/resources/todo/{username}/{id}a>.
6464
The PUT request body must follow this format:
6565
<pre>
6666
{"id": "to do item ID",
6767
"description": "item description",
6868
"completed": "true|false"}
6969
pre>
7070
To delete a to do item, the client must issue a DELETE request to
71-
this URL: <a href="https://localhost:8181/javaee-javascript-main/resources/todo/{username}/{id}">
72-
https://localhost:8181/javaee-javascript-main/resources/todo/{username}/{id}a>.
71+
this URL: <a href="https://localhost:8181/javaee-javascript/resources/todo/{username}/{id}">
72+
https://localhost:8181/javaee-javascript/resources/todo/{username}/{id}a>.
7373
p>
7474
body>
7575
html>

javaee-javascript-main/src/main/webapp/javascript/chat/services.js renamed to src/main/webapp/javascript/chat/services.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var chatServices = angular.module('chatServices', []);
44

55
chatServices.factory('Chat', [function() {
66
return new function() {
7-
var websocket = new WebSocket('wss://localhost:8181/javaee-javascript-main/chat');
7+
var websocket = new WebSocket('wss://localhost:8181/javaee-javascript/chat');
88
this.send = function(sender, value) {
99
websocket.send(JSON.stringify({user: sender, message: value}));
1010
};

javaee-javascript-main/src/main/webapp/javascript/todo/services.js renamed to src/main/webapp/javascript/todo/services.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ var todoServices = angular.module('todoServices', ['ngResource']);
55
todoServices.factory('ToDo', ['$resource',
66
function($resource) {
77
return $resource(
8-
'https://localhost:8181/javaee-javascript-main/resources/todo/:userId/:itemId',
8+
'https://localhost:8181/javaee-javascript/resources/todo/:userId/:itemId',
99
{userId: principal, itemId: '@id'}, {'update': {method: 'PUT'}});
1010
}]);

0 commit comments

Comments
 (0)