Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Spring Basics Creating Controllers and Views The Gift of Design

Kent Dong
Kent Dong
2,295 Points

Can not resolve gifs/gif.name/gif.favorite in home.html

<div class="gifs container"> <div class="row"> <div th:each="gif : ${gifs}" class="col s12 l4"> <a th:href="@{'/gif/' + ${gif.name}}"> <img th:src="@{'/gifs/' + ${gif.name} + '.gif'}" /> <a href="#" th:class="(${gif.favorite} ? 'un' : '') + 'mark favorite'"></a> </a> </div> </div> </div>

Kent Dong
Kent Dong
2,295 Points

And I can not see the gifs robots as shown in video in the browser

3 Answers

Roman Mayer
Roman Mayer
10,925 Points

I fixed the issue. Look here:

https://teamtreehouse.com/community/code-in-zipfile-is-different-from-code-in-video

There you can find the right code snippet.

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

Looks like you should change /gif/ to /gifs in <a>.

Advice: If unsure, please compare your data to Chris repo.

Here is for example his index.html that looks different than yours

<div class="gifs container">
    <div class="row">
        <div th:each="gif : ${gifs}" class="col s12 l4">
            <a th:href="@{|/gifs/${gif.id}|}" class="actions">
                <img th:src="@{|/gifs/${gif.id}.gif|}" alt="gif" />
                <form th:action="@{|/gifs/${gif.id}/favorite|}" method="post">
                    <button type="submit" th:class="(${gif.favorite}? 'un' : '') + 'mark favorite'"></button>
                </form>
            </a>
        </div>
    </div>
</div>

If still having errors, share project on GitHub and share a link, I can take a look...

Roman Mayer
Roman Mayer
10,925 Points

I'm having the same problem right now. And the code that Kent posted is the code from the current project zip file. The code that you posted is fairly old, I think. And in the video there is a third version of the code...

Roman Mayer
Roman Mayer
10,925 Points

you're actually looking in the wrong repo (hibernate), but this course is Spring basics /edit: oh, i see, it's the same app

Roman Mayer
Roman Mayer
10,925 Points
<div th:each="gif : ${static.gifs}" class="col s12 l4">

static.gifs should be there. But I don't know yet how to access the gif object properly.