Pergunta

How to organize folder structures in app/views folder without conflicting with other application folders? For example,

app/
   controllers/
              org/
                  OrgInfo.scala
   views/
        org/
           a.scala.html
        user/
           b.scala.html

I found out that b.scala.html can no longer see org.OrgInfo class. When I do @import org.OrgInfo at b.scala.thml, it throws an error that it can't find OrgInfo under views.html.org. What's wrong?

Foi útil?

Solução

Scala accepts relative packages, this means that if you try to use org like that it refers to the views.org package, you can solve this by providing the fully qualified class name:

@import controllers.org.OrgInfo 

Outras dicas

I think johanandren provided you with the correct answer. So you should not start your import clause from org. org in your case is a sub-package of controllers. Use the absolute package name controllers.org._

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top