Struts Hints and Tips

This document relates to Version 1.0.2 of Jakarta Struts.


Logging is delegated to javax.servlet.GenericServlet. The documentation for this class states that this method writes the specified message to a servlet log file, prepended by the servlet's name. The servlet log file is usually an event log. The name and type of the servlet log file is specific to the servlet container.

See JbossHintsAndTips#debugging for informations specific to JBoss.


If your servlet container is going out to the Internet to fetch the DTD for validation.xml and validator-rules.xml it is most likely that there is an error in the public identifier in these files.

As at Struts 1.2.8 it should be:

<!DOCTYPE form-validation PUBLIC
             "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"

Further information (in relation to web.xml, but the principals are the same) at

Note: Struts prior to 1.1 had a bug in the way that the validator was implemented that resulted in the DTD being fetched from the Internet. The fix is to upgrade to a later release.

  • -- Frank Dean - 02 Dec 2005


The key bit is:

import org.apache.commons.collections.Factory;
  import org.apache.commons.collections.ListUtils;

  public class SkillActionForm extends ActionForm, implements Factory {

        protected List skills = ListUtils.lazyList(new ArrayList(), this);

        public List getSkills() {
             return skills;

        public void setSkills(final List newSkills) {
             skills = ListUtils.lazyList(newSkills, this);

        // 'Factory' method for LazyList
        public Object create() {
             return new SkillBean();


Resource Keys

Add the following to your message resource bundle and modify to set the appropriate formatting of Struts tags:

org.apache.struts.taglib.bean.format.sql.timestamp=yyyy-MM-dd HH:mm:ss HH:mm:ss
org.apache.struts.taglib.bean.format.sql.time=yyyy-MM-dd HH:mm:ss HH:mm:ss

See also JbossHintsAndTips, JbossLog4J

      • Frank Dean - 10 June 2003