JavaEE Tutorials, Tips & Tricks

J2EE is an open standard, pioneered by Sun Microsystems, for creating and delivering multi-tiered enterprise applications in the Java language.

Struts 2 Action Chaining example

In Struts 2, sometimes you may want to process another action when one action completes. For example on successfully submitting a form you want to render output from other action.This is called Action chaining in Struts 2. One action leads to another one and so on.Request > Action 1 > Action 2 > ResponseIn Struts ...

How to update JSTL Locale dynamically

How to update JSTL Locale dynamically
When you use JSTL format tag <fmt:formatDate> and <fmt:formatNumber>, JSTL automatically takes care of locale resolution. Depending on the browser's locale setting JSTL will display the date and numbers.You may want to override this default behavior. For example in case where you want to display date format only in en_US locale irrespective of user locale setting of browser. Or you may want to store user ...
Tags: , ,

Maven: How to Remove/Ignore Transitive Dependency

If you use Maven in your project for dependency management and if you use it a lot then sometimes you get into weird classpath issues where more than one version of JAR is loaded. Most of times I have got into issues related to cglib library. If two versions of cglibs, like cglib-2.1.1.jar and cglib-nodep.jar ...

Struts2 + FreeMarker Tempalte (FTL) Integration example

Struts2 + FreeMarker Tempalte (FTL) Integration example
Welcome to Freemarker Tutorial Series. In previous post we created Spring MVC based Hello World Freemarker Template example. We learned few APIs of freemarker and also how to integrate it with Spring MVC based application. Following are the list of tutorials from Freemarker tutorial series.Today we will create a Struts2 based application that uses Freemarker FTL as view instead of JSP. This would give ...

org.hibernate.AnnotationException: No identifier specified for entity

When you are writing a piece of code from scratch a lot of time you do silly mistakes and still wonder why its not working. Well same thing happened the other day when I added a Hibernate Entity class in one project and was struggling to make it work.The exception was:org.hibernate.AnnotationException: No identifier specified for entity: net.viralpatel.hibernate.Employee at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:650) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:498) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1112) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:416) at ...

Play Framework Modules: Divide and Conquer

It's usually the case that you start developing an application and go on fulfilling requirements. When your application grows bigger you start to realize the convenience of separating it into different components. Moreover, when you develop your second or third application, your begin to recognize certain features that could be reused across different applications.These are two ...

Hibernate Inheritance: Table Per Concrete Class (Annotation & XML mapping)

Hibernate Inheritance: Table Per Concrete Class (Annotation & XML mapping)
Welcome to Hibernate Tutorial Series. In previous tutorials we saw how to implement Inheritance in Hibernate: One Table per Subclass.Today we will see how to implement Hibernate Inheritance: One Table per Concrete Class scheme.You may want to look at previous tutorials. Here is the complete list for you.Introduction to Inheritance in Hibernate Java is an object oriented language. It is possible to implement Inheritance in Java. ...

Hibernate Inheritance: Table Per Subclass (Annotation & XML mapping)

Hibernate Inheritance: Table Per Subclass (Annotation & XML mapping)
Welcome to Hibernate Tutorial Series. In previous tutorials we saw how to implement Inheritance in Hibernate: One Table Per Hierarchy.Today we will see how to implement Hibernate Inheritance: One Table per Subclass scheme.You may want to look at previous tutorials. Here is the complete list for you.Introduction to Inheritance in Hibernate Java is an object oriented language. It is possible to implement Inheritance in Java. Inheritance ...

Struts 2 Tip: Override Default Theme

Recently I came up with a requirement in Struts 2 to display a particular form with some style and alignment. While creating the form the developer had used Struts 2's taglib /struts-tags to paint the user controls like textboxes and select boxes.For example:<s:form action="add" method="post"> <s:textfield name="contact.firstName" label="Firstname"/> <s:textfield name="contact.lastName" label="Lastname"/> </s:form>Now it turns of that Struts 2 parse these s: tags and generate HTML tags like <INPUT> ...

Hibernate Inheritance: Table Per Class Hierarchy (Annotation & XML Mapping)

Hibernate Inheritance: Table Per Class Hierarchy (Annotation & XML Mapping)
Welcome to Hibernate Tutorial Series. In previous tutorials we saw how to implement Relationship Mapping in Hibernate. We saw different mapping techniques like One to Many, Many to Many using both Annotations and XML mapping.Today we will see how the Inheritance is managed in Hibernate.You may want to look at previous tutorials. Here is the complete list for you.Introduction to Inheritance in Hibernate Java ...
Page 1 of 612345...Last »