What does Exploded Development mean? (In Java)

Yes exploded means than instead of deploying a WAR/EAR file to your application server to test your application you point your application server at a folder containing the unzipped (exploded) contents of what would be inside the WAR/EAR file. This makes development quicker as most application servers support Hot Deploy where you can change the … Read more

CDI: beans.xml, where do I put you?

For EJB and JAR packaging you should place the beans.xml in src/main/resources/META-INF/. For WAR packaging you should place the beans.xml in src/main/webapp/WEB-INF/. Remember that only .java files should be put in the src/main/java and src/test/java directories. Resources like .xml files should be in src/main/resources.

Where can I download Java EE 6 Tutorial Examples? [closed]

I too couldn’t see the tutorial files in the update tool. The download link given by shurik2533 are the tutorial files for JavaEE5, not JavaEE6. Working on what John put I downloaded the files from the svn repository using: $ svn export https://svn.java.net/svn/javaeetutorial~svn JavaEE6tutorial/ To download only the examples: $ svn export https://svn.java.net/svn/javaeetutorial~svn/branches/javaee-tutorial-6/examples/ JavaEE6TutorialExamples

Spring security’s SecurityContextHolder: session or request bound?

It depends on how you configured it (or lets say, you can configure a different behaviour). In a Web application you will use the ThreadLocalSecurityContextHolderStrategy which interacts with SecurityContextPersistenceFilter. The Java Doc of SecurityContextPersistenceFilter starts with: Populates the {@link SecurityContextHolder} with information obtained from the configured {@link SecurityContextRepository} prior to the request and stores it … Read more

Get ServletContext in JAX-RS resource

Furthermore, @Resource annotation might not work. Try this @javax.ws.rs.core.Context ServletContext context; The injection doesn’t happen until you hit the service method public class MyService { @Context ServletContext context; public MyService() { print(“Constructor ” + context); // null here } @GET @Path(“/thing”) { print(“in wizard service ” + context); // available here

Use Enum type as a value parameter for @RolesAllowed-Annotation

How about this? public enum RoleType { STUDENT(Names.STUDENT), TEACHER(Names.TEACHER), DEANERY(Names.DEANERY); public class Names{ public static final String STUDENT = “Student”; public static final String TEACHER = “Teacher”; public static final String DEANERY = “Deanery”; } private final String label; private RoleType(String label) { this.label = label; } public String toString() { return this.label; } } … Read more

Session TimeOut in web.xml

To set a session-timeout that never expires is not desirable because you would be reliable on the user to push the logout-button every time he’s finished to prevent your server of too much load (depending on the amount of users and the hardware). Additionaly there are some security issues you might run into you would … Read more

Recommendations for java captcha libraries [closed]

I am the author of SimpleCaptcha. While I would recommend — for humanity’s sake — using ReCaptcha where you can, I provided SimpleCaptcha because some organizations have policies which prohibit libraries like ReCaptcha. SimpleCaptcha is meant to be entirely stand-alone, with no external dependencies: as long as you are in a J2EE container, you should … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)