Worklight Init Servlet

天大地大妈咪最大 提交于 2019-12-11 19:36:33

问题


I am working on a worklight hybrid apps for iOS and Android. In the server side implementation, I plan to reuse my existing java code for all the business logic, therefore my server adapter would just making a call to my java code.

This is working fine and I actually found some sample to do so, but however my existing java code required some initializing during the startup, it was done using an init servlet configured in web.xml, but as far as I know, worklight doesn't have a easy way to create any kind of servlets.

I understand that I could always put some static block to initialize the server during the first call, but it create some noticeable delay for the first call, which is not very preferable.

If possible, I would also like to create some onDestroy listener to properly close all pools, timer and etc.

Thank in advance.


回答1:


[didn't try it, just thinking out loud] WL project deployable is a .war file that can be found in {project}\bin. It basically contains all of your server related stuff including built java code. Inside of it you have a standard web.xml file that defines all WL servlets etc. In case you add your servlet definition there manually it should work.



来源:https://stackoverflow.com/questions/21058916/worklight-init-servlet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!