Calling Struts Action outside the web application context
posted 12 years ago
Hi, We are currently having a system that using Struts and we would like have another interface (command line etc...) which is not web. So I am wondering if we have any way to call the Struts actions in the existing system but not in web context? Thanks for your help in advance. Brian
Sounds like feature envy to me. You should probably refactor the code currently in the Action and extract it to a plain old Java object. The Action can collaborate with the new class to perform whatever it was doing before and you can also use the new class in a non-web context.
Practice only makes habit, only perfect practice makes perfect.
So, practice mindfully. Practice doing the right things and doing things right. — Junilu