Site Network: Personal | Professional | Photography

Technical Blog

This blog will contain content related to Java, Seam, Security, my sites and projects, as well as other technical subjects I am interested in.

Comments and questions are welcome!

Archive for the ‘Seam’ Category

10MinuteMail upgraded again

Saturday, November 3rd, 2007

Moved up to Seam 2.0 CR3, and JBoss 4.2.2. I also optimized some code, got rid of some useless error logging, etc...

Hopefully it will perform a little better:) So far it seems to process incoming e-mail much faster, which was a bottleneck under load.

Enjoy!

Quartz Scheduling and Seam (part 1)

Friday, November 2nd, 2007

I am working on a new application, which will require some scheduled jobs. I used EJB3 Timers in 10MinuteMail, but now Seam includes and uses Quartz, an open source scheduling system. So I figured I'd try the new hotness.

So far, it's been a rough road, and I'm not 100% up and running yet (hence the part 1 in the title), but I wanted to share what I've learned along the way as the Seam documentation is lacking a lot of information (although some of what's below mirrors the Seam documentation).

First you have to enable the Quartz engine for handling @Asynchronous methods. Add this line to your components.xml file:

<async:quartz-dispatcher />

I also found that I had to define the async namespace in my component.xml (generated by seam-gen from Seam 2.0 CR1):

xmlns:async="http://jboss.com/products/seam/async"

Then I set up my method:

@Asynchronous
public QuartzTriggerHandle scheduleSiteCheck(@Expiration
Date pWhen, @IntervalDuration
Long pInterval, Long pSiteId) {
Site site = (Site) entityManager.createQuery("from Site where id = :id").setParameter("id", pSiteId)
.getSingleResult();
checkSite(site);
return null;
}

(more...)

CAPTCHA with Seam in Three Minutes

Sunday, October 21st, 2007

Adding a CAPTCHA to a form using Seam is easy now that Seam is bundling jCaptcha.

The Seam documentaiton is good, and can be found in section 13.9 here:

http://docs.jboss.com/seam/2.0.0.CR2/reference/en/html/security.html#d0e7755

If you used seam-gen to create your project, you will need to make a few changes.

First, you need to modify your project's ant build script to deploy the captcha jar into your ear (or possibly .war). In the target "ear" of the build.xml file, you will find a list of many jar files being copied from your project's lib directory into the ear. Simply add the captcha jar to that list, like this:

<include name="lib/jcaptcha-all-1.0-RC6.jar"></include>

Now that the jar is deploying, you need to reference it in the application.xml file found under your project's resources/META-INF directory. Add this entry:

<module>
<ejb>lib/jcaptcha-all-1.0-RC6.jar</ejb>
</module>

If you used seam-gen you will find that the Seam Resource Servlet is already defined in your web.xml so the step defined in the documentation in section 13.9.1 is not necessary.

(more...)

Another small 10MinuteMail.com update

Sunday, September 23rd, 2007

I just pushed up the latest version of 10MinuteMail. Now there are 29 languages supported! I've also upgraded the Seam version to 2.0.0.CR1 and the JBoss version to 4.2.1.GA. I am hoping that this will help fix some of the recent OutOfMemory issues I've seen.

Check it out, tell your friends, link to it, enjoy it, and let me know how I can make it better!

Thanks!

Devon

Minor 10MinuteMail.com update

Sunday, August 19th, 2007

A minor release to 10MinuteMail just went out. It adds a few languages and language cleanups, bringing us up to 26 supported languages!!! Thanks to all those who have volunteered their time!

There's also a new feature to grab a new e-mail address at any time. Mail sent to your old address(es) will still show up in your inbox page (as long as your session is still active). Check it out. That comes as a special request. If you have a feature request, e-mail me.

Enjoy!

Devon