English 中文(简体)
2. 游乐2.0, 积极航道/航道?
原标题:Play 2.0, get active route/url/Call?

我为我的申请创造了一个开端。

I can t figure how to get current route / tell if the page / "Call" is active.

The Code in index.scala.html

@if(page.getTotalPageCount() > 0){
<div class="pagination">
    <ul>
    @for(i <- 0 to page.getTotalPageCount()-1){
        <li@if(@routes.NewsHandler.index(i) == ?){ class="active"}><a href="@routes.NewsHandler.index(i)">@(i+1)</a></li>
    }
    </ul>
</div>
}

基本上如此。

if(@routes.NewsHandler.index(i) == ?){ class="active"}

任何想法?

EDIT, i found a working solution:

@if(request().path().toString().equals(routes.NewsHandler.index(i).toString())){ class="active"}
问题回答

目前,没有标准方法了解目前的<代码>Handler。





相关问题
Manage dependencies in a Play Framework app

I m trying to figure out the proper tools for managing dependencies between JARs. I have a Play Framework app, which imports a JAR (based on another project I m writing). This JAR imports other JARs, ...

Deploy Play! application as executable jar

Is it possible to bundle Play! web application to executable jar instead of war? Could it just be run on localhost at some port just like when using "play run" command? (without the need of installing ...

JPA: Store fileAttachment into the database

I would like to know if there is any way I can store a fileAttachment directly into the database with JPA. I have an attribute: public fileAttachement logo; I have tried to change it to: @Lob ...

Java Web Development and Automatic Feedback

I ve been having a (ironic) play around with the Play Framework and have been impressed thus far. I was just curious as to what other Java frameworks are out there that have a similar feature to Play ...

Java web frameworks

I was looking around to see if there is an equivalent to django/RoR in java. I found: Play Framework Grails Does anyone have ever tried those frameworks, or do you know any other? Are they faster ...

热门标签