File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes What is Namespace in struts.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "What is Namespace in struts.xml" Watch "What is Namespace in struts.xml" New topic

What is Namespace in struts.xml

Mohan rvscas
Ranch Hand

Joined: Jul 03, 2010
Posts: 39
Hi friends,

what is namespace in struts.xml under struts 2 framework

how to use namespace in struts.xml?

give me the sample example ?

thanks in advance...
swapnil kachave

Joined: Feb 10, 2010
Posts: 27
<package name="web-package" namespace="/pk1"

the name space you can define at package level. and it is get added into your URL.

for ex. your application name id testWeb then action come inside this package you can access like:

Mohan rvscas
Ranch Hand

Joined: Jul 03, 2010
Posts: 39
Thanks swapnil

now i cleared about it .

have a knowledgeable day.

Sita Marivada

Joined: Apr 01, 2010
Posts: 14
The namespace attribute subdivides action configurations into logical modules, each with its own identifying prefix.
Namespaces avoid conflicts between action names.

Sita Putta
I agree. Here's the link:
subject: What is Namespace in struts.xml
It's not a secret anymore!