TheaSolutions Java JEE code snippets and Tutorials

Blogs providing code snippets and tutorials

WAR or EAR deployment versus exploded folder deplo...

Karthik's weblog JEE | Sunday November 16, 2008 | By Karthik

When should we go for an archive [war or ear] deployment rather than exploded folder deployment in production environment? Read more on this at http://javalegion.blogspot.com/2008/11/war-or-ear-deployment-versus-exploded.html

NetBeans code templates - expand shortcut auto com...

Karthik's weblog IDE - NetBeans and Eclipse | Sunday November 16, 2008 | By Karthik

Learn how to use shortcut keys for auto completion for common code templates like try catch block or System.out.println http://javalegion.blogspot.com/2008/11/netbeans-code-templates-expand-shortcut.html

How to read values from properties file in JBoss S...

Karthik's weblog JBoss-Seam | Sunday November 16, 2008 | By Karthik

This link provides code snippets explaining how to read values from property files in JBoss Seam http://javalegion.blogspot.com/2008/11/how-to-read-values-from-properties-file.html

How to find transitive dependency in Maven

Karthik's weblog Maven | Sunday November 16, 2008 | By Karthik

Maven packs the transitive dependencies also into the archive files. We can exclude specific transitive dependencies by using <exclusions> To list transitive dependencies that are packed into the archive file, there is maven-dependency-plugin . Include...

How to debug in Tomcat 6 plus and JBoss 4.2.x usin...

Karthik's weblog IDE - NetBeans and Eclipse | Sunday November 16, 2008 | By Karthik

To know how to debug in Tomcat the link is http://javalegion.blogspot.com/2008/11/debug-in-tomcat-6-plus-using-netbeans.html To know how to debug in JBoss the link is http://javalegion.blogspot.com/2008/11/profiling-and-debugging-in-jboss-42x.html

Searching Files in Projects in NetBeans 6.1 plus

Karthik's weblog IDE - NetBeans and Eclipse | Sunday November 16, 2008 | By Karthik

To search for files in projects in NetBeans 6.1 and 6.5, we can use Ctrl+O or Alt+Shift+O. -Use Alt+Shift+O when we wish to search for any file type. -Use Ctrl+O when we wish to search only Java files. This will provide us the result faster than when...

Maven Beginners please read how to solve Maven jav...

Karthik's weblog Maven | Sunday November 16, 2008 | By Karthik

This link explains how to solve Maven OutOfMemoryError in Windows. http://javalegion.blogspot.com/2008/11/maven-javalangoutofmemoryerror.html  

Silent mode installation of Java

Karthik's weblog Maven | Sunday November 16, 2008 | By Karthik

The below content in a batch file will install JDK in D:\jdk1_6_10 without popping up any GUI. Useful to install without user interaction. The log will be written into setuplog.txt     echo off     start ./sdk/jdk-6u10-windows-i...

How to add entries in MANIFEST.MF of WAR EAR and J...

Karthik's weblog Maven | Sunday November 16, 2008 | By Karthik

We may come across a situation where we need to add more entries to MANIFEST.MF in jar or war files other than the default entries. In Maven we have plug ins to accomplish the same. In war files, we can use maven-war-plugin as below. Build number and the...

Seam 2.1.0 released

Karthik's weblog JBoss-Seam | Monday November 03, 2008 | By Karthik

JBoss Seam 2.1.0 got released around November 23rd, 2008. The inline images  in the email template were appearing as attachments in Outlook and Thunderbird and this issue has been fixed in Seam 2.1.0. Will test and post the result soon.

Assigning a different name to Project Object Model...

Karthik's weblog Maven | Thursday October 16, 2008 | By Karthik

In Maven 2.0 it is not mandatory that we always name the Project Object Model as pom.xml. We can assign a custom name say abc.xml and invoke it using the command mvn -f abc.xml package Same applies for ANT. Instead of assigning the default name of ...

Obtaining JBoss Seam component in CXF JAXWS implem...

Karthik's weblog cxf spring | JBoss-Seam | Thursday October 16, 2008 | By Karthik

This entry explains how to obtain a JBoss Seam component in a CXF JAXWS implementor configured using Spring. Let us consider the example given in Developing Contract First webservice using CXF where we publish the endpoints using Spring configuration file...

