File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Applet parameters using JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Applet parameters using JSP" Watch "Applet parameters using JSP" New topic

Applet parameters using JSP

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
How do I pass parameters from a JSP to an Applet?
I tried several variations of the following:
<jsp :plugin type="applet" code="Trans.class" codebase="." jreversion="1.2" width="529" height="342"
</jsp :plugin>
<jsp :params>
<jsp :param name="userId" value="10" />
</jsp :params>

[This message has been edited by Angela Poynton (edited March 06, 2001).]
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

Im not sure I understand your problem. You can use straight html.
<applet code="Trans.class" width="529" height="342">
<param name="userId" value="10">
Unless I just dont understand.

Visit my download page
Scott Stirling

Joined: Mar 05, 2001
Posts: 24
You need to nest the <jsp :params> inside the plugin tag. Judging from the code you posted, you're not.
See examples here:
To the other respondent, the reason for using the plugin tag instead of straight HTML is that the JSP container is supposed to write browser-specific HTML for you, saving you the effort of doing browser detection and generating different HTML for IE and Netscape.
Scott Stirling
Author of Java Server Pages Application Development
[This message has been edited by Scott Stirling (edited March 06, 2001).]
[This message has been edited by Jim Yingst (edited March 06, 2001).]

Scott Stirling<BR>Author of <A HREF="" TARGET=_blank rel="nofollow">Java Server Pages Application Development</A>
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

I see. I have been avoiding the problem of different applet tags for each browser by using java 1 in my applets. I still use html 3.2 mostly also.
I agree. Here's the link:
subject: Applet parameters using JSP
It's not a secret anymore!