You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rob Mitchell <ro...@access.com.au> on 2000/11/30 06:47:55 UTC
WAP Configuration
Hi,
I've set up the apache-tomcat configuration with the aim of having jsp
pages deliver WML to the WAP browser in the Nokia WAP toolkit.
I have set up a JSP page under Tomcat that just contains WML content.
So far the WAP Toolkit can access the page but as far as I can tell it is
being encoded in MIME as HTML. At least, the cache for the Nokia Toolkit
shows an HTML page being cached, though it contains the WML. Also the Nokia
Browser displays some of the page but it looks like its not displaying
parts of the page which have '<' or '>' next to them but I'm getting just
about everything else, including the WML version. I have checked that the
page is correctly formed by loading it separately as a WML file.
So at the moment my thinking is that Tomcat is handling the JSP but is
returning the output from the page as HTML, even though the contents are WML.
I have noticed that in my tomcat-apache.conf file that the line that should
read:
AddType text/jsp .jsp
reads
AddType test/jsp .jsp
I dont know if that is screwing anything up or not.
Can anyone who has done this give me a clue ?
Thanks
Rob
Re: Cannot create bean of class
Posted by William Brogden <wb...@bga.com>.
tony wrote:
>
> Hi, all. I created a bean class and put it at "test/WEB-INF/classes/", I call it at
> a jsp file, the following meg was returned to me. can anybody tell me why?thanks in
> advance.
>
> Error: 500
>
> Location: /test/jsp/testBean.jsp
>
> Internal Servlet Error:
>
> javax.servlet.ServletException: Cannot create bean of class TestBean
> at ....
Your Bean should be in a package, and
your <jsp:useBean tag must give the
complete package in the class= attribute.
--
WBB - wbrogden@bga.com
Author of Java Developer's Guide to Servlets and JSP
ISBN 0-7821-2809-2
Cannot create bean of class
Posted by tony <li...@etang.net>.
Hi, all. I created a bean class and put it at "test/WEB-INF/classes/", I call it at
a jsp file, the following meg was returned to me. can anybody tell me why?thanks in
advance.
Error: 500
Location: /test/jsp/testBean.jsp
Internal Servlet Error:
javax.servlet.ServletException: Cannot create bean of class TestBean
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)
at
jsp._0002fjsp_0002ftestBean_0002ejsptestBean_jsp_0._jspService(_0002fjsp_0002ftestBean_0002ejsptestBean_jsp_0.java:90)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:475)
Root cause:
javax.servlet.ServletException: Cannot create bean of class TestBean
at
jsp._0002fjsp_0002ftestBean_0002ejsptestBean_jsp_0._jspService(_0002fjsp_0002ftestBean_0002ejsptestBean_jsp_0.java:73)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:475)
Re: WAP Configuration
Posted by Jon Skeet <jo...@peramon.com>.
> Second, the content type that is created by a JSP page is controlled by what your
> page declares in the "page" directive, not by Tomcat. If you wish to have the
> output treated as XML, for example, you would include a directive like this at
> the top of your pages:
>
> <%@ page contentType="text/xml" %>
>
> You will need to review the documentation of the WAP Toolkit you are using to
> determine what content type it is expecting, but the choice of content type is up
> to the page author, not the servlet container.
Just to save the original poster the trouble of looking it up, the content
type you want is:
text/vnd.wap.wml
Jon
Re: WAP Configuration
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
I have two recommendations for you, below.
Rob Mitchell wrote:
> Hi,
>
> I've set up the apache-tomcat configuration with the aim of having jsp
> pages deliver WML to the WAP browser in the Nokia WAP toolkit.
>
> I have set up a JSP page under Tomcat that just contains WML content.
>
> So far the WAP Toolkit can access the page but as far as I can tell it is
> being encoded in MIME as HTML. At least, the cache for the Nokia Toolkit
> shows an HTML page being cached, though it contains the WML. Also the Nokia
> Browser displays some of the page but it looks like its not displaying
> parts of the page which have '<' or '>' next to them but I'm getting just
> about everything else, including the WML version. I have checked that the
> page is correctly formed by loading it separately as a WML file.
>
> So at the moment my thinking is that Tomcat is handling the JSP but is
> returning the output from the page as HTML, even though the contents are WML.
>
> I have noticed that in my tomcat-apache.conf file that the line that should
> read:
>
> AddType text/jsp .jsp
>
> reads
>
> AddType test/jsp .jsp
>
> I dont know if that is screwing anything up or not.
>
> Can anyone who has done this give me a clue ?
>
> Thanks
> Rob
First, go directly to the Jakarta web site <http://jakarta.apache.org> and
download Tomcat 3.2. <Monopoly:metaphor>Do not pass GO. Do not collect
$200</Monopoly:metaphor>. Tomcat 3.2 fixes over a hundred bugs in Tomcat 3.1.
Second, the content type that is created by a JSP page is controlled by what your
page declares in the "page" directive, not by Tomcat. If you wish to have the
output treated as XML, for example, you would include a directive like this at
the top of your pages:
<%@ page contentType="text/xml" %>
You will need to review the documentation of the WAP Toolkit you are using to
determine what content type it is expecting, but the choice of content type is up
to the page author, not the servlet container.
Craig McClanahan