Search code examples
jakarta-eeglassfisheclipse-rcpeclipse-rap

eclipse rcp/rap Java EE 6 security


I have a eclipse rcp/rap application and I want to connect to Java EE 6 EJBs... My problem is that in EJB I use some Java EE 6 standard security @RolesAllowed ... but I don't know how to implement this in RCP/RAP...???

I saw a way: java ee 6 enterprise application security

In web, all I have to do is to use servlet 3.0 request.login(user, pass)

Is it possible to have this feature in RCP/RAP... ?? I also want to check roles of users so that I know if a user have rights to see something...

Thank you in advance


Solution

  • I don't know about RCP, but for RAP, you should be able to do the same as in regular web apps. RAP 1.5 works with servlet 3.0.

    If you're using the Eclipse workbench, you're running in the SWT_COMPATIBILITY mode (see ApplicationConfiguration#setOperationMode()). That means you can only access the security context from a runnable in the request thread (see RWT#requestThreadExec()). In plain RAP applications that use the JEE_COMPATIBILITY mode, this is not necessary.