[jboss-cvs] jboss-seam/src/main/org/jboss/seam/annotations ...

Gavin King gavin.king at jboss.com
Thu Jul 27 20:46:31 EDT 2006


  User: gavin   
  Date: 06/07/27 20:46:31

  Modified:    src/main/org/jboss/seam/annotations    HttpError.java
                        Redirect.java
  Added:       src/main/org/jboss/seam/annotations    Render.java
  Log:
  added @Render, and javadoc
  
  Revision  Changes    Path
  1.2       +19 -0     jboss-seam/src/main/org/jboss/seam/annotations/HttpError.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HttpError.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/annotations/HttpError.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- HttpError.java	30 Jun 2006 14:41:45 -0000	1.1
  +++ HttpError.java	28 Jul 2006 00:46:30 -0000	1.2
  @@ -9,10 +9,29 @@
   
   import javax.servlet.http.HttpServletResponse;
   
  +/**
  + * Specifies that an exception results in a HTTP error.
  + * 
  + * @author Gavin King
  + *
  + */
   @Target(TYPE)
   @Retention(RUNTIME)
   @Documented
   public @interface HttpError
   {
  +   /**
  +    * The message to be sent in the HTTP error, default
  +    * to using the exception message.
  +    * 
  +    * @return a templated message
  +    */
  +   String message() default "";
  +   
  +   /**
  +    * The HTTP error code, default to 500.
  +    * 
  +    * @return an error code
  +    */
      int errorCode() default HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
   }
  
  
  
  1.2       +19 -0     jboss-seam/src/main/org/jboss/seam/annotations/Redirect.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Redirect.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/annotations/Redirect.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- Redirect.java	30 Jun 2006 14:41:45 -0000	1.1
  +++ Redirect.java	28 Jul 2006 00:46:30 -0000	1.2
  @@ -7,10 +7,29 @@
   import java.lang.annotation.Retention;
   import java.lang.annotation.Target;
   
  +/**
  + * Specifies that an exception should result in a 
  + * browser redirect.
  + * 
  + * @author Gavin King
  + *
  + */
   @Target(TYPE)
   @Retention(RUNTIME)
   @Documented
   public @interface Redirect
   {
  +   /**
  +    * The message to be displayed as a FacesMessage, default
  +    * to using the exception message.
  +    * 
  +    * @return a templated message
  +    */
  +   String message() default "";
  +   /**
  +    * The view to redirect to, default to the current view.
  +    * 
  +    * @return a JSF view id
  +    */
      String viewId();
   }
  
  
  
  1.1      date: 2006/07/28 00:46:30;  author: gavin;  state: Exp;jboss-seam/src/main/org/jboss/seam/annotations/Render.java
  
  Index: Render.java
  ===================================================================
  package org.jboss.seam.annotations;
  
  import static java.lang.annotation.ElementType.TYPE;
  import static java.lang.annotation.RetentionPolicy.RUNTIME;
  
  import java.lang.annotation.Documented;
  import java.lang.annotation.Retention;
  import java.lang.annotation.Target;
  
  /**
   * Specifies that an exception should result in immediate
   * rendering of the view. This may only be used with 
   * exceptions thrown during the INVOKE_APPLICATION phase.
   * 
   * @author Gavin King
   *
   */
  @Target(TYPE)
  @Retention(RUNTIME)
  @Documented
  public @interface Render
  {
     /**
      * The message to be displayed as a FacesMessage, default
      * to using the exception message.
      * 
      * @return a templated message
      */
     String message() default "";
     /**
      * The view to render, default to the current view.
      * 
      * @return a JSF view id
      */
     String viewId() default "";
  }
  
  
  



More information about the jboss-cvs-commits mailing list