Author name: Manuel Bogner

Change SERVER header in EAP6

I found no way to remove the Server header in EAP6. But there is a way to change its content. Just add the folling config to your standalone.xml: <system-properties>   <property name=”org.apache.coyote.http11.Http11Protocol.SERVER” value=”foo”/> </system-properties> Or with cli: /system-property=org.apache.coyote.http11.Http11Protocol.SERVER:add(value=foo) Then your header just is Server: foo instead.

Change SERVER header in EAP6 Read More »

Remove X_POWERED_BY Header in JBoss EAP6

First you have to disable it in standalone.xml by adding jsp-configuration x-powered-by=”false”. Here the relevant part of my config: <subsystem xmlns=”urn:jboss:domain:web:1.5″ default-virtual-server=”default-host” native=”false”> <connector name=”http” protocol=”HTTP/1.1″ scheme=”http” socket-binding=”http”/> <virtual-server name=”default-host” enable-welcome-root=”false”> <alias name=”localhost”/> </virtual-server> <configuration> <jsp-configuration x-powered-by=”false”/> </configuration> </subsystem> Or with cli: /subsystem=web/configuration=jsp-configuration:write-attribute(name=x-powered-by,value=false) In a JSF application you have to add the following context param: <context-param>

Remove X_POWERED_BY Header in JBoss EAP6 Read More »

Make your webapplication log debug messages under jboss

I often catch myself writing info-messages because jboss is configured to info-mode by default. By adding the following few lines you can make your application use debug mode: <subsystem xmlns=”urn:jboss:domain:logging:2.0″> … <!– add begin –> <console-handler name=”DEBUGCONSOLE”> <level name=”DEBUG” /> <formatter> <pattern-formatter pattern=”%d{HH:mm:ss,SSS} %-5p [%c] (%F:%L) %s%E%n” /> </formatter> </console-handler> <logger category=”pm.mbo” use-parent-handlers=”false”> <level name=”DEBUG”

Make your webapplication log debug messages under jboss Read More »

Create instance of javax.validation.Validator manually

To bootstrap javax.validation.Validator you can simply use the following code: final ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); final Validator validator = factory.getValidator(); For further information documentation see for version 5.1 http://docs.jboss.org/hibernate/validator/5.1/reference/en-US/html/chapter-bootstrapping.html#section-retrieving-validator-factory-validator for version 4.3 http://docs.jboss.org/hibernate/validator/4.3/reference/en-US/html/validator-bootstrapping.html#section-validator-instance

Create instance of javax.validation.Validator manually Read More »