Acegi Security release 0.7.0 is out

The long awaited 0.7.0 relase of Acegi Security System for Spring is out. I’m happy to have contributed (just a bit) to this great project. And it is built with maven!!

Dear Spring Community

I’m pleased to announce the Acegi Security System for Spring release 0.7.0 is now available from http://acegisecurity.sourceforge.net. The project provides comprehensive security services for The Spring Framework. You can read about the features in detail at http://acegisecurity.sourceforge.net.

There are many changes, improvements and fixes in release 0.7.0 (as listed at http://acegisecurity.sourceforge.net/changes-report.html). The major new feature areas are:

* Significant improvements to ACL security services

* AspectJ support (useful for instance-level security)

* Refactoring of ObjectDefinitionSources (especially useful for web URI security)

* Automatic propagation of security identity via RMI and HttpInvoker

* Integration with Servlet Spec’s getRemoteUser()

* Refactoring of Contacts sample to use the new ACL security services

* Additional event publishing (now includes authorisation, not just authentication)

* CVS restructure to use Maven as the build system

* A new project web site with FAQs, links to external articles etc

The new ACL security services deserve special mention, as they make it possible to develop applications that require complex instance-based security without any custom code. The entire configuration of such applications can be declared in the IoC container using standard Acegi Security services, so this should help significantly improve architecture and development time.

As per the Apache APR project versioning guidelines, this is a major release. We expect the next major release will be 1.0.0, although release 0.7.0 should be considered stable enough for most projects to use. There are detailed upgrade instructions included in the release ZIP and on the Acegi Security home page.

For Maven users, Acegi Security’s latest JARs are available from http://acegisecurity.sourceforge.net/maven/acegisecurity/jars. We will also be adding release 0.7.0 and above to iBiblio.

We hope you find this new release useful in your projects.

Best regards

Ben

Sending e-mails with Spring

The Spring Framework allows a very simple way to send e-mails.

/* Create a MIME message */
MimeMessage message = mailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message, "UTF-8");
helper.setTo("My friend <[email protected]>");
helper.setFrom("Myself <[email protected]>");
helper.setSubject("The subject");

/* Send plaintext */
String plaintext = "The text of the mail";
helper.setText(plaintext, false);

/* Send html */
String htmltext = "<html><body><p>The text of the mail</p></body></html>";
//helper.setText(htmltext, true);

/* Send both (multipart) */
//helper.setText(plaintext, htmltext);

mailSender.send(message);

The mailSender can be injected with the following xml in the application context.

    <bean id="mailSender"
        class="org.springframework.mail.javamail.JavaMailSenderImpl">
        <property name="host"><value>mail.server.com</value></property>
        <property name="username"><value>smtpusername</value></property>
        <property name="password"><value>smtppassword</value></property>
    </bean>

Spring Framework 1.1.3 released

A new version of the Spring Framework, the 1.1.3 has just been released ant it’s available to maven users from the ibiblio repository.

I'm pleased to announce that Spring 1.1.3 has just been released.
This is a bugfix and minor enhancement release in the 1.1 series;
most importantly, JDK 1.3 compatibility is fully restored.
Among the new features in this release are:

* added "setResourceLoader" method to GenericApplicationContext, for overriding the default resource loading strategy
* added FileSystemResourceLoader, resolving paths as file system resources rather than as class path resources
* BeanWrapperImpl automatically registers a default ResourceArrayPropertyEditor
* added CustomCollectionEditor, by default registered to convert between Set, SortedSet and List (when necessary)
* added "fileEncoding" and "propertiesPersister" properties to PropertyResourceConfigurer
* reworked DefaultListableBeanFactory's "getBeansOfType" to return FactoryBean instances when passed a FactoryBean type
* DefaultXmlBeanDefinitionParser resolves "set" tag as LinkedHashSet on JDK 1.4, falling back to HashSet on JDK 1.3
* factored out AbstractRefreshableApplicationContext as base class of AbstractXmlApplicationContext
* added "setIgnoreUnknownFields" method to DataBinder, enforcing request parameters to match fields when turned "false"

* added "execute(ConnectionCallback)" method to JdbcTemplate, allowing any kind of operation on a given Connection
* added DB2SequenceMaxValueIncrementer, implementing the DataFieldMaxValueIncrementer interface for a DB2 sequence
* fixed Hibernate/JTA synchronization to also work with EJB remote transaction propagation (with >1 thread involved)
* added "transactionConfigClass" and "transactionConfigProperties" customization properties to SqlMapClientFactoryBean

* added optional "proxyInterface" property to JndiObjectFactoryBean, for exposing a proxy rather than the plain object
* added "lookupOnStartup" and "cache" properties to JndiObjectFactoryBean, allowing for lazy lookup on first access etc
* added "codebaseUrl" property to HttpInvokerClientInterceptor, specifying a URL for dynamic class download
* added support for dynamic class downloading to AbstractHttpInvokerRequestExecutor and its subclasses

