Search code examples
struts2struts2-namespace

Struts2 same namespaces in different struts.xml files


Is it possible to use same namespace in different struts.xml files?. I know that we can use different namespaces. The problem is, i have so many actions in my configuration file. I just want to split up inorder to manage easily. But if i use different namespace for each file, i have to modify the namespace mentioned everywhere(JSPs).

For ex.

I want to use namespace="/" in all my struts.xml files.

I hope you understand what I am coming to say. Is this possible or any other relevant easy method to achieve this?

Thanks in advance


Solution

  • You definitely can use multiple packages with same namespace. Just remember packages cannot have same names. You also need to include them all in your main struts.xml like:

    <include file="path to your config files"/>