Archive for the 'Java' Category

Mai 16 2011

How to create a Grails Web Service with a Selenium Test

Published by under Grails,intellij idea



Table of contents

Technorati Tags: annotations, contract last, create, cxf, Grails, gui test, intellij idea, jax-ws, selenium, soap, test, testing, tutorial, web service

Kommentare deaktiviert

Jan 17 2010

Use Generators to create boilerplate code in GWT 2.0

google web toolkit

Table of contents

Technorati Tags: annotation, boilerplate code, eclipse, field, generate, generators, gwt 2.0, Java, label, labelfieldgenerator, printwriter, textbox, textfieldgenerator

11 responses so far

Dez 10 2009

Experiences with the migration from GWT 1.7.1 to 2.0

google web toolkit


With the release of GWT 2.0 there are several new features (like Code Splitting, Compiler improvements, faster development mode) introduced and i decided to make a test run on my current enterprise project to see what have changed in this points:

Technorati Tags: compilation time, draftcompile, experience, gin, Google Web Toolkit, Guice, gwt 1.7.1, gwt 2.0, gwt-log, gxt, migrating, presenter

4 responses so far

Nov 11 2009

Create a GWT Application from Scratch




Many people are asking (especially in the GWT Group) how to create a GWT Application for their favourite IDE. In this blog i will show you how to do this for Eclipse, NetBeans and IntelliJ IDEA.

Technorati Tags: create project, eclipse, Google Web Toolkit, gwt, i18n, import, intellij idea, NetBeans

15 responses so far

Okt 15 2009

Solve the circular reference problem with Guice and Spring

Published by under Guice,Spring

  


The problem

Just imagine you run into a case where two objects are dependent on each other. The following picture and code snippet shows one such relationship.

Technorati Tags: circular reference dependencies, google guice, Java, Spring

2 responses so far

Feb 03 2009

An easy way to connect JSF with Adobe FLEX




Using Adobe Flex together with other technologys like JavaServer Faces, Struts or Spring Web Flow is not an easy task, because the embedded Flash-file interacts in its own world and from the sight of its surrounding JSF/JSP/HTML-Code, it is an foreign object. There exists some approaches to connect these different worlds like the jsf-flex project or the Exadel Fiji.

I am now showing you an another way, how you can connect Flex with JavaServer Faces. You are able to develop each Project (Flex and Java) separately.


Let’s take a look at this picture (click on the picture to enlarge it):

bild1


This is what we have. JSF-Code with an embedded Flex-Object. You can insert the firstname and the lastname with JSF-inputText -Fields, and the fields city and country with Flex. If you click submit, alle four values are saved inside the managed-bean.

bild2


Ok how is this possible? The solution is JavaScript! In some few words – if you enter some values for the city and country inside the Flash-Object, the ActionScript code is writing these values into JavaScript-Variables (which are declared in the JSF Code). If you hit submit, a JavaScript-Function is writing the values into the hidden tomahawk-inputFields which are bonded to the corresponding managed-bean (Page1Bean).

jsfwithflexdiagram bild4bild3


In ActionScript, you have to extend the class Proxy and overwrite flash_proxy function setProperty(..). You can see this here:

JSVariableProxy.as

Technorati Tags: actionscript, adobe flex, connect, javascript, javaserver faces, jsf, NetBeans

One response so far

Jul 22 2008

Using Spring and Facelets together with NetBeans 6.1



In this blog you can read how to create a Web Application with NetBeans 6.1 and the GlassFish 2 Application Server. This Web Application is using Facelets, MyFaces 1.2 and the Spring 2 technologies.


Please note:
I have contributed this blog to the NetBeans Community.


Prerequisites

First update your NetBeans 6.1 to the newest version (currently it is Build 200804211638).

NetBeans Version 6.1 Build 200804211638

Install the Facelets Support Modules and restart NetBeans.


Create a new Web Application

Create a new Web Application, name it “Spring_and_Facelets“.

create a new Web Application

Choose GlassFish v2 as Server and click next.

choose GlassFish 2 as Server

In the last step, activate the Facelets-Framework.

choose the Facelets Framework

Open the Project Properties and remove all libraries.

remove libraries

Download and add my special MyFaces and Facelets Libraries Collection to the project.

special facelets and myfaces collection

Build and run the application. You should see this in your browser:

running facelets application


Adding some Facelets functionality

It is now time to add some specific Facelets functionality to this small Web Application. First we create a new facelets file, name it “header“.

create a new facelets file

the header.xhtml file

Insert this HTML code into the file:

header.xhtml

Technorati Tags: Facelets, GlassFish, Java, MyFaces, NetBeans, Spring

3 responses so far

Jul 06 2008

Access the Spring-ApplicationContext from everywhere in your Application

Published by under Java,Spring



In this blog i will show you a short hint how you can access your Spring-ApplicationContext from everywhere in your Application.

Imagine you have an application (e.g. a web or swing-application) which you now want to be Spring-enabled. Ok you add the Spring libraries and the Configuration-file and create your Spring-beans. But there are still some old class-files which you can’t use in this way. These files still need access to the Spring-Honeypot where all the goodies exists and you don’t want to redesign your application.

First create the class “ApplicationContextProvider“. This class implements the ApplicationContextAware. A bean which implements the ApplicationContextAware-interface and is deployed into the context, will be called back on creation of the bean, using the interface’s setApplicationContext(…) method, and provided with a reference to the context, which may be stored for later interaction with the context.

ApplicationContextProvider.java

Technorati Tags: ApplicationContext, Java, Spring

76 responses so far

Jun 29 2008

Contract First Web Services with Spring 2 and JAX-WS



This short blog entry will show you how easily you can integrate JAX-WS into a Spring 2 Project. The example sourcecode is depending on my previous blog How to modify JAX-WS SOAP-Messages and i am using NetBeans 6.1.


Prerequisites

Download the JAX-WS commons and XBean.


Transform the SOAP Web Services Project into a Spring Project

First open the Non-Spring-Project “How to modify JAX-WS SOAP-Messages“, switch to the project-properties and add the XBean, JAX-WS commons and Spring Framework 2.5 JAR-files.

add jar files to netbeans project


You can see in this picture which JAR-files have to be included in the project:

jar files in the netbeans project


Now you have to create the Spring Configuration file. Create the new XML-file: /WEB-INF/applicationContext.xml. If you are using NetBeans 6.1, navigate to File->New File->Spring Framework->Spring XML Configuration File.

create a new spring configuration file in netbeans 6.1


Replace the content with this:

applicationContext.xml

Technorati Tags: Java, jax-ws, NetBeans, soap, soaphandler, Spring, web services

4 responses so far

Mai 23 2008

Facelets Support Modules for NetBeans 6.1




I have build manually the Facelets Support Modules for NetBeans 6.1. You can download them here: faceletssupport_for_netbeans6.1.zip

To install the Modules, navigate in NetBeans to Tools -> Plugins -> Downloaded, hit Add Plugins and choose the modules. Click on Install to start the installation.

Facelets Support Modules for NetBeans 6.1

Technorati Tags: facelets support, Java, NetBeans

5 responses so far

Older Entries »