* DispatcherServlet by default cleans up request attributes after include request (configurable via "cleanupOnInclude")
* UrlBasedViewResolver supports a "forward:" prefix too, for forwards to other controllers through special view names
* added "attributes" (Properties) and "attributesMap" (Map) properties to UrlBasedViewResolver, for static attributes
* InternalResourceView performs an include if the response has already been committed (-> forward not possible anymore)
* JstlView and TilesJstlView respect a JSTL "localizationContext" config in web.xml, checking those messages first
* added overloaded "createVelocityContext" and "exposeHelpers" methods to VelocityView, with passed-in servlet response
* added "toolAttributes" property to VelocityView, taking attribute name / tool class name pairs for tools to expose
* added JasperReportsXxxView to allow for convenient rendering of CSV/HTML/PDF/XLS web views with Jasper Reports
* added MappingDispatchActionSupport class, as convenience subclass of Struts 1.2's MappingDispatchAction

Congreso Javahispano 2004

I’m doing a presentation at Congreso JavaHispano 2004 in Madrid, december 15, 16, about Acegi Security System for Spring. If you’re interested registration is free.

Understanding Portlets and Portals

A good introduction to the JSR-168 Portlet standard:
Understanding Portals and Portlets by Kenneth Ramirez

Spring Framework 1.1.2

Spring Framework 1.1.2 has just been released. As before it will be available to Maven users in the ibiblio central repository in a few hours.

Unfortunately this release has a bug and is not compatible with Java 1.3.

Check the announcement:

ANNOUNCEMENT: We are pleased to announce that Spring Framework 1.1.2 has just been released. This is a bugfix and minor enhancement release.
 
Among the new features in this release are:
 

  • added support for multi-dimensional collections to BeanWrapperImpl (e.g. “map[myKey][0]” or “map[myKey][0].name”)
  • added “getType(name)” method to BeanFactory interface, checking the type of object that “getBean” would return
  • added “getBeansOfType(type)” convenience method to ListableBeanFactory interface, without explicit filters
  • added PropertyPathFactoryBean, allowing to evaluate the property path of a target bean and expose the result
  • allow “bean*” rather than “bean+” in XML bean definitions, i.e. no bean definitions in a file (just imports)
  • AbstractApplicationContext automatically registers a context-aware ResourceArrayPropertyEditor for Resource arrays
  • added GenericApplicationContext class, allowing for arbitrary definition formats (via a single internal BeanFactory)
  • improved ResourceBundleMessageSource and ReloadableResourceBundleMessageSource implementations
  • added “setText(plainText, htmlText)” method to MimeMessageHelper, for alternative texts in the same mail
  • added “objectResult(collection,type)” and “intResult”/”longResult(collection)” convenience methods to DataAccessUtils
  • added support for pre-bound Sessions (e.g. OpenSessionInViewFilter/Interceptor) with JTA and TransactionManagerLookup
  • added “load(entity, id)” method to HibernateOperations and HibernateTemplate
  • added “initialize” and “closeIterator” methods to HibernateOperations/Template, following “Hibernate.initialize/close”
  • added “queryCacheRegion” property to HibernateTemplate, specifying the cache region used for queries
  • added ServletContextResourcePatternResolver, to find matching resources within a web app even in an unexpanded WAR
  • added “defaultStatusCode” property to SimpleMappingExceptionResolver, specifying the HTTP status code for error views
  • UrlBasedViewResolver supports a “redirect:” prefix now, for convenient redirects through special view names
  • added “springMessage”/”springMessageText” macros for Velocity and “message”/”messageText” macros for FreeMarker

As always, have a look at the changelog for details.
Downloads are available through the SourceForge project page [2004-11-14]

Note that this Spring distribution comes with an updated HSQLDB version, namely 1.7.2.7. Unfortunately, the HSQLDB 1.7.2 branch is incompatible with 1.7.1 in some areas. While all Spring sample apps have been adapted accordingly, please be aware that if you do decide to update your own applications with the new hsqldb.jar, you must also update your server instance (i.e. both need to run version 1.7.2), and any existing db data files may need to be upgraded. Furthermore, be aware that JBoss <= 3.2.5 shipped with HSQLDB 1.7.1 in the server classpath, while 3.2.6+ include HSQLDB 1.7.2.

Struts 2.0 “Shale”

Struts 2.0 “Shale” is now a proposal. There are plans to include new features: IoC (Spring), authentication and authorization (here it’s my vote for Acegi Security System), and Java Server Faces JSF for presentation.

Read more at

Tomcat in high volume sites

Looking for the convenience of using Tomcat in a high volume, mission critical site I’ve found some references that may be useful to other people:

Clustering and Load Balancing in Tomcat 5. Part 1

Clustering and Load Balancing in Tomcat 5. Part 2

The book Professional Apache Tomcat 5 (Programmer to Programmer) seems interesting too, with chapters “Server Load Testing” and “Clustering”.

The only benchmark I’d found is Jakarta Tomcat Performance Benchmark at TSS but it’s from march 2003, very outdated. When trying to convince a boss to use Tomcat it’d be interesting real world success stories and benchmarks.

White Book of the CMS Open Source solutions

The french company Smile has a document about the CMS Open Source, a small comparison but a very interesting document. You can get it form their site but take into account that it’s wrotten in french.

Showing latest comments in roller

Some time ago I found they way to show the latest weblog comments in roller. I found it a very cool feature for both writers, as jroller doesn’t email comments, and readers to check comments in all entries.

You can check the sources for the two files needed:

You can also add #showRecentCommentsListWidth(20 75) to show the titles of the recent comments

Thanks to Lance