Hjem   |   Kontakt   |   Sitemap
Hvem er vi Hvad kan vi Vores kunder Ledige stillinger Kontakt os Blog

Posts Tagged ‘Seam’

Testing JBoss 6

Published Thursday, January 27th, 2011 by AN

So, JBoss 6.0.0 is out. And so far it looks pretty good.

Last year I was working on an JEE5 app that runs with Seam 2 and Richfaces 3.3 on JBoss 4.2. Just for fun I tried to deploy it on JBoss 6. To make it deploy cleanly I had to fix some minor things.

  1. Only the latest Seam 2.2.1 CR3 is advertised to run on JBoss 6. So I grabbed that.
  2. commons-httpclient, which I use in my app, was on my classpath on the JBoss 4.2 I used, but was missing on JBoss 6. But I just grabbed the one from the Seam /lib folder.
  3. My app is a .ear file with a .war file inside. And the files have the same name which makes it look something like this when exploded myapp.ear/myapp.war. JBoss 6 doesn’t seem to like this, complaining that the war has already been deployed during the deployment. Renaming the .war to myappweb.war fixed it.

As expected, startup is somewhat slower than JBoss 4.2.3 at around 21 secs to start JBoss 6 with my app deployed and 14 secs on JBoss 4.2.3.

So, to sum up; if I get the chance to do another release of the app and run it on JBoss 6 then, it is definitely possible. And I wouldn’t hesitate to do so. Taking advantage of EJB 3.1 on JBoss 6 to get rid of the silly EJB interfaces would really clean up the app.


(Reusable) Dependent dropdowns in Seam and Richfaces

Published Thursday, May 7th, 2009 by AN

In the previous post I had some code to illustrate how I do dependent dropdowns with seam and richfaces. I cleaned it up to focus on the important stuff and I am not sure to which degree it compiles and runs. However, you may have noticed one thing that is certainly odd. Most of the operations are on the object named “vendormodelselector” which is described in the post. But the search action is on “searcher”. This is because I include the seam file on multiple pages with “ui:include” (xmlns:ui=”http://java.sun.com/jsf/facelets”). and with “ui:param” I can pass a different searcher object depending on the page. Like this

<ui:include src="vendormodelmenu.xhtml">
	<ui:param name="vendormodelheader" value="Appropriate header"/>
	<ui:param name="searcher" value="#{searcher_object_name}"/>
</ui:include>

Neat!


Dependent dropdowns in Seam and Richfaces

Published Friday, April 17th, 2009 by AN

It is not uncommon to want to make a combobox with choices that depend on another combobox. But it often seems very complicated to actually do this. So here is a piece of example code that I use with Seam and Richfaces. Imagine we have different vendors Vendors each with different Models of something.

The somewhat large blurb of Richfaces markup is to make two ordinary input textfields feel like two ajaxy comboboxes. It sucks a bit, but on the other hand the Java code is nice and clean.

How do you make dependent gui elements?


xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
<div class="dialog">
Vendor</div>
<div class="dialog">
Model

<br class="clear" /></div>
package test;

import java.util.ArrayList;
import java.util.List;

import javax.ejb.Remove;
import javax.ejb.Stateful;

import org.jboss.labs.seam.guice.Guice;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.log.Log;

import com.google.inject.Inject;

import dk.telenor.tacs.api.DBApi;
import dk.telenor.tacs.db.Model;
import dk.telenor.tacs.db.Vendor;

@Stateful
@Scope(ScopeType.SESSION)
@Name("vendormodelselector")
@Guice
public class VendorModelSelectorBeanImpl implements VendorModelSelectorBean {

@Inject	private DBApi dbApi;

@Out(required = false, value="model")
private Model model = new Model();

@Out(required = false, value="vendor")
private Vendor vendor = new Vendor();

public List autocompleteVendor(){
return dbApi.getMatches(new Vendor());
}

public List autocompleteModel(){
if (vendor == null || vendor.getName() == null) {
return new ArrayList();
}
return dbApi.getMatches( new Model(vendor, null) );
}

public void setVendor(final Vendor vendor){
this.vendor = vendor;
}

public void setModel(final Model Model){
this.model = model;
}

public Model getModel(){
return model;
}

public boolean isReady(){
return model.getId() != null;
}

@Remove
public void destroy(){}
}

Using TDC’s Columbine with modern browsers

Thursday, April 14th, 2011
On columbine.tdc.dk there is a gui with tools for resellers of TDC eBSA products. These ...

Groovy CPE

Thursday, February 3rd, 2011
I've been working quite a lot on a TR069 AutoConfigurationServer. As part of the prototyping ...
 
© 2011 Code3 ApS  |  Kigkurren 8G, 3.TH  |  2300 København S  |  +45 7020 3383  |  kontakt@code3.dk