You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by jill han <jh...@bynum.com> on 2005/05/12 14:59:23 UTC
RE: deployment of applet class
I hope this message will be posted this time!
-----Original Message-----
From: jill han
Sent: Wednesday, May 11, 2005 9:16 AM
To: 'Velocity Users List'
Subject: deployment of applet class
I posted applet questions before. Now I have new problems.
1. applet class without package
I build an applet class without package, and then place this
applet class in applet folder. The applet tag in a velocity template is
like:
<table cellpadding=0 cellspacing=0 border=0 width="808">
<APPLET CODEBASE='$content.getURI("applet/")'
code = 'Star.class' WIDTH = 300 HEIGHT = 300>
</APPLET>
</table>
The graph will show up in the rendered page, but this applet
contains no objects built using Turbine, Torque, or Velocity, it
is just a pure j2sd class. My goal is to use applet to draw some graphs
using data from the db.
If I build an applet class where such objects as Turbine,
Torque, etc are referenced, and then place this applet class in
applet folder, I have to put all the com.jar, turbine.jar, etc in
the applet folder too. Otherwise, it will be such ClassNotFound
error. The applet tag will be like:
<table cellpadding=0 cellspacing=0 border=0 width="808">
<APPLET CODEBASE='$content.getURI("applet/")'
Archive='$content.getURI("applet/com.jar"),
$content.getURI("applet/turbine.jar")'
code = 'CustomObject.class' WIDTH = 300 HEIGHT = 300>
</APPLET>
</table>
But in this way, it really slowed down the process of drawing a
graph. It seems it will load the applet forever.
2. applet with package
I build a applet class with package. and then place it into a
corresponding folder in WEB-INF/classes/
Such applet tag in a velocity template will not work anymore:
<table cellpadding=0 cellspacing=0 border=0 width="808">
<APPLET CODEBASE='$content.getURI
("WEB-INF/classes/com/correspondingclassfolder/")'
code = 'CustomObject.class' WIDTH = 300 HEIGHT = 300>
</APPLET>
</table>
It will be such 'ClassNoFound' error.
So, my bottom line question is how to integrate applet class into the
velocity page, where to put it.
I know this mail is too long. I just try to let my problems understood.
If someone use applet to draw a graph on a rendered velocity page, would
you please shed light on this topic?
Appreciates as always.
Jill
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: deployment of applet class
Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Jill,
> 1. applet class without package
## snip
> But in this way, it really slowed down the process of drawing a
> graph. It seems it will load the applet forever.
Depending on the environment, I think the browser will cache the jars,
making it faster to load from the second time.
> 2. applet with package
> I build a applet class with package. and then place it into a
> corresponding folder in WEB-INF/classes/
> Such applet tag in a velocity template will not work anymore:
>
> <table cellpadding=0 cellspacing=0 border=0 width="808">
> <APPLET CODEBASE='$content.getURI
> ("WEB-INF/classes/com/correspondingclassfolder/")'
> code = 'CustomObject.class' WIDTH = 300 HEIGHT = 300>
> </APPLET>
>
> </table>
> It will be such 'ClassNoFound' error.
> So, my bottom line question is how to integrate applet class into the
> velocity page, where to put it.
Applets are client-side technology. So it will not have access to the
unexposed WEB-INF directory. I suggest you put what is needed by the
applet in a jar and refer to it with the "archive" attribute like in
1.
Best regards,
-- Shinobu
--
Shinobu Kawai <sh...@gmail.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org