404 -> GET /public/stylesheets/default.css

Asked by javier

when i used the last version(play-1.0-stable3-r212.zip 25-Nov-2008 12:07 15M),there is a 404 error:

404 -> GET /public/stylesheets/default.css

main.html:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>#{get 'title' /}</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <link rel="stylesheet" type="text/css" media="screen" href="/public/stylesheets/default.css" />
        <link rel="shortcut icon" type="image/png" href="/public/images/favicon.png" />
    </head>
    <body>
        #{doLayout /}
    </body>
</html>

Question information

Language:
English Edit question
Status:
Solved
For:
play framework Edit question
Assignee:
No assignee Edit question
Solved by:
Guillaume Bort
Solved:
Last query:
Last reply:
Revision history for this message
Best Guillaume Bort (guillaume-bort) said :
#1

Yes,

We're working on static files handling.

Basically add

GET /public staticDir:public

at the end of your conf/routes file. (Be aware of route priorities if you've
another route matching /public).
For more information check here :

http://www.playframework.org/manual/contents/routing#serving_static_resources

Thank.

On Tue, Nov 25, 2008 at 4:11 PM, javier <<email address hidden>
> wrote:

> New question #52501 on play framework:
> https://answers.launchpad.net/play/+question/52501
>
> when i used the last version(play-1.0-stable3-r212.zip 25-Nov-2008 12:07
> 15M),there is a 404 error:
>
> 404 -> GET /public/stylesheets/default.css
>
> main.html:
>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <title>#{get 'title' /}</title>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
> <link rel="stylesheet" type="text/css" media="screen"
> href="/public/stylesheets/default.css" />
> <link rel="shortcut icon" type="image/png"
> href="/public/images/favicon.png" />
> </head>
> <body>
> #{doLayout /}
> </body>
> </html>
>
> --
> You received this question notification because you are a member of play
> framework developers, which is an answer contact for play framework.
>

Revision history for this message
Loïc Guillois (loic-guillois) said :
#2

Yes, we have changed the static file handling. Now you can specify which directory to use. Just add the following line in your routes :

GET /public staticDir:public

hope this helps

Revision history for this message
javier (zzy-star) said :
#3

ok,now it work very well,

Thank you for your work!

play! is a great framework ,i like it!

Revision history for this message
Guillaume Bort (guillaume-bort) said :
#4

And the 212 is a little buggy. You should download the 215.

On Tue, Nov 25, 2008 at 4:33 PM, javier <<email address hidden>
> wrote:

> Question #52501 on play framework changed:
> https://answers.launchpad.net/play/+question/52501
>
> Status: Answered => Solved
>
> javier confirmed that the question is solved:
> ok,now it work very well,
>
> Thank you for your work!
>
> play! is a great framework ,i like it!
>
> --
> You received this question notification because you are a member of play
> framework developers, which is an answer contact for play framework.
>

Revision history for this message
javier (zzy-star) said :
#5

Thanks Guillaume Bort, that solved my question.

Revision history for this message
javier (zzy-star) said :
#6

Thanks Loïc Guillois too