I cant even print messages in the console
Why are you trying to do this? This is a bad practice in web apps. Besides, JBoss AS reroutes all output to stdout and stderr to the log. So the question becomes, have you change the CONSOLE log settings? (Also, what is the exact version of JBoss AS - the various EAP versions turn off the CONSOLE log, if I recall correctly)
and it is refreshing the page even with many attempts.
You lost me here. I have no idea what this means.