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

  • SEARCH
  • Home
  • 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 7725339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:54:46+00:00 2026-06-01T04:54:46+00:00

I am using grails 2.0.1 and i tried linking to the html page using

  • 0

I am using grails 2.0.1 and i tried linking to the html page using with the direct url=”somefile.html> but it is not working out . How do i do it ?please help

  • 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-06-01T04:54:47+00:00Added an answer on June 1, 2026 at 4:54 am

    You need to do two things:

    1. Make sure the file is stored under web-app/somefile.html, this is where you store raw files for the server.
    2. Instead of using a hard-coded URL, use the g.resource() method or the <g:resource> tag. In these cases, you’ll use it like so:

      <a href="${g.resource(file:'somefile.html')}">My Link</a>
      

    The reason to use the g.resource tag is it guarantees a correct link to the file. If you just hard code the file like href="somefile.html", then is is a relative path. If you are at the URI myapp/controller/action/foo, it will look for the file under myapp/controller/action/somefile.html.

    Note: If you are using the cached-resources plugin or something similar, you will find the output URL is not actually myapp/somefile.html. The file is still accessible from that location, but the generated links will point to a static URL instead.

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

Sidebar

Related Questions

I am using Grails 1.2.x (Tried both 1.2.0 and 1.2.2- same behavior) I am
I'm using Grails and want to use groovyws to call an web-service. But my
I'm using the Grails Webflow plugin. Here are the domain objects I'm working with:
I tried to bind data to a template created using GroovyPagesTemplateEngine, but cannot. Here
When using Grails 1.1 together with a MySQL the charsets of the auto-generated database
I'm using Grails 1.1 beta2. I need to import a large amount of data
I'm considering using Grails for my current project. I have a couple of requirements
Hi I'm using grails navigation plugin and when it generates menus it put the
I am using Grails Webflow, what ever object I pass to a view, it
I'm using Grails 1.3.7 and the db-migration plug-in. I have generated a chagelog.groovy-file containing

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.