Book Image

Java EE 8 Development with Eclipse - Third Edition

By : Ram Kulkarni
Book Image

Java EE 8 Development with Eclipse - Third Edition

By: Ram Kulkarni

Overview of this book

Java EE is one of the most popular tools for enterprise application design and development. With recent changes to Java EE 8 specifications, Java EE application development has become a lot simpler with the new specifications, some of which compete with the existing specifications. This guide provides a complete overview of developing highly performant, robust and secure enterprise applications with Java EE with Eclipse. The book begins by exploring different Java EE technologies and how to use them (JSP, JSF, JPA, JDBC, EJB, and more), along with suitable technologies for different scenarios. You will learn how to set up the development environment for Java EE applications and understand Java EE specifications in detail, with an emphasis on examples. The book takes you through deployment of an application in Tomcat, GlassFish Servers, and also in the cloud. It goes beyond the basics and covers topics like debugging, testing, deployment, and securing your Java EE applications. You'll also get to know techniques to develop cloud-ready microservices in Java EE.
Table of Contents (20 chapters)
Title Page
Copyright and Credits
Dedication
Packt Upsell
Free Chapter
1
Introducing JEE and Eclipse
Index

Securing web services


The process of securing web services is similar to that of protecting a web URL, and we have seen two examples of that in previous sections. We specify <security-constraint> and <login-config> in web.xml. Let’s see how to protect the REST web service we developed in Chapter 9, Creating Web Services:

  1. Copy and import the CourseManagementREST and CourseManagementRESTClient projects from Chapter09 into the workspace for this chapter. As the names suggests, the first project is the REST service, and the second project is a standalone client application that calls the web service.
  2. Deploy the CourseManagementREST project in Tomcat (see the previous section for details on how to do this).
  3. Make sure the testGetCoursesJSON method is called from the main method in CourseManagementClient.java from the CourseManagementRESTClient project.
  4. Run the application (right-click on the file in Project Explorer and select Run As | Java Application), and verify that the service is...