I’ll try to keep this short and sweet, so, basically, I’ve just got myself a job where I’m using Java for our back end language, so far I’ve just been learning on the job and I’ve been learning a few bits and pieces in my own time.
I’m currently looking into the whole setup of a JEE project, for a test project, I’ve setup a basic web module project (war), and I’m using Tomcat 7. I’m just trying to get to grips with the basics at the moment, I’m hardly trying to master everything instantly, and it’s no lie that the ecosystem for JEE is pretty darn huge.
With my test project, I’m looking to have the following setup
- Roles Allowed
- Declare Roles
- MySQL DB
So far I’ve only done JAX-RS because of how incredibly easy that is to set up and I’ve not really had much time to tinker with my test project. I was just wondering how hard/annoying/awkward is it to get the rest of my requirements setup?
I looked a bit into using roles, and it seems that some resources that I’ve found are incredibly in depth and talk deeply about JAAS, whereas for this project I simply want to be able to query a DB, get some user through an entity class. Then use the roles allowed annotation based on that entity class, I should also mention, I’m trying to build a near enough 100% restul web application here, so I do not want to be storing anything within the session, I’m using load balancing techniques for that, so it’s not a problem!
All I really want from this test application is to make a basic back end with a bunch of end points that just chucks out some data. I’ve played around with the pom.xml, web.xml file and I’ve looked into the xml files that come into play with the application server of choice too. I’ve seen a very nice way in which you can use the roles annotation with WildFly, there was a block of XML that ran a query and set the allowed role that way… But I can’t remember it off the top of my head, nor can I remember the resource I found it on, in regards to the roles annotation, I was wondering if there’s a way to do it in some Java class rather than through XML…
That’s my only pet hate about the whole JEE game so far is that there’s a lot of XML/XHTML, especially if you use JSP/JSF, although personally I’m going to stay away from JSP/JSF as I want to build a SPA for the front end.