DisplayServlet in Tomcat 4.1.12

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Ram

DisplayServlet in Tomcat 4.1.12

Post by Ram » Mon Nov 18, 2002 9:51 pm

Hi

I have been using JFree chart for my project . The charts were working great in Tomcat 3.2.3.

Recently we upgraded to Tomcat 4.1.12. Now I dont see the graphs on the browser.
I have added this in the web.xml

<servlet>
<servlet-name>DisplayChart</servlet-name>
<servlet-class>com.jrefinery.chart.servlet.DisplayChart</servlet-class>
</servlet>

The one difference I noticed was there was no temp folder in Tomcat 3.2.3 and I do have a temp folder in Tomcat 4.1.12. I can also see the graphs generated in this folder. I am not able to stream it back to the browser. Can any one suggest where am I going wrong . Should i add any params in my web.xml.

I have my Jfreechart.jar in CATALINA_HOME/webapps/myapp/WEB_INF/lib.

Thanks in Advance.

Ram

Richard Atkinson

Re: DisplayServlet in Tomcat 4.1.12

Post by Richard Atkinson » Tue Nov 19, 2002 9:24 am

You need to add the following lines in your web.xml after your servlet definitions.

<servlet-mapping>
<servlet-name>DisplayChart</servlet-name>
<url-pattern>/servlet/DisplayChart</url-pattern>
</servlet-mapping>

In Tomcat versions before 4.1.x there was an implicit mapping of servlets to /servlet/[SERVLET_NAME]. However this was not part of the servlet specification and this implicit mapping was removed in the latest version. Consequently you need to make sure you specify the mapping in order for the servlet to be correct invoked.

Regards,
Richard...

Ram

Re: DisplayServlet in Tomcat 4.1.12

Post by Ram » Tue Nov 19, 2002 3:58 pm

Hi

Thanks for the early response.
I added the servlet mapping and it just works great again.



Thanks again

Ram

Locked