java - Suppress Jboss version details from HTTP error response -
my jboss verson jboss eap 6.3
when kind of error response sent jboss, adds server information response. following sample row response:
http/1.1 400 bad request server: apache-coyote/1.1 content-type: text/html;charset=utf-8 content-length: 2391 date: tue, 19 jul 2016 09:30:46 gmt connection: close
jboss web/7.4.8.final-redhat-4 - jbweb000064: error report
jbweb000065: http status 400 - org.codehaus.jackson.map.jsonmappingexception: can not construct instance of mybean.type string value 'xyz': value not 1 of declared enum instance names @ [source: org.jboss.resteasy.core.interception.messagebodyreadercontextimpl$inputstreamwrapper@5e421c2b; line: 14, column: 26] (through reference chain: requestargs["request"])
jbweb000309: type jbweb000067: status report
jbweb000068: message org.codehaus.jackson.map.jsonmappingexception: can not construct instance of mybean.type string value 'xyz': value not 1 of declared enum instance names @ [source: org.jboss.resteasy.core.interception.messagebodyreadercontextimpl$inputstreamwrapper@5e421c2b; line: 14, column: 26] (through reference chain: requestargs["request"])
jbweb000069: description jbweb000120: request sent client syntactically incorrect.
jboss web/7.4.8.final-redhat-4
here, server version can replaced costume name using "-dorg.apache.coyote.http11.http11protocol.server=myserver" parameter while starting server. how replace "jboss web/7.4.8.final-redhat-4" specified in title & footer?
by creating custom error pages (for each error error_400.html, error_500.html etc), can resolved then, actual error message needs included dynamically has challenge.
is there easy way suppress jboss version related information responses sent using jboss?
for issue need configure custom error pages @ jboss eap level.
create custom root app provide custom error page follows :
- set enable-welcome-root="false" in standalone-*.xml or domain.xml in web subsystem.
- deploy basic root.war archive web.xml includes error page http errors.
when, enable-welcome-root="true", pages served welcome-content folder present in eap 6 , when hit example localhost:8080, can see index.html page present in welcome-folder. if deploy custom root.war, see custom error page supplied.
Comments
Post a Comment