Applets in jsp

how to pass values from jsp to applet class.

i have a jsp where am getting values from database and i want to pass these to applet class.

my coding is like this,

// jsp coding

// calling applet class

<applet code="applet1.class" width=200 height=200>

while(resultset.next())

{

s1=resultset.getString("xxx");

%>

<param name=ss value="<%= s1 %>"></param>

<%

}

%>

</applet>

applet is getting only the first value and the other values are not going from jSp.i used <object> instead of <param>.but that is also not working.

pls help me

thank u

[712 byte] By [jayanthin] at [2007-9-26 4:59:32]
# 1

jayanthin,

You seem to be setting the values to the same parameter "ss".

Maybe you can try something like this:

<%

Vector m_vector = new Vector();

while (resultset.next()) m_vector.addElement(new String(resultset.getString("xxx"))); %>

<param name="ss" value="<%

for (int i = 0; i < m_vector.size(); i++) {

out.print(m_vector.elementAt(i));

if (m_vector.elementAt(i) != m_vector.lastElement()) out.print(",");

}

%>">

Then you can break apart the values inside the applet with StringTokenizer. There's many ways to do this. This is just one idea. Hope this helped.

Dimitri

dstamatis at 2007-6-29 18:55:18 > top of Java-index,Desktop,Deploying...