黑莓OTA下载使用Servlet的 [英] Blackberry OTA downloader using Servlets

查看:157
本文介绍了黑莓OTA下载使用Servlet的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置使用servlet黑莓OTA下载。如何设置为的.jad .COD 文件的网址是什么? 两个文件我已经设置了内容类型。我如何发送两个文件到客户端,当我收到来自客户端的请求?我需要创建两个ser​​vlet或一个就够了吗?

I want to setup a Blackberry OTA downloader using Servlets. How do I set the URL for .jad and .cod files? I have set the content type for both files. How do I 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?

推荐答案

您不一定需要这个的servlet。 Servlet是唯一有用的,如果这些文件是动态生成的,或没有直接的公众开放(即这些文件是不公开的WebContent)。

You don't necessarily need a servlet for this. A servlet is only useful if those files are dynamically generated or are not directly public accessible (i.e. those files are not in public webcontent).

最简单的方法是把这些文件放在公共的WebContent(那里有你通常会放置在JSP / HTML文件),并在您servletcontainer的或web应用程序的的web.xml配置相应的MIME映射文件。

The simplest way would be to put those files in the public webcontent (there where you would usually place the JSP/HTML files) and configure the appropriate mime mapping in your servletcontainer's or webapp's web.xml file.

<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>

然后当客户端通过例如直接请求的文件的servletcontainer将自动设置正确的内容类型 http://example.com/file.jad 并的 http://example.com/file.cod

这篇关于黑莓OTA下载使用Servlet的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