]]>https://techieexchange.wordpress.com/2008/12/11/ria-seam-flamingo-flex/feed/0techieExchangeJSF Session Expired Timeout Solutionhttps://techieexchange.wordpress.com/2008/02/21/jsf-session-expired-timeout-solution/
https://techieexchange.wordpress.com/2008/02/21/jsf-session-expired-timeout-solution/#commentsThu, 21 Feb 2008 12:57:48 +0000http://techieexchange.wordpress.com/?p=79With JSF, a clean Session expiry or timeout is not easy to implement. So, I would like to post a solution that you can integrate it as out-of-box with your JSF applications.

HttpSession session = event.getSession();System.out.println(“Current Session destroyed :” + session.getId() + ” Logging out user…”);
/*
* nobody can reach user data after this point because session is invalidated already.* So, get the user data from session and save its logout information * before losing it.* User’s redirection to the timeout page will be handled by the SessionTimeoutFilter.*/

]]>https://techieexchange.wordpress.com/2008/02/21/jsf-session-expired-timeout-solution/feed/16techieExchangeDatabase development with HiberObjectshttps://techieexchange.wordpress.com/2008/02/07/database-development-with-hiberobjects/
https://techieexchange.wordpress.com/2008/02/07/database-development-with-hiberobjects/#commentsThu, 07 Feb 2008 22:57:58 +0000http://techieexchange.wordpress.com/?p=67There are a lot of UML and ER tools out there, but they cost a lot of money, too.
This is a step-by-step to develop your database with Eclipse and HiberObjects for free.
It is a fast way for Java developers to develop database tables.
It uses an UML-ER Model to generate JavaBeans, which can create tables on the database by using Hibernate as persistence manager.

Extract these files where you like but keep in mind not to use blanks ” ” or special characters “áä”. I used “C:\Development” as path. And create a new workspace folder. Your development folder should look like this.

Next we need to get our database up and running.
Run the Setup and make a “typical” installation. At the end of the Setup configure the MySQL server. Choose “Standard Configuration”. Do not change anything in the next screen. Now set root password for the DB. I used “mysql” at this point (very inventive, huh?). Go to the next screen and finish the configuration.

Start Eclipse and create a new project

Start Eclipse and set your workspace to “C:\Development\workspace”.Close the welcome screen.Create a new HiberObjects project.Choose “File” => “new” => “Project…”Select HiberObjects project. Customize the project name or the root package if you want to and click “Finish”.

Eclipse asks you, if you want to switch to the HiberObjects perspective. Choose “Yes”

Configure the JDBC connection

Check out “hibernate.properties” in the “conf” folder.This file contains the configuration for the JDBC connection. The file is configured for HSQL database.

Happily there is a note how to configure the MySQL connection.Comment and comment up the right lines. Enter “root” as username and “mysql” as password. We will use the MySQL “test” database. Change the last line to “hibernate.connection.url=jdbc:mysql://localhost/test”.
The file should now look like this.

Next we need to add the MySQL JDBC driver to the project.
Right click your project and select „Properties“, “Java Build Path” and “Libraries”. Add an external JAR file. And select “mysql-connector-java-5.0.8-bin.jar” from “C:\Development\mysql-connector-java-5.0.8” and click OK.

Next we create a more or less simple model. I thought of a program that helps us with the market research for our super market.
Right click at your empty model and create a new class “Customer”. Right click at the new class and generate new attribute “+String name”. The “+” at the beginning indicates that our attribute is public, but only the getters and setters will be public.

Right click at the “Costumer” class and select “Show” => ”Id”. The attribute “+Long id <<id>>” appears. This attribute is generated for all classes automatically as primary key. Later you can see the attribute in your JavaBean, too.

Create a new class “Visit”. The visit at our super market hat got a time and a duration. Create the new attributes “+Date time” and “+String duration”.

You can add a JPA annotation to the duration attribute. Right click at “+String duration” and select “New” => “Tag”. A new “@Column” Tag appears. Right click at this one and create a new parameter for this one, enter “nullable=false”.

We will need a class “Product”, too. A product has usually a name and a prize. Make new Attributes “+String name” and “+double prize”.

Now it is time to connect the classes.

