You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2002/06/30 06:37:33 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/config ExceptionConfig.java

craigmcc    2002/06/29 21:37:32

  Modified:    conf/share struts-config_1_1.dtd
               src/share/org/apache/struts/config ExceptionConfig.java
  Log:
  You can now specify the optional "bundle" attribute on an <exception> element
  to declare which MessageResources bundle should be accessed to look up the
  corresponding message key.  There isn't yet any way to take advantage of this
  with the default ActionError and ActionMessage classes -- that needs to be
  reviewed and updated next -- but it is available for apps to use now.
  
  PR: Bugzilla #7902
  Submitted by:	Chuck Cavaness <chuckcavaness at attbi.com>
  
  Revision  Changes    Path
  1.19      +7 -1      jakarta-struts/conf/share/struts-config_1_1.dtd
  
  Index: struts-config_1_1.dtd
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/conf/share/struts-config_1_1.dtd,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- struts-config_1_1.dtd	28 Jun 2002 01:57:27 -0000	1.18
  +++ struts-config_1_1.dtd	30 Jun 2002 04:37:32 -0000	1.19
  @@ -143,6 +143,11 @@
        occur during Action delegation and should be handled by the
        ActionServlet.
   
  +    bundle           Servlet context attribute under which the message
  +                     resources bundle from which this message should be
  +                     acquired.  Default is the value specified by the
  +                     string constant Action.MESSAGES_KEY.
  +
       className        Implementation subclass of the standard configuration
                        bean, if you do not want to use the standard value.
                        [org.apache.struts.config.ExceptionConfig]
  @@ -166,6 +171,7 @@
   -->
   <!ELEMENT exception (icon?, display-name?, description?, set-property*)>
   <!ATTLIST exception      id             ID              #IMPLIED>
  +<!ATTLIST exception      bundle         %AttributeName; #IMPLIED>
   <!ATTLIST exception      className      %ClassName;     #IMPLIED>
   <!ATTLIST exception      handler        %ClassName;     #IMPLIED>
   <!ATTLIST exception      key            CDATA           #REQUIRED>
  
  
  
  1.4       +27 -4     jakarta-struts/src/share/org/apache/struts/config/ExceptionConfig.java
  
  Index: ExceptionConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/config/ExceptionConfig.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ExceptionConfig.java	23 Feb 2002 23:53:29 -0000	1.3
  +++ ExceptionConfig.java	30 Jun 2002 04:37:32 -0000	1.4
  @@ -92,6 +92,25 @@
   
   
       /**
  +     * The servlet context attribute under which the message resources bundle
  +     * to be used for this exception is located.  If not set, the default
  +     * message resources for the current subapp is assumed.
  +     */
  +    protected String bundle = null;
  +
  +    public String getBundle() {
  +        return (this.bundle);
  +    }
  +
  +    public void setBundle(String bundle) {
  +        if (configured) {
  +            throw new IllegalStateException("Configuration is frozen");
  +        }
  +        this.bundle = bundle;
  +    }
  +
  +
  +    /**
        * The fully qualified Java class name of the exception handler class
        * which should be instantiated to handle this exception.
        */
  @@ -202,6 +221,10 @@
           StringBuffer sb = new StringBuffer("ExceptionConfig[");
           sb.append("type=");
           sb.append(this.type);
  +        if (this.bundle != null) {
  +            sb.append(",bundle=");
  +            sb.append(this.bundle);
  +        }
           sb.append(",key=");
           sb.append(this.key);
           sb.append(",path=");
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>