Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Securing WebLogic Server 12c

You're reading from   Securing WebLogic Server 12c Learn to develop, administer and troubleshoot for WebLogic Server with this book and ebook.

Arrow left icon
Product type Paperback
Published in Nov 2012
Publisher Packt
ISBN-13 9781849687782
Length 100 pages
Edition 1st Edition
Concepts
Arrow right icon
Toc

A RESTful and secure EJB component


Java EE 6 not only allows us to package EJBs into their own module, but also to deploy our Beans directly into the WAR module that will use them. We will see how to secure both of these scenarios.

Bean packaged into the WAR module

Often, we don't need to package Enterprise Beans into a separated module; we can collocate them inside the same WAR client module and simplify our application architecture. Now, we will develop a simple EJB that will be injected into the existing MyProtectedServlet class. We will also see the security context to be passed and the configuration we need to do.

Let's start simple; we can code this really simple Stateless Bean with no interface view, as shown in the following code snippet:

package net.lucamasini.security;

import javax.ejb.Stateless;

@Stateless
public class NoInterfaceBeanInWarModule {
    public String echo(String input) {
        return "$"+input+"$";
    }
}

This Java file must be in the same folder containing our...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime