-
1. Re: Is there a way to dynamically forward wildfly main page to deployed application?
jaikiran Jul 13, 2019 10:21 AM (in response to d47im5e)1 of 1 people found this helpfulYou can deploy your web application to "root" context. That way it's available at ip:port/
To do that you will have to include a jboss-web.xml and specify the context as "/", if you are deploying the application as a .war file. However, if you are deploying it as a .ear, you can just use the (portable) application.xml and for the "web-app" module specify the context there as "/". I don't have ready examples, right now, to show how it's done, but it should be relatively easy to find such examples online.
-
2. Re: Is there a way to dynamically forward wildfly main page to deployed application?
marjinal1st Jul 14, 2019 2:47 PM (in response to d47im5e)1 of 1 people found this helpfulYou can create an exploded ROOT artifact containing an index.html file, which contains meta tag redirecting to whatever URL you like.
Steps to follow (assuming you're deploying to standalone):
- Create a folder named ROOT.war in standalone/deployments.
- Create empty index.html and ROOT.war.dodeploy files in that folder.
- Create a basic HTML structure in index.html like this:
<html>
<head>
<meta http-equiv="refresh" content="0;url=http://localhost:8080/myApp" />
</head>
</html>
Whenever you visit http://localhost:8080, index.html will refresh the page and redirect to the URL you pointed. If you'd like to add some delay, for example 3 seconds, change value 0 to 3.
-
3. Re: Is there a way to dynamically forward wildfly main page to deployed application?
d47im5e Jul 16, 2019 2:18 AM (in response to d47im5e)Thank you for your kind responses, i will try them on seperately. I couldn't put the words on the post exactly i wanted, but the suggestions are valid for me. To simplify my question, i will try to describe my wishes in my dev enviroment below,
I have two seperate projects(war), which can use the same wildfly in my dev env. What i wish is, when i deploy one of these projects, i wish wildfly to get deployed application's root context (i.e. /myapp for one, /app2 for the other ) and if one is deployed, it should automatically forward itself to the deployed app(localhost:8080/myapp or localhost:8080/app2).
Is this possible?
Thank you.
-
4. Re: Is there a way to dynamically forward wildfly main page to deployed application?
marjinal1st Jul 16, 2019 3:16 AM (in response to d47im5e)d47im5e wrote:
... i wish wildfly to get deployed application's root context (i.e. /myapp for one, /app2 for the other ) and if one is deployed, it should automatically forward itself to the deployed app(localhost:8080/myapp or localhost:8080/app2).
Well, I think that kind of deployment logic is way too redundant and AFAIK (correct me if I'm wrong) it's not possible. If you really like to do it, it may require you to dive into Wildfly (source code level) internals, which I wouldn't recommend it at all.