Make a bidirectional association between “Costumer” and “Visit” by clicking at the “—” Symbol and connect each class with another.
One costumer can do several visits but one visit can only be made by one costumer. Change the the Multiplicity by right click on it. Change the one at “Visit” from “0..1” to “*” and the one at “Costumer” to “1”.

Now connect the “Visit” class with the “Product” class by a bidirectional association.
The costumer can buy several product at each visit and one product can be bought at different visits. Change both Multiplicities from “0..1” to “*”.

We want to store these informations at the database. Right click at each class and select as Stereotype “Persistent”.

That will do it for now. The model is complete for our purpose.Generate the JavaBeans

When you are done, right click “HiberObjects” in your Eclipse project and select “Save all”.
HiberObjects has generated three JavaBeans from the Model in the com.xyz.myproject.model” package.

It should look like this.

Create the database tables

In the package “com.xyz.myproject.util” is a file “HibernateHelper.java”. Right click at it and select “Run as” => “Java Application”
The log says everything is all right.

Start your database administration tool to take a look at your database.

(See? Even the duration column is set to NOT NULL)
Everything is there where it should be (after an uncountable number of right clicks)

]]>https://techieexchange.wordpress.com/2008/02/07/database-development-with-hiberobjects/feed/3cgernertworkspacenewprojectpropertiesbeforepropertieslibmodelnewlogdbHow to make JBoss Seam work with Eclipse (for Windows)https://techieexchange.wordpress.com/2008/02/01/how-to-make-jboss-seam-work-with-eclipse-for-windows/
https://techieexchange.wordpress.com/2008/02/01/how-to-make-jboss-seam-work-with-eclipse-for-windows/#commentsFri, 01 Feb 2008 11:24:02 +0000http://techieexchange.wordpress.com/?p=55This is a step-by-step tutorial. I made this Tutorial, because I was not happy with the four project folders generated by JBoss Tools 2.0.0 when I select a new Seam EAR project. The work is a bit confusing. If I create a new Seam WAR project I only get two projects (one of them is a test project). I had a lot of trouble with the WAR project. I was not able to not get the EJB3 examples work with it. Never the less the folder structure is different from the Seam-gen generated projects. This tutorial works completely without JBoss Tool. You can use JBoss Tools anyway, it has nice functions do build a RichFaces JSF page, but keep in mind that new generated projects are difficult to handle, since you have to keep an overview of all four projects and the changes you made in each of them.

Run the setup and make a “typical” installation. At the end of the setup configure the MySQL server. Choose “Standard Configuration”. Do not change anything in the next screen. Now set root password for the DB. I used “mysql” at this point (very inventive, huh?). Go to the next screen and finish the configuration.

Setup JBoss Seam and create a new project

You need to create a new Seam project

Enter the Console, Start => Run an enter “cmd”
Enter “C:” and change the Directory to the JBoss Seam installation
“cd C:\Development\jboss-seam-2.0.X.GA”.

Now it is time to setup JBoss Seam.

Type: “seam setup”

Seam welcomes us but wants to know some things about our project.

Enter the project folder. That will be our workspace“C:\Development\workspace”

Enter the Directory of the JBoss Application Server“C:\Development\jboss-4.2.2.GA”

Now it is time to test a Seam example. I used the simple “Registration” example.

Go to “C:\Development\jboss-seam-2.0.1.GA\examples\registration”
The source files are in “\src\org\jboss\seam\example\registration”

Copy Register.java, RegisterAction.java and insert it in your Eclipse project at src/action in the package “com.mydomain.MyFirstSeamProj.session”.

Another error appears! Well not really, it is the same as before, but now we have got an additional window

It is the Windows file system again.

Go to “C:\Development\jboss-4.2.2.GA\server\default\deploy” again and delete the “MyFirstSeamProj.ear” FILE this time. The error should now be solved.

Go back to the Eclipse project and make a new package in “src/model” and name it “com.mydomain.MyFirstSeamProj.entity”. Copy “User.java” from the example in this package.

Now you must correct the package entry in the source files in your eclipse project to “com.mydomain.My…”. In “RegisterAction.java” you have to import User from “com.mydomain.MyFirstSeamProj.entity.User”. Save all files.

Go to the root directory of the Registration example and copy all files from the view folder into the view folder of your eclipse project and override the existing.

Letz dive in to the tutorial directly without explaining more about Seam.

