You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by qa...@bt.com on 2001/04/09 14:08:34 UTC
problems with wml pages
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
Re: problems with wml pages
Posted by Christoph Fischer <cf...@bb-sw.de>.
Did you set the following parameters in you java-program?
Chris
CONTENT_TYPE = "text/vnd.wap.wml";
DOC_TYPE = "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\n" + "
\"http://www.wapforum.org/DTD/wml_1.1.xml\">";
qari.qasim@bt.com 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
Re: problems with wml pages
Posted by Bo Xu <bo...@cybershop.ca>.
qari.qasim@bt.com 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