0

I have installed the spring security core plugin. I need to modify the login page to look like my existing website. I have searched the entire project and cannot find it. I am running grails 2.4 and spring-security-core:2.0-RC5. Where can this pesky little file be? Can someone who is not a complete greenhorn help a fellow out?

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
user1769667
  • 329
  • 1
  • 5
  • 16
  • It's generated by code in the spring-security-web JAR. see https://stackoverflow.com/questions/20911000/change-login-page-for-spring-security-plugin-in-grails – Neil McGuigan Aug 21 '15 at 00:27

2 Answers2

3

As @Abs points out, the file is at target/work/plugins/spring-security-core-2.0-RC5/grails-app/views/login/auth.gsp but you shouldn't edit plugin files. Other developers on your team won't have access to the modified files and if you delete the target directory you'll lose your changes since the target directory is only a temporary work location.

Instead, copy the file to the same relative location in your application and make changes there. Create grails-app/views/login and copy the file there and make whatever changes you want.

This technique works for most plugin files, not just GSPs. The compilation order and classpath are configured such that application files and classes override plugin files if they're in the same location/package.

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
  • target/work/plugins/spring-security-core-2.0-RC5/grails-app/views/login/auth.gsp does not exist in my project? The path stops at target/work/plugins/spring-security-core-2.0-RC5/ and the only available folders are scripts and src. Did I install it incorrectly? – user1769667 Aug 22 '15 at 16:24
  • I was viewing it from the grails tools suite and not from my file system. – user1769667 Aug 22 '15 at 16:29
-1

You can find the default login page here

targt->work->plugins->spring-security-core-2.0-RC5->grails-app->views->login>auth.gsp

ABC
  • 4,263
  • 10
  • 45
  • 72
  • @BurtBeckwith I didn't mean that edit in plugin file I just not explained that it should override, +1 for your explanation. – ABC Aug 21 '15 at 04:57