• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

perplexed by package structure

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 45
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 122
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Look! I laid an egg! Why does it smell like that? Tiny ad, does this smell weird to you?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic