Search code examples
eclipse-rap

Multiple EntryPoints for a RAP-Application


i have an application based on Eclipse RWT (standalone version). It's a rather complex enterprise application involving Spring dependency injection and a lot of frameworks to be initialized at startup.

Currently I'm in need of a second view on the whole thing. The initialization stuff is a bit complex and I want to reuse it. Further I don't want to deploy a second webapp on my Tomcat. Is it possible to implement two EntryPoints and bind each of them to a separate url-pattern?

e.g.

url-pattern /first entryPoint com.example.myapp.FirstEntryPoint

url-pattern /second entryPoint com.example.myapp.SecondEntryPoint

Is this possible or do you have any alternative approaches to achieve this?


Solution

  • Okay, no replies just a downvote :D. Anyways i found a solution:

    It seems that this cannot be achieved with RAP 1.4. The url-pattern is defined independently from the entrypoints in de deployment-descriptor.

    But with RAP 1.5 it is pretty easy: You use an ApplicationConfiguration where you can bind different entrypoints to different url-patterns...

    application.addEntryPoint("/start", MyEntryPoint.class, properties);
    application.addEntryPoint("/admin", MyAdminEntryPoint.class, properties);
    

    you just need to bind the RapServlet to all used url-patterns in the web.xml.

    <servlet>
        <servlet-name>RAPServlet</servlet-name>
        <servlet-class>org.eclipse.rwt.internal.engine.RWTDelegate</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>RAPServlet</servlet-name>
        <url-pattern>/start</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>RAPServlet</servlet-name>
        <url-pattern>/admin</url-pattern>
    </servlet-mapping>
    

    Hope it helps...