Restricting Page access based on Role in JBoss Sea...

Karthik's weblog java jee | JBoss-Seam | Tuesday October 14, 2008 | By Karthik

This post shows how to restrict page access based on Role using  pages.xml in JBoss Seam.  addquestion.xhtml is the UI to enable user to add questions [say in an exam]. If we are to allow only users having role as admin to access the page, we make...

Specify multiple DataModel and DataModelSelection ...

Karthik's weblog JBoss-Seam | Monday October 13, 2008 | By Karthik

We may face a situation when we have to specify more than one  DataModel and DataModelSelection in JBoss Seam managed [backing] bean as below. Let us assume a multiple choice question which can also have more than one exhibits as below. [The Factory...

Big File Upload Tutorial Using Seam

Karthik's weblog jsf | JBoss-Seam | Sunday October 12, 2008 | By Karthik

Most of the available examples for file upload in Seam suits only upload of small files as the target is a byte array. We may end up facing  out of memory exception when we upload large files using JBoss Seam. Hence to avoid this, we have to declare the...

Part 2 - Setup web application using JBoss Seam Ne...

Karthik's weblog maven hibernate | JBoss-Seam | Saturday October 11, 2008 | By Karthik

This is a continuation of the entry http://www.theasolutions.com/roller/karthik/entry/setup_web_application_using_jboss Now we make the following assumptions. Hibernate will be used as the JPA implementation provider. The page navigation rules are to be...

Workaround for storing boolean variable in JPA ent...

Karthik's weblog jpa hibernate jsf mysql | JEE | Saturday October 11, 2008 | By Karthik

When we instruct Hibernate to update [ assigning the value of hibernate.hbm2ddl.auto as update ] the tables based on the JPA entity classes, Hibernate converts a boolean (or Boolean class) to the Type Bit in MySQL. For example, the following in an JPA entity...

Showing row index during data iteration in Seam Ri...

Karthik's weblog richfaces jsf | JBoss-Seam | Saturday October 11, 2008 | By Karthik

Very often we have the requirement of displaying the first column in a table to be the row number or row index. The below snippet shows how to do it in a dataTable in richfaces. rowKeyVar attribute is the candidate here and as the index starts from zero we...

hibernate.hbm2ddl.auto possible values in persiste...

Karthik's weblog java | Open Source | Thursday October 02, 2008 | By Karthik

When using JPA implementation by Hibernate, pay attention to the property hibernate.hbm2ddl.auto.  The explanation is provided in this page http://www.hibernate.org/hib_docs/reference/en/html/configuration-optional.html    which means once we...

More than one Seam phase listener per application ...

Karthik's weblog JBoss-Seam | Thursday October 02, 2008 | By Karthik

  If you face the below exception in a web application involving JBoss-Seam please read on. java.lang.IllegalStateException: No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed) Also when the...

Setup web application using JBoss Seam Netbeans To...

Karthik's weblog seam tomcat netbeans | Maven | Tuesday September 30, 2008 | By Karthik

In this post let us discuss how we can configure a web application using JBoss-Seam framework in Tomcat. Maven is used for build management and Netbeans 6.1 or 6.5 is the IDE used [with Maven plugin installed]. The web application under consideration is a...

Tutorial to develop Contract First webservice usin...

Karthik's weblog maven java | webservice | Saturday September 27, 2008 | By Karthik

In this short tutorial let us discuss how to develop a contract first webservice using Apache CXF.   Let us consider the scenario where the webservice accepts employee id and the year as input and returns the employee name and the number of hours...

Unmarshal XML into Java using JAXB

Karthik's weblog jaxb maven xml | Java | Friday September 26, 2008 | By Karthik

The xml file under consideration is employee.xml which is as below. <?xml version="1.0" encoding="UTF-8"?> <employee xmlns="http://ts.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...

How to specify Maven local repository location

Karthik's weblog Maven | Thursday September 18, 2008 | By Karthik

This post is for Maven beginners. Mostly Windows is installed in C drive and hence by default Maven local repository is located at C:\Documents and Settings\userloginid\.m2. This reduces the free space in C drive in the long run as more and more jar files...


Combined RSS feed for site. Right-click, copy link and paste into your newsfeed reader

Search for blogs