[EMAIL PROTECTED] wrote:
> HI.
> I am trying to open a simple wml file. But I get the content-type error:
>
> " Content-Type Error
> ...found Content-type: text / plain.
> No translator for Content-type: text/plain."
>
> I believe there is nothing wrong with my wml file since I can run it through
> my hard drive. Its only when I try to run it through tomcat, I get the
> problems.
> I have added the following mime-types into 'jakarta/conf/web.xml':
> <mime-mapping> <!-- WML Source -->
> <extension>wml</extension>
> <mime-type>text/vnd.wap.wml</mime-type>
> </mime-mapping>
> <mime-mapping> <!-- Compiled WML -->
> <extension>wmlc</extension>
> <mime-type>application/vnd.wap.wmlc</mime-type>
> </mime-mapping>
> <mime-mapping> <!-- WML Script Source -->
> <extension>wmls</extension>
> <mime-type>text/vnd.wap.wmlscript</mime-type>
> </mime-mapping>
> <mime-mapping> <!-- Compiled WML Script -->
> <extension>wmlscriptc</extension>
> <mime-type>application/vnd.wap.wmlscriptc</mime-type>
> </mime-mapping>
> <mime-mapping> <!-- Wireless Bitmap -->
> <extension>wbmp</extension>
> <mime-type>image/vnd.wap.wbmp</mime-type>
> </mime-mapping>
> My wml files are in 'jakarta/webapps/bookshop/index.wml
> However, I still cannot open my wml file from tomcat ( I am using UP Wap
> browser)
> After adding the mime-types in the jakarta/conf/web.xml do I need to do
> anything else.
> Thanks for your time
Hi :-) with my work, the following can work:
- add "mime" in conf/web.xml(I remember TC4.0b2/3 has already added
wml/wmlc/wmls/wmlscriptc/wbmp into it)
- and in MyServlet, in service/doGet/doPost:
...
response.setContentType("text/vnd.wap.wml");
PrintWriter out=response.getWriter();
out.println("<?xml version=\"1.0\"?>");
out.println("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">");
out.println("<wml>");
out.println("<card ...
...
Bo
Apr.09, 2001