Url rewriting in Java Play framework

Splash Forums Rewrite Users Url rewriting in Java Play framework

This topic contains 4 replies, has 2 voices, and was last updated by  azhar2kazi 10 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #27257

    azhar2kazi
    Participant

    Hi,
    I am having a project build in Java Play Framework+AngularJS+Simple Spring Project(note:without web.xml).
    I need to implement rewrite rules in my Java code.

    I have included the org.ocpsoft.rewrite jar in the app. Also My Global Class has the following code

    @RewriteConfiguration
    public class Global implements ConfigurationProvider {

    @Override
    public int priority() {
    // TODO Auto-generated method stub
    return 0;
    }

    @Override
    public boolean handles(Object arg0) {
    // TODO Auto-generated method stub
    return false;
    }

    @Override
    public Configuration getConfiguration(Object arg0) {
    // TODO Auto-generated method stub
    System.out.println(“————————————————————————-“);
    return ConfigurationBuilder.begin().addRule(Join.path(“/”).to(“/app/views/main/home.html”));
    /* .addRule()
    .when(Direction.isInbound().and(Path.matches(“/app/views/main/”)))
    .perform(Forward.to(“/app/views/main/agentsFind”));*/
    }
    }

    But since there is no web.xml in my App, how may i configure rewrite using annotations?
    I need to integrate rewrite in my Play App

    #27258

    I don’t know much about Play, sorry. But did you see any Rewrite log entries during startup?

    How do you typically register Servlet filters and listeners with Play?

    #27259

    azhar2kazi
    Participant

    on play startup it shows it has loaded the rewrite dependency which i included in build.sbt file.

    How do you typically register Servlet filters and listeners with Play?

    That’s where i am struck. i need to register them via annotations or some other means. But how?sine my app is not having web.xml.

    ref. for project structure and type
    http://www.typesafe.com/activator/template/bundle/hello-play-java

    #27260

    I guess you should ask this question in the Play forums. Rewrite is implemented using the standard Servlet API. Not sure how Play works. 🙂

    #27261

    azhar2kazi
    Participant

    Ok, let me check there.

    Thanks,
    Azar Kazi

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Comments are closed.