Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4607486
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:42:36+00:00 2026-05-22T00:42:36+00:00

I needed some templates to render some code for users to paste. I put

  • 0

I needed some templates to render some code for users to paste. I put these into

/project-dir/grails-app/resources/templates/quickInstallCode.html

Then I tried accessing them using their relative path (grails-app/resources/templates/quickInstallCode.html), and it worked great.

When we then deployed the application to a Tomcat Server, using a .war file, the paths began pointing to a wrong location.

ERROR  call, Template file /var/lib/tomcat6/grails-app/resources/templates/quickInstallCode.html not found.

I assumed, that Grails, giving good defaults for everything would handle this mess for me, but it seems like it does not.

I also tried this call, and it seemed to work great, but when deployed, the BuildSettingsHolder did not contain build Settings, which resulted in a fatal error.

BuildSettingsHolder.settings.baseDir.toString()

http://grails.org/doc/latest/api/grails/util/BuildSettingsHolder.html
http://grails.org/doc/latest/api/grails/util/BuildSettings.html

I am pretty frustrated that I cannot get this easy task to work, but the reason that this is so complicated seems to be that all Files are encapsuled in a WAR and not unpacked on the Server.

So the Questions are:

  • Where in your Project would you put
    Files like this?
  • How to get a
    reliable and stable way to access
    this files? I just need a stable path to a base directory, without having to hardcode something in the configuration … This cannot be so hard.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:42:37+00:00Added an answer on May 22, 2026 at 12:42 am

    I have 2 solution to propose for this situation:

    1. Save the template in the database, in a setting table. This way guarantees that nothing can go wrong.

    2. You can consider using the resource folder like Sachin & Nirmal has proposed. About security, I think you can configure SpringSecurity Plugin to protect the specific resources, so that it can only be accessed by the site user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some initialization code that makes sure that all the needed resources are
I needed some simple string encryption, so I wrote the following code (with a
I wanted to emulate a popular flash game, Chrontron, in C++ and needed some
Say there is some functionality needed for an application under development which could be
Is there some additional configuration needed before I can set thread priorities in a
I needed to convert a Java 1.5se app to C# 2.0. Does anyone know
I have a web-app consisting of some html forms for maintaining some tables (SQlite,
I'm test building a scraping site with django. For some reason the following code
I have an app that makes user of filtering certain things for users with
In a software-project written in java you often have resources, that are part of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.