I have a Struts 2 question. I took over an application built with Struts 2. The original developer is unavailable. He has divided up the application's actions into packages by role:
I'm not a Struts 2 expert but my understanding of packages is that the package name is reflected in a URL . . . so /appName/adminPackage/logout.action would map to the correct "logout" action (There is a "logout" action in every package). However, in this application the package names are not part of URLs and I am wondering how the application knows which "logout" action to call. Is there an alternative way to use package names? What should I be looking for? Thanks
Harsha is correct to look for namespace. From the packages you posted it is very likely that the developer created packages which contain common actions. So somewhere there is probably a package with the namespace you seek which then extends the userPackage or adminPackage etc ...
John Eric Hamacher
Joined: Apr 25, 2007
Thanks for the replies. There are no namespaces declared anywhere. It turns out that the programmer did a very poor job with authorization. Any user can successfully enter any of the URLs, if they know one. There is no filtering taking place with respect to the URLs.