Hi everyone
I have an applet called by a jsp file but the applet is not initiated the
jsp file contains
rs1=stmt.executeQuery("select status, sum(counter) as counterSum, allDates
from(select * from(select distinct status, count(status) as counter
,dateOpened as allDates from ncrreport where unitSerNum!='no unit' and
dateOpened between curdate()-5 and curdate() group by allDates, status)as
opened union select * from (select distinct status,
count(status),dateClosed as allDates from ncrreport where unitSerNum!='no
unit' and dateClosed between curdate()-5 and curdate() group by allDates,
status)as closed )as allNcrs group by allDates, status");
while(rs1.next())
{
status = rs1.getString("status");
if((status.equals("closed")&& i%2==0)||(status.equals("open")&& i%2==1))
{
counter[i] = rs1.getString("counterSum");
dateOpened[i] = rs1.getString("allDates");
}
else if(i%2==0)
{
counter[i] = "0";
dateOpened[i] = rs1.getString("allDates");
counter[i+1] = rs1.getString("counterSum");
dateOpened[i+1] = dateOpened[i];
i++;
}
else
{
counter[i] = "0";
dateOpened[i] = dateOpened[i-1];
counter[i+1] = rs1.getString("counterSum");
dateOpened[i+1] = rs1.getString("allDates");
i++;
}
i++;
}
for (j=0; j<i; j++)
{
allDates+=","+dateOpened[j];
allCounters+=","+counter[j];
}
con.close();
%>
This is an applet template:<br>
<P><%=i%></P>
<P><%=allDates%></P>
<P><%=allCounters%></P>
<!--<applet code="Fluctuations3.class" height="750" width="1000">
you need a java-enabled browser to see this</applet>-->
<jsp:plugin type="applet" code="Fluctuations6.class" height="750"
width="1000">
<jsp:params>
<jsp:param name="increment" value="<%=i%>" ></jsp:param>
<jsp:param name="counter" value="<%=allDates%>" />
<jsp:param name="dateOpened" value="<%=allCounters%>" />
</jsp:params>
<jsp:fallback>
<p>Unable to load applet</p>
</jsp:fallback>
</jsp:plugin>
</body>
</html>
and a java file
import java.awt.*;
import java.applet.*;
import java.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.text.DateFormat;
import java.util.*;
import java.applet.Applet;
class Fluctuations6 extends javax.swing.JApplet {
int i;
String[] dateOpened ;
String[] counterString;
String allDates;
String allCounters;
int[] counter;
public void init()
{
i=Integer.parseInt(getParameter("increment"));
dateOpened=new String[100000];
counterString=new String[100000];
counter=new int[100000];
for(int j=0;j<i/2; j++)
{
dateOpened[j]="";
counterString[j]="";
counter[j]=0;
}
}
public void paint(Graphics g) {
allCounters=getParameter("counter");
counterString=allCounters.split(",");
allDates=getParameter("dateOpened");
dateOpened=allDates.split(",");
for(int j=0;j<i/2; j++)
counter[j]=Integer.parseInt(counterString[j]);
Graphics2D g2D =(Graphics2D)g ;
g2D.drawLine( 10, getSize().height - 10, getSize().width -
10, getSize().height - 10);
g2D.drawLine( 10, getSize().height - 10, 10, 10);
g2D.drawString(allDates, 10+5*i, getSize().height - 5 );
for(int j=0; j<i/2; j+=2)
{
g2D.drawString(dateOpened[j], 10+10*j, getSize().height - 5
);
g2D.drawLine( 10+10*j, getSize().height-counter[j],
10+10*(j+2), getSize().height-counter[j+2]);
g2D.drawLine( 10+10*(j+1),
getSize().height-counter[j+1], 10+10*(j+3), getSize().height-counter[j+3]);
}
}
}
can anybody tell me why it is not initiated (note that these two files are
in ROOT)
Abdelmonaam KALLALI
Test Specialist
DragonWave Inc
411 Legget Dr
Phone :613-599 9991 ext 275
-----Original Message-----
From: Rashmi Rubdi [mailto:[EMAIL PROTECTED]
Sent: Monday, March 26, 2007 2:41 PM
To: Tomcat Users List
Subject: Re: Applet not initiated
Also I don't know if you're using strict XHTML.
The applet tag is not supported in XHTML as mentioned here :
http://www.w3schools.com/tags/tag_applet.asp
they recommend using the HTML object tag
http://www.w3schools.com/tags/tag_object.asp instead of applet tag.
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]