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 8610617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:10:39+00:00 2026-06-12T04:10:39+00:00

I have a little problem and no idea + grey hair. I dont know

  • 0

I have a little problem and no idea + grey hair.

I dont know much about gsp’s, groovy, grails etc. But here’s the situation:

I need to display an image if the number I get from mongodb is greater than 4.5, for example.

I tried many different stuff like that:

                    <g:if test="${profil.punkte >0.1}">
                    <img src="${resource(dir: 'images', file: '1_5.gif')}" alt="gesamtbewertung in sternen" >
                    </g:if>
                    <g:elseif test="${profil.punkte >1.49}">
                    <img src="${resource(dir: 'images', file: '2_5.gif')}" alt="gesamtbewertung in sternen" >
                    </g:elseif>
                    <g:elseif test="${profil.punkte >2.49}">
                    <img src="${resource(dir: 'images', file: '3_5.gif')}" alt="gesamtbewertung in sternen" >
                    </g:elseif>
                    <g:elseif test="${profil.punkte >3.49}">
                    <img src="${resource(dir: 'images', file: '4_5.gif')}" alt="gesamtbewertung in sternen" >
                    </g:elseif>
                    <g:elseif test="${profil.punkte >4.49}">
                    <img src="${resource(dir: 'images', file: '5_5.gif')}" alt="gesamtbewertung in sternen" >
                    </g:elseif>

I tried a lot of different syntaxes to solve this, but it just won´t work. In the version above it always shows 1_5.gif

The entry in the “profil.groovy” looks sth. Like:

class Profil {
ObjectId id
...
...
double punkte
}

And the entry in mongodb´s JSON looks like :

 "punkte": 4.3,

I just need to type ${profil.punkte} and I get 4.3 rendered.

Hope you understand my problem even if my english is broken.
I will make a backflip on my laptop for solving!

  • 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-12T04:10:40+00:00Added an answer on June 12, 2026 at 4:10 am

    Well, you need to make better conditions. Do you see that 4.3 is greater than 0.1? Then it always enters the first if and nothing else.

    Add some limit in your conditions and it will work.

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

Sidebar

Related Questions

I love the Intellij IDEA but i have been stacked on one little problem
I have a little problem about the sort direction of a specific column in
I have a little problem about Google Maps. I'm using Geocoding (xml) for getting
I have little problem with mod_rewrite and I absolutely have no idea what to
Im currenty develoding a website using mvc 3 razor but have a little problem.
i have a little problem and i have no idea what is wrong var
I have a little problem that I don't know how to solve. Ajax validation
I have a little problem right now and I don't know how to fix
I'm trying to set pu my git, but I have a little problem with
I have little problem with a replacement of a little part in an url.

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.