• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

perplexed by package structure

 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:

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

Eric
 
Harsha Ka
Ranch Hand
Posts: 45
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,

Its the namespace which is part of the URL and not the package name.

If your struts.xml had the below package declaration then you would have the namespace as a part of the URL.
 
Jesus Mireles
Ranch Hand
Posts: 122
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic