91-9990449935 0120-4256464 |
Struts 2 Multiple Namespace ExampleWe can define multiple namespaces in struts.xml file by the namespace attribute of package element. As we know, default namespace is / (root). Let's see the simple example to define multiple namespaces in struts.xml file. Define multiple namespaces in struts.xmlThis struts.xml file contains three packages with different names and namespaces. struts.xmlOther required resourcesWe need some other required files to understand the full example of multiple namespaces.
1) Create index.jspThis jsp page provides three links. index.jsp2) Create the action classIt is the simple action class containing execute method only. Welcome.java3) 3 view componentsHere name of all the 3 view components are same but there location are different. welcome.jspIt must be located in the root directory. welcome.jspIt must be located in the first directory under the root directory. welcome.jspIt must be located in the second directory under the root directory.
Next TopicStruts2 Interceptors Tutorial
|