[cvs] expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller ControllerResponse.java

JCorporate Ltd jcorp at jcorp2.servlets.net
Sun Sep 12 01:09:54 PDT 2004


Update of /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller
In directory jcorp2.servlets.net:/tmp/cvs-serv32522/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller

Modified Files:
	ControllerResponse.java 
Log Message:
provide tools for getString() that doesn't throw


Index: ControllerResponse.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ControllerResponse.java,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** ControllerResponse.java	9 Jul 2004 07:44:38 -0000	1.46
--- ControllerResponse.java	12 Sep 2004 08:09:52 -0000	1.47
***************
*** 781,785 ****
      }
  
!     /* getString(String, Object[]) */
  
      /**
--- 781,814 ----
      }
  
!     /**
!      * Pass on a call to retrieve an appropriate localized string from the
!      * correct Schema object. This version of the call is overridden with more
!      * sophisticated versions in DBController (which knows the username)
!      *
!      * @param stringCode the String code to retrieve
!      * @param args       the formatting arguments
!      * @return translated string, or stringCode if not found
!      * @throws ControllerException      upon error
!      */
!     public String getStringUnrequired(String stringCode, Object[] args)
!             throws ControllerException {
!         StringUtil.assertNotBlank(stringCode, "You must specify a string key");
! 
!         if (myRequest == null) {
!             log.error("No request object was established for this controller response, " +
!                     " for controller class '" +
!                     StringUtil.notNull(myControllerClass) + "'");
! 
!             return null;
!         }
! 
!         Stack s = this.getSchemaStack();
!         try {
!             return Messages.getStringUnrequired(s, this.responseLocale, stringCode, args);
!         } catch (IllegalArgumentException ex) {
!             throw new IllegalArgumentException("Unable to locate string " + stringCode + " for any schema");
!         }
!     }
! 
  
      /**



More information about the cvs mailing list