Spring vs Java EE 7 [closed]

I will share little bit of what I know about using Spring. You are right by saying that Java EE 7 has all the technologies to help solve the problems. Well Spring just enhances these capabilities and makes life more easier for a developer. As an example when you use Spring MVC framework you can … Read more

Accessing HttpSession from HttpServletRequest in a Web Socket @ServerEndpoint

Update (November 2016): The information provided in this answer is for the JSR356 spec, individual implementations of the spec may vary outside of this information. Other suggestions found in comments and other answers are all implementation specific behaviors outside of the JSR356 spec. If the suggestions in here are causing you problems, upgrade your various … Read more

What is the significance of @javax.persistence.Lob annotation in JPA?

@javax.persistence.Lob signifies that the annotated field should be represented as BLOB (binary data) in the DataBase. You can annotate any Serializable data type with this annotation. In JPA, upon persisting (retrieval) the field content will be serialized (deserialized) using standard Java serialization. Common use of @Lob is to annotate a HashMap field inside your Entity … Read more

How to get a method’s annotation value from a ProceedingJoinPoint?

You can get the Signature from a ProceedingJoinPoint and in case of a method invocation just cast it to a MethodSignature. @Around(“execution(public * *(..)) && @annotation(com.mycompany.MyAnnotation)”) public Object procede(ProceedingJoinPoint call) throws Throwable { MethodSignature signature = (MethodSignature) call.getSignature(); Method method = signature.getMethod(); MyAnnotation myAnnotation = method.getAnnotation(MyAnnotation.class); } But you should first add an annotation attribute. … Read more

What is WEB-INF used for in a Java EE web application?

The Servlet 2.4 specification says this about WEB-INF (page 70): A special directory exists within the application hierarchy named WEB-INF. This directory contains all things related to the application that aren’t in the document root of the application. The WEB-INF node is not part of the public document tree of the application. No file contained … Read more