tags:

views:

24

answers:

1

I wrote an Applet program which draws a pie chart. The values for the applet should be passed from JSP page.

I wrote the following lines of code in JSP:

<jsp:plugin type="applet" code="drawPie" codebase="." width="750" heigth="300">
    <jsp:params>  
        <jsp:param name="user_id" value="<% =user %>"/>
    </jsp:params>    
</jsp:plugin>     

and in applet I used

String user=getParameter("user_id");

when I open the jsp page nothing comes neither error nor the chart.

What is the problem/error in the above code snippet?

+2  A: 

As shown in this reference, you have to include .class in the code attribute:

The name of the Java class file that the plugin will execute. You must include the .class extension in the name following code. The filename is relative to the directory named in the codebase attribute.

<jsp:plugin type="applet" code="drawPie.class" codebase="." 
     width="750" heigth="300">

I'd also suggest giving/looking at the generated HTML code to see if it is proper <object> tag.

Bozho
Yes i have included .class extention to drawPie .....but still nothing comes .....i also tried using normal HTML Applet code .....still dont know what is the problem
Hara Chaitanya
give the HTML code that was generated by `<jsp:plugin>` (add it to your question)
Bozho