0

To use the URL as http://myUrl:13001/myAppName, the following contents are specified in the grails-app/conf/application.yml file.

environments:
    production:
        grails:
            serverURL: http://myUrl:13001/myAppName

To run, in grails 4.0.11 ./gradlew -Dgrails.env=prod bootRun command was executed.

And when I enter http://myUrl:13001/myAppName in the browser address bar to log in, The login screen of http://myUrl:13001/myAppName/ came out properly.

However, since this is the first login, after clicking the registration link, http://myUrl:13001/myAppName/register/index is displayed properly in the address bar.

After completing the input on the registration screen and pressing Enter, It appears as http://myUrl:13001// only, and HTTP Status 404 - Not Found is displayed.

Also, I made a war file and tried to run it in Tomcat made with Docker, but the same error is displayed.

I would appreciate it if you let me know if there are any other settings to add other than this

1 Answers1

0

I misunderstood for a moment and asked a question.

To study grails 4, I downloaded the grails4-spring-security-login-example project from github.com.

The login form in grails-app/views/login/auth.gsp was as follows.

<form class="form-signin" action="${postUrl ?: '/login/authenticate'}" method="POST" id="loginForm" autocomplete="off">

The '/login/authenticate' part is hard-coded. There was no problem in the test, but I needed to set the URL to http://myUrl:8086/myAppName to run Tomcat.

Now I have modified that '/login/authenticate' part to '/myAppName/login/authenticate' and it is running normally.

Unfortunately, I decided to use it that way now. I'd love to hear some advice on whether there is a better way.

Thank you for your interest.

  • @GerarddeVisser: While it'd be a cleaner answer without the follow-up request for better solutions, this is very clearly offering an answer. – Jeremy Caney Jul 20 '21 at 19:17