In order to develop an enterprise application, one must have
an application server installed locally, which is a big pain
when considering system resource and performance. During the
development period developer always perfer to have his
code-hotdeploy time as short as possible, which rapidly
increases his development and production. But this is not
easily achieved when application servers are used during
development. An alternative is to use web servers which are
very light when compared to Application servers. Seam has a
good support for Tomcat webserver.

This tutorial focuses Seam development under Tomcat webserver without support for EJB, that means Seam with POJO and JPA+Hibernate as Persistence provider.

Main goal of this tutorial is to achieve RAD-Rapid Application Development with Seam, Tomcat and Eclipse.

Now goto opened browser where application is already running, and press Refresh or F5 to reload the page.
That’s it.. without starting the server your code got hot deployed and web page was reloaded. (see Figure 32)

Please note that Tomcat should be used only during development phase in order to increase the development productivity, use some application server to deploy production applications.

I hope this tutorial gives a kick-off project template for Seam with POJO+JPA+Hibernate based application.

Share your thoughts.

]]>https://techieexchange.wordpress.com/2007/11/11/rad-seam-development-with-eclipse-and-tomcat-step-by-step-tutorial-screencast/feed/47techieExchangeDownload JBoss Seam and extract2-seam-jpa-example.png3-build-jpa-example-tomcat.png4-build-jar-jpa-example.png5-eclipse-import-example.png6-eclipse-import-war.png9-eclipse-import-jpa-war.png10-eclipse-import-war-default-lib.png11-eclipse-project-hierarchy.png12-eclipse-create-classes-folder.png13-project-class-folder.png14-select-class-folder.png15-copy-src-from-example.png16-paste-src-from-example.png17-project-jpa-src.png18-delete-importedclasses-folder.png19-import-testng-jar.png20-project-no-errors.png7-eclipse-sysdeo-tomcat-configuration.png8-eclipse-sysdeo-tomcat-installed.png21-project-as-tomcat-web-project.png22-update-context-tomcat.png23-copy-context-defn.png24-server-xml-context-before.png25-server-xml-context-after.png26-paste-hsql-lib-in-tomcat.png27-start-tomcat-sysdeo.png28-tomcat-started.png29-test-example-browser1.png30-home-xhtml-src-before.png31-edit-home-xhtml-page.png32-refresh-web-page.pngTest Web Design in different Browsershttps://techieexchange.wordpress.com/2007/11/08/test-web-design-in-different-browsers/
https://techieexchange.wordpress.com/2007/11/08/test-web-design-in-different-browsers/#respondThu, 08 Nov 2007 11:36:28 +0000http://techieexchange.wordpress.com/2007/11/08/test-web-design-in-different-browsers/Tried of downloading all available browsers on Net to test your web site design/layout??

Not any more !!

Here’s a good news for testers and web designers.

Tool Description:

What is Browsershots?

Browsershots makes screenshots of your web design in different browsers. It is a free open-source online service created by Johann C. Rocholl. When you submit your web address, it will be added to the job queue. A number of distributed computers will open your website in their browser. Then they will make screenshots and upload them to the central server here.

]]>https://techieexchange.wordpress.com/2007/11/08/test-web-design-in-different-browsers/feed/0techieExchangeTechieexchange’s Test on BrowsershotsWeb development with Jboss Seam: Videohttps://techieexchange.wordpress.com/2007/11/07/web-development-with-jboss-seam-video/
https://techieexchange.wordpress.com/2007/11/07/web-development-with-jboss-seam-video/#respondWed, 07 Nov 2007 15:57:30 +0000http://techieexchange.wordpress.com/2007/11/07/web-development-with-jboss-seam-video/Just came across a nice video about Jboss Seam, from TSS.

In this presentation, recorded at the recent Grails Exchange event in London, Christian Bauer discusses how JBoss Seam simplifies the handling of stateful conversations, multi-window operations and concurrent, fine-grained Ajax requests. He also shows how Seam unifies and integrates popular open source technologies like Facelets, Hibernate, jBPM, Drools, Groovy, iText and Lucene.

Video Title: Web Development with JBoss Seam from Christian Bauer

Video Detail:

***Please Note*** The links/videos provided are for your convenience and are in no way connected with this blog. Through these links/videos, this blog is not responsible for the content of these external sites.