sigit hadi wibowo
sigit hadi wibowo

Reputation: 45

Why i cant set my app into root context in jboss ?

so this is my first time i ask question ,

i got a lil bit problem in my jboss configuration .

im using jboss 6.2

already read this article

  1. http[:]//www.mastertheboss.com/jboss-web/jbosswebserver/how-to-deploy-a-web-application-on-the-root-context-on-jboss-as-7
  2. https[:]//developer.jboss[dot]org/wiki/HowdoIoverridethewebcontextroot
  3. https[:]//stackoverflow[dot]com/questions/21957060/jboss-deploying-in-root-context

what i have done ?

  1. create jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>  
<jboss-web>  
    <context-root>/</context-root>  
</jboss-web>
  1. set enable-welcome-content to false in my standalone/configuration/standalone.xml
 <virtual-server name="default-host" enable-welcome-root="false">
  1. change myapp.war to ROOT.war and deploy into standalone/deployments/
  2. set my welcome-file-list to login.xhtml
 <welcome-file-list>
<welcome-file>login.xhtml</welcome-file>
 </welcome-file-list>

and here's the issue is

when request root itself 192.168.1.98 welcome-content

and when i request 192.168.1.86/login.xhtml

viola ! it works

what i want is when i request just the ip address , it link to login.xhtml . right now , i have to request my ip + login.xhtml ( 192.168.1.86/login.xhtml )

then what should i do ?

need your help guys .

any ideas are welcome .

thanks .

Upvotes: 2

Views: 716

Answers (1)

mendieta
mendieta

Reputation: 3500

Your setup is correct.. What you are missing is a index.html (placed in your wars root folder) that redirects to your login page..

When you request 192.168.1.86, your index.html is read.. So, you need to redirect from there to your login page.

For example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <!-- forward to your login -->
    <meta http-equiv="refresh" content="0;url=login.xhtml;charset=utf-8">
</head>
</html>

Upvotes: 2

Related Questions