Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails dynamic baseurl for multi-url webapp

Tags:

url

grails

vhosts

Any one have an idea how to use a dynamic baseurl??

f.e: I have file.war and I want to deploy the same war for www.webapp1.com & www.webapp2.com

I tried to use alias for my server.xml host, and I tried to use a separated host in server.xml.. but every time I try webapp2.com url I get the webapp1.com.

like image 849
elacheche Avatar asked Mar 14 '26 13:03

elacheche


1 Answers

Grails registers a bean named grailsLinkGenerator. I believe you can accomplish what you're trying to do by overriding this bean with your own custom logic. Your bean must implement the LinkGenerator interface. You might find it easiest to extend DefaultLinkGenerator or CachingLinkGenerator

like image 133
Andrew Avatar answered Mar 16 '26 03:03

Andrew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!