On 10/13/05, Matthias Holthus <[EMAIL PROTECTED]> wrote: > Hi! > > Perhaps this is offtopic but I don't know a better place to ask. Sorry for > that. ;) >
Step 1. Define a protocol to be spoken between the applet and the server side application. XML would be first choice, but you also can use Java Serialization, and send objects over the net. In later case struts would be an overkill, a simple TCP Port listener would be enough. Step 2. Write a struts action (or tcp listener) to understand requests from the applet (the abovementioned protocol). Step 3. Write a Business Logic / Persistence Logic POJ/Model object which can communicate with the database. Step 4. Connect you action from step 2 with the POJO from step 3, action gets a requests, calls appropriate method on the POJO, POJO calls the DB, maps the ResultSet in some kind of protocol object, returns it to the action, action creates and delivers XML (or whatever you defined in your protocol). Step 5. Write a DataConnector for the applet, which can do the things the action from Step 2 does on the applet's side. Get a request from an object in the applet, map them to the protocol from step 1, call the action, get result, map the result in some kind of the response object, return this object. Step 6. Connect your applet logic to the connector from step 5. Step 7. Rest and Enjoy. > I'm building a webapp with some function for painting specific diagrams. > This part is outsourced into an applet while the rest remains in normal > HTML/JSP-pages. As I need to load data from the server into the applet and > vice versa I'd like to know if someone has a good solution how applet and > struts communicate with each other. Executing JDBC-Code in the applet will > break MVC2-Pattern as I think. Thankfully, executing JDBC code in the applet is not possible, for it would not only break the mvc (there is no MVC2 pattern) pattern, but be probably the worst practice I've ever heard of. (But this is a private opinion). > Matthias Holthus Leon --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

