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

Gavin King gavin.king at jboss.com
Mon Jun 25 18:56:48 EDT 2007


  User: gavin   
  Date: 07/06/25 18:56:48

  Added:       src/main/org/jboss/seam/annotations/exception  
                        HttpError.java Redirect.java
  Log:
  exception(s)
  
  Revision  Changes    Path
  1.1      date: 2007/06/25 22:56:48;  author: gavin;  state: Exp;jboss-seam/src/main/org/jboss/seam/annotations/exception/HttpError.java
  
  Index: HttpError.java
  ===================================================================
  package org.jboss.seam.annotations.exception;
  
  import static java.lang.annotation.ElementType.TYPE;
  import static java.lang.annotation.RetentionPolicy.RUNTIME;
  
  import java.lang.annotation.Documented;
  import java.lang.annotation.Inherited;
  import java.lang.annotation.Retention;
  import java.lang.annotation.Target;
  
  import javax.servlet.http.HttpServletResponse;
  
  /**
   * Specifies that an exception results in a HTTP error.
   * 
   * @author Gavin King
   *
   */
  @Target(TYPE)
  @Retention(RUNTIME)
  @Documented
  @Inherited
  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;
     /**
      * Should the current long-running conversation end
      * when this exception occurs.
      * 
      * @return true if we should end the conversation
      * @deprecated use @ApplicationException(end=true)
      */
     boolean end() default false;
  }
  
  
  
  1.1      date: 2007/06/25 22:56:48;  author: gavin;  state: Exp;jboss-seam/src/main/org/jboss/seam/annotations/exception/Redirect.java
  
  Index: Redirect.java
  ===================================================================
  package org.jboss.seam.annotations.exception;
  
  import static java.lang.annotation.ElementType.TYPE;
  import static java.lang.annotation.RetentionPolicy.RUNTIME;
  
  import java.lang.annotation.Documented;
  import java.lang.annotation.Inherited;
  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
  @Inherited
  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();
     /**
      * Should the current long-running conversation end
      * when this exception occurs.
      * 
      * @return true if we should end the conversation
      * @deprecated use @ApplicationException(end=true)
      */
     boolean end() default false;
  }
  
  
  



More information about the jboss-cvs-commits mailing list