RAP EntryPoint(s) and Servlet(s) (實現多個EntryPoint)Redirect URL

來源:互聯網
上載者:User

RAP1.3

 

這篇文章主要是寫一下在RAP中運用EntryPoint  and Servlet的經驗。

 

  • EntryPoint:是RAP應用程式的入口,擴充點為 org.eclipse.rap.ui.entrypoint

         一個RAP外掛程式可以有多個entryPoint ,

                             

         選取其中一個擴充點資訊如下:

                 

 

  •    要想啟動EntryPoint還需要servlet,通過擴充點 org.eclipse.rap.ui.branding 可以設定預設啟動的entryPoint,如:

                                

               設定如下:

                  

 

  • 啟動RAP,如果是在Eclipse中直接launch應用,IE中的網址應該是:                            http://[Host]:[Port]/[servlet]?startup=[entrypoint],其中以上面的執行個體來說,地址為: http://locahost:10086/test?startup=entrypoint1 其中連接埠號碼可以預設值。這裡要說明的是,因為已經為servlet為test的設定了預設的entrypoint,所以在RAP應用已經啟動的前提下,直接在IE地址欄中輸入 : http://locahost:10086/test 此時會根據defaultEntrypointId設定(如示)也可以跳轉到entrypoint1應用中。

       其他的情況可以類推,你可以建立多個branding,建立多個entrypoint。

 

  • 有時候設定預設的entrypoint不能滿足IE地址欄中的靈活變通,此時可能需要地址的重新導向,為此RAP中也提供了相應的重新導向路徑的擴充點:org.eclipse.equinox.http.registry.servlets ,

          詳細設定如下:

         

          其中alias便是IE地址欄中[servlet]的替代符,即sevlet可以轉義為“/”,真正的實現跳轉需要在代碼中實現

 

        

         即在IE地址欄中輸入

             http://localhost:10086/path

           ==>redirect to==>    

             http://localhost:10086/test?startup=entryPoint2

 

         其中如果在alias設定為"/files",則在IE地址欄中輸入

             http://localhost:10086/files/path

        ==redirect to==>

             http://localhost:10086/files/test?starup=entryPoint2  

       

        

     最後要說的是,entrypoint , branding and servlet 配合使用可以在多entrypoint的應用下實現IE地址的不同需求。

 

     僅供參考!

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.