File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem to integrate Struts with Swing

 
bhuvana mounagurusamy
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ..

I am having one Swing Application.. I would like to integrate this one to Struts.. How to call Swing application when i click the struts html button ..

Please Help me in this..

Thanks,
Bhuvana
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no good way to integrate a Swing application and a Struts application. A Swing application is either a Stand-alone application or a fat client application, while a Struts application is a web application, and the two don't mix.

If you wrote your Swing application with MVC principles in mind, your model classes will have been written without dependencies on Swing. In that case, you can take these model classes and plug them in as the model to your Struts application. If you didn't keep this separation, you will pretty much have to rewrite the application.

One other alternative is to turn your Swing application into an applet. That can be done quite easily, and it will run on a browser. However, by doing this, you incur the problems associated with applets, such as long download times and security issues.
 
bhuvana mounagurusamy
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your suggestion...

I will try with Applet insted of Swing..

-Bhuvana
 
bhuvana mounagurusamy
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ..

I have a jsp which contains an applet...

The Applet contains one Button Which perform some action.. This Action Works fine independetly.. I am unable to perform that action into my JSP page..

How can i accomplish this ..

Thanks for your attention!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a netscape.javascript.JSObject class that will allow an Applet to interact with JavaScript on an HTML page. Once you have this link to JavaScript you can submit a form or perform any other action normally performed in an HTML document from within your Applet code. I haven't used it, so I'm not that familiar with how it works, but this link should get you started.

Be careful, though. As I see it, you need to decide if this is going to be an Applet application that runs entirely within the Applet framework, or if it's going to be a web application with some added applet features. If it's going to be an Applet application, the interaction between HTML and the Applet should be minimal. If it's going to be a web application, page navigation, etc. should be handled by Struts, and the applet should only provide a few features. If you try to mix and match between the two worlds too much, you could have a real mess on your hands.
[ October 04, 2006: Message edited by: Merrill Higginson ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic