This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi. I have a J2EE app where I am keeping versions of a text field in a database, and I need to be able to view the differences between the versions and merge them where necessary. I thought about using WinMerge (free) and writing temp files for the text fields, but I don't know how to open WinMerge from within my app. Would this work from within a J2EE app? How would I start it from my program? (I am using Spring throughout and JSPs on the front end.) Thanks!
Hi, you may use ProcessBuilder (Java5) or java.lang.Runtime (Java1.4) to invoke the program. But beware: You are not allowed to inkoke that program from within your J2EE App (acc. to the spec.), but you may implement a JCA connector or a MBean (hope, you have an MBean server in your apserver) that provides the invocation. (or use JNI if you are able to implement C code and you have a static library or dll, you can adopt)
Marco Barenkamp<br />_ _ _ _ _ ________________________ _ _ _ _ _ <br />L M I N T E R N E T S E R V I C E S AG<br /> <br />Head of Software Development<br /> <br /> <br />BEA Certified Enterprise Developer<br />Sun Certified Programmer for the Java2 Platform<br />Sun Certified Web Component Developer for the Java2 Platform<br />Sun Certified Developer for the Java 2 Platform <br />Sun Certified Business Component Developer for the Java 2 Platform <br />Sun Certified Enterprise Architect for the Java 2 Platform Enterprise Edition<br /> <br />LMIS AG
Joined: Aug 04, 2005
Thanks for the quick response. I have a couple more questions (all this is new to me.) If I use, say, an MBean, would it invoke WinMerge on the server or on the user's machine? If on the server, would the user see it? What benefits would using an MBean have, e.g., knowing when WinMerge closes maybe? Are there any other diff tools for use in internet apps? Thanks!
Joined: Aug 27, 2001
The process would run in the server, because the MBean lives inside the AppServer. Due to the fact, that the MBean owns the process of the win32 application, you are able to get to know whether the process is still alive or not.