Giter Site home page Giter Site logo

zedbeit / javaee-javascript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from m-reza-rahman/javaee-javascript

0.0 0.0 0.0 47 KB

This project demonstrates how you can utilize today's most popular JavaScript frameworks like Angular, Backbone, Knockout and Ember to utilize the core strengths of Java EE using JAX-RS, JSR 356/WebSocket, JSON-P, CDI and Bean Validation. We will also include Oracle's own JavaScript solution named project Avatar.

License: Other

Java 74.51% CSS 4.84% JavaScript 10.74% HTML 9.91%

javaee-javascript's Introduction

Using JavaScript/HTML5 Rich Clients with Java EE 7

This project demonstrates how you can utilize today's most popular JavaScript frameworks like Angular, Backbone, Knockout and Ember to utilize the core strengths of Java EE.

It is a Java EE 7 server-side application with an AngularJS front-end consisting of a chat application (powered by WebSocket) and a to-do list application (powered by REST). The server-side is implemented using the Java API for WebSocket, JSON-P, JAX-RS 2, CDI, Bean Validation, EJB 3 and JPA.

The application is secured. Before running the application, you must setup the right GlassFish security realm using the instructions below. You can also set the username/passwords via the database scripts in the source code. The passwords are stored as SHA-256 hashes. The current users are reza, nicole and zehra. The passwords are set to secret1. When using the application, the browser will warn you about the self-signed SSL certificate that GlassFish uses by default. Simply ignore the warning, it's harmless.

The project is in standard Maven format. You should be able to open it using any IDE that supports Maven and run it using any Java EE 7 container. However, we used NetBeans and GlassFish 4. Note that the project uses the default Derby database that comes with GlassFish.

Setup Instructions

Here are the instructions to get up and running using NetBeans and GlassFish:

  • Install JDK 7
  • Install GlassFish 4+
  • Install the NetBeans 7.4+ Java EE version (GlassFish 4.1+ will only work with NetBeans 8.0.1+)
  • Setup GlassFish in NetBeans (make sure Derby is started with GlassFish)
  • Make sure you have GlassFish up and running.
  • Execute the following asadmin command to remove any conflicting authentication realms you might have. A conflict is unlikely, so the command will probably fail, which is fine.
asadmin delete-auth-realm javascript-realm
  • For GlassFish versions up to GlassFish 4.1 (but not including it) execute the following asadmin command to create the authentication realm we need:
asadmin create-auth-realm --classname com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm --property jaas-context=jdbcRealm:datasource-jndi=jdbc/__default:user-table=javascript_users:user-name-column=username:password-column=password:group-table=javascript_groups:group-name-column=group_name javascript-realm
  • For GlassFish 4.1 and above execute the following asadmin command:
asadmin create-auth-realm --classname com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm --property jaas-context=jdbcRealm:datasource-jndi=jdbc/__default:user-table=javascript_users:user-name-column=username:password-column=password:group-table=javascript_groups:group-name-column=group_name javascript-realm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.