title: Is there any way to simulate HTTP Error responses 5xx and 4xx
body: <p>I am developing a RESTful service which has two severs talking to each other, which may be named as external and internal.
  Internal registers requests to external for further processing. Only external is accessible to users. </p>
  
  <p>For testing reliability my link between internal and external server, I want to simulate HTTP error as returned by external to internal. Is there any easy way to do so or I'll have to hardcode the response being sent by external to internal for testing mainly 5xx and 4xx errors.</p>
  
  <p>Server I am using is JBoss if at all this info is needed.</p>
  
  <p>On searching Google, I found this data for iPlanet</p>
  
  <p><em>1. edit the obj.conf or your virtual server specific obj.conf</em></p>
  
  <p><em>2. Add the following line under </em></p>
  
  <p><em>Error code="200" fn="set-variable" error="503"</em></p>
  
  <p><em>this would return 503 even for successful serving (which would cause 200 to be returned by the default).</em></p>
  
  <p>I am looking for something similar for <strong>JBoss</strong></p>