You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yariel Ramos Moreno <yr...@ceis.cujae.edu.cu> on 2006/03/17 21:16:26 UTC

Applet and Struts

Hi everybody:

Is it possible to use a java applet with struts? If I have menu in the web application that is an applet, how can I call a struts action from this apple passing the correct parameters to it?

Thanks very much,

Yariel.

Re: Applet and Struts

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Yes you can... it will certainly be more work on your part, but yes.  In
the end, the "calls" made to Struts Actions are just HTTP GETs or POSTs. 
You can fire these yourself from an applet.  You can construct a query
string and append it to the URL when doing GETs, or you can populate an
HTTP request if doing a POST.

What you get back may be different than usual though... you could of
course render HTML in an applet, but if your using an applet in the first
place my guess is you are interested in getting back data, not a rendered
UI.  So, maybe your JSPs that your Actions forward to render XML, set the
content-type appropriately, and your applet parses it and does something
with it.  Maybe the response is just a flag that tells your applet to
display a nother screen.  And so on.

The basic question though is yes... simply make an HTTP request to the
appropriate URL in the Struts-based application, and handle the response
as appropriate.  No problem :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Fri, March 17, 2006 3:16 pm, Yariel Ramos Moreno said:
> Hi everybody:
>
> Is it possible to use a java applet with struts? If I have menu in the web
> application that is an applet, how can I call a struts action from this
> apple passing the correct parameters to it?
>
> Thanks very much,
>
> Yariel.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org