MyJavaCode.com

Tutorial and How to Guide on Java Programming. Topics covered include Java Programming Language - Core Java, Spring, Webservices, REST, Hibernate, Maven and Microservices.

  • Core Java
  • REST API’s
  • Spring boot
  • Hibernate
  • Interview Questions
  • Contact Us
  • Projects
  • Offerings

HTTP Redirection Configuration in JBoss

January 15, 2025 By Prasanna Manjunatha

In our previous article we have explained how to configure Wildcard SSL Certificate in JBoss application server. As the next step, you will have to configure HTTP redirection so as to redirect all the incoming HTTP request’s to HTTPS to make sure your Java app is completely secured. In this article we will give you the steps to configure this in JBoss.

  • JaCoCo Code Coverage in Springboot Applications : A Comprehensive Guide
  • How to Password Protect a PDF File using Java : A Step-by-Step Guide

Steps for HTTP Redirection in JBoss

1. Update redirect port in http connector

As the first step, you need to configure JBoss Application Server so as to redirect all the incoming HTTP requests to the HTTPS port. This can be done by updating the HTTP connector section in the standalone.xml of JBoss Application Server as shown below.

<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="443"/>

 

2. Update Security Constraint in web.xml

Update the web.xml of the web application (war file) with the below entry for security constraint,

<security-constraint> 
<web-resource-collection> 
  <web-resource-name>TestWebApp</web-resource-name> 
  <url-pattern>/*</url-pattern>
  <http-method>GET</http-method>
  <http-method>POST</http-method> 
</web-resource-collection> 
<user-data-constraint> 
  <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
</user-data-constraint> 
</security-constraint>

 

After completing the above 2 steps, you can redeploy & restart the JBoss Application server to test the changes.

email
print

About Prasanna Manjunatha

Prasanna is a Toronto based Java Consultant with more than 15 years of Software Development experience. His areas of expertise include Core Java, Spring boot, REST, Microservices, Hibernate, NoSQL, Docker, Kubernetes and AWS.

Currently Trending

  • How to check whether a Collection is Null or Empty in Java

  • How to Solve Maven invalid CEN header error

  • How to Extract Private Key from Java Keystore (.JKS) or .P12 File

  • How to Generate MD5 Hash in Java

  • How to Check Free Disk Space in Java

  • HTTP Redirection Configuration in JBoss

  • How to Update MySQL Collation for all tables in the schema

  • Five minutes guide for creating SOAP web service in Java using Axis2

  • How to configure JaCoCo for Code Coverage in Spring boot Applications

  • Wildcard SSL Certificate Configuration in JBoss

Connect with us

  • Facebook
  • GitHub
  • LinkedIn
  • Twitter

TAG CLOUD

Axis2 CodeCoverage Code Coverage cron expression Data Structure Frameworks Hashing HashMap Hibernate IntelliJ java Java Mail jboss jpa 2.1 Maven MyBatis MySQL PDF Quartz REST REST API SOAP Spring boot Springboot SQL Tools Tutorial web service

All time Popular Posts

  • How to Solve Maven invalid CEN header error

  • How to Extract Private Key from Java Keystore (.JKS) or .P12 File

  • How to check whether a Collection is Null or Empty in Java

  • How to configure JaCoCo for Code Coverage in Spring boot Applications

  • How to Generate MD5 Hash in Java

  • How to Check Free Disk Space in Java

  • How to Deploy Exploded WAR file in JBoss EAP Server

  • Automate Audit Fields in Spring Boot with MyBatis: A Generic Solution for CRUD Operations

  • How to Password Protect a PDF File using Java

  • Five minutes guide for creating SOAP web service in Java using Axis2

Copyright © 2025 MyJavaCode.com