Blackberry OTA Servlet Loader

I want to configure the BlackBerry OTA bootloader using Servlets. How to set url for files .jadand .cod? I set the content type for both files . How to send both files to the client when I receive a request from the client? Do I need to create two servlets or is one enough?

+1
source share
1 answer

You do not need a servlet for this. A servlet is only useful if these files are dynamically generated or not publicly accessible (i.e., these files are not in open webcontent).

The easiest way is to place these files in a public webcontent (where you usually place JSP / HTML files), and configure the appropriate mime mapping in the servletcontainer or webapp file web.xml.

<mime-mapping>
   <extension>jad</extension>
   <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
</mime-mapping>
<mime-mapping>
   <extension>cod</extension>
   <mime-type>application/vnd.rim.cod</mime-type>
</mime-mapping>

Then the servletcontainer will automatically set the correct content type when the client requests the files directly, for example. http://example.com/file.jad and http://example.com/file.cod .

+3
source

Source: https://habr.com/ru/post/1772468/


All Articles