Log in

View Full Version : Applets and Jsps - calling and passing parameters


akshaykulkarni
Jun 6, 2009, 11:04 PM
I have an applet which calls lots of jsps from within itself. There are many parameters being passed to the jsp pages. Currently, the parameters are passed by forming a query string, making a URL object and calling the showDocument method on the AppletContext. But this is a concern from application security point of view. I would like the parameters to be passed without displaying the same in the url. Is there a way to do that? Is it possible to POST the parameters from inside the applet? If there is, can anyone please provide an example so that I can try to use the same?

I have to find a solution by tomorrow.

Thanks in advance.

LanMan
Jun 9, 2009, 11:04 AM
Take a look at the Apache HttpComponents project (HttpComponents - HttpComponents Overview (http://hc.apache.org/)). You can do a post using some of the classes it contains. Another option would be to use JavaScript. Have the applet, via Javascript, complete and post an HTML form. This would be a bit more involved though.

p.s. there is an example of a basic POST using the HttpComponents at the Apache site. Just click on the 'examples' link on the left side menu.