So, to recap, you opened a browser on the same box where AS7 resides -- on the localhost (127.0.0.1). a) when you type "http://localhost:port" the app does not get redirected. b) when you type "http://localhost:port/demo" and it works fine.
Did you ensure ROOT.war was redeployed after you made the change to index.jsp that is within it. If not, you should remove ROOT.war and ROOT.war.deployed file from standalone/deployments and then redeploy ROOT.war. Double-check console or server.log to ensure it was deployed without error. Assuming deployed without error, try a) above again. If it does not work, I guess you could try the following:
If you're on Windows, consider installing fiddler and setting it up as a proxy between browser (IE?) and AS7. Then examine the request and responses after hitting http://yourdomain:port. You would see the response from the server and whether it was sending back a redirect...
Hi Richard,
Thanks so much for your overview, I found I did not add ROOT.war.dodeploy to make it deployed at all. After deploying ROOT.war successfully, the redirect works now.
BTW, only a context name is ok in the index.jsp for the redirection.
<% response.sendRedirect("/demo"); %>
Really appriciated.