This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSP and the fly likes passing object from JSTL into applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "passing object from JSTL into applet" Watch "passing object from JSTL into applet" New topic
Author

passing object from JSTL into applet

Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
I have JSTL code that looks like this:



I would like to pass each 'text' object into an applet. The text object is not a string.

I know I could have the applet call the server for a serialized instance of a text object, but I would rather pass the object into the applet straight from JSTL, such that I could get a handle to the instance within the applet with some kind of getParameter() call or similar call to AppletContext
Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
I should have mentioned that the JSTL snippet is enclosed within

tags.

I can feed string params into the applet just fine from JSTL using




But I am looking for a way to pass in non-string objects.
>
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42355
    
  64
Since this is HTML we're talking about, only text strings are possible. If it's for some reason not possible to pass a string representation of the object, then a serialized object may work (as long as it's properly ASCII-ized by using base-64 or something like that).

Note that serialization generally requires that both JVMs are of the same version (e.g., Java 5 or Java 6).


Ping & DNS - my free Android networking tools app
Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
Thanks, Ulf. This is good to know.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: passing object from JSTL into applet