title: Redirect to and from http and https using java server behind amazon elb
body: <p>I have an Amazon ELB for my domain www.example.com. At the moment there is one instance behind the ELB running a web app on JBoss 6.0. I want to be able to redirect the user from and to http and https depending on the path. There are three paths only that require https and the other paths should only be accessed through http. I am able to do the redirect to https for the three paths (using web.xml) but not the redirection back to http for the other paths.</p>
  
  <p>I am not using the apache server in front of JBoss so I want to achieve everything through plain Java and JBoss. I want to either use the web.xml or the <a href="http://code.google.com/p/urlrewritefilter/" rel="nofollow">urlrewritefilter</a> but preferably not both.</p>
  
  <p>Any advice would be greatly appreciated.</p>
  
  <p>Regards</p>