Skip to content

Commit

Permalink
All handlers are working correctly now in the example
Browse files Browse the repository at this point in the history
This should complete coding work for Alpha2!
  • Loading branch information
LightGuard committed Dec 2, 2010
1 parent 6a23fc0 commit 8059bdd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Expand Up @@ -36,8 +36,18 @@ public Class<? extends Throwable> getForType()
return forType;
}

public void setForType(Class<? extends Throwable> forType)
{
this.forType = forType;
}

public String getMessage()
{
return message;
}

public void setMessage(String message)
{
this.message = message;
}
}
Expand Up @@ -32,6 +32,11 @@ public RestExceptionResponse(Class<? extends Throwable> forType, String message,
this.statusCode = statusCode;
}

public void setStatusCode(int statusCode)
{
this.statusCode = statusCode;
}

public int getStatusCode()
{
return statusCode;
Expand Down
Expand Up @@ -11,6 +11,7 @@
@ExceptionResponseService
public interface DeclarativeRestExceptionHandlers
{
// Due to JAX-RS multiple handlers that modify the response builder, the last one wins, so you wouldn't see this anyway
// @SendHttpResponse(status = 404, message = "Requested resource does not exist")
// void onNoResult(@Handles @RestRequest CaughtException<NoResultException> e);

Expand Down
3 changes: 3 additions & 0 deletions examples/jaxrs/src/main/resources/META-INF/seam-beans.xml
Expand Up @@ -29,10 +29,13 @@
<e:RestExceptionResponse forType="javax.persistence.NoResultException"
statusCode="404" message="The resource requested does not exist (XML-configured response)"/>
</value>
<!--
Due to JAX-RS multiple handlers that modify the response builder, the last one wins, so you wouldn't see this anyway
<value>
<e:RestExceptionResponse forType="java.lang.IllegalArgumentException"
statusCode="400" message="Illegal value (XML-configured response)"/>
</value>
-->
</e:mappings>
</e:ExceptionResponseMappings>

Expand Down

0 comments on commit 8059bdd

Please sign in to comment.