How to set default Tiles layout in Struts 2

john

I am developing an sample app which has multiple pages, all pages comes under common layout ( CommonLayout: which has Header, Body, Footer).

<package name="myapp" extends="default" namespace="/">
    <action name="a"><result type="tiles">CommonLayout</result></action>
    <action name="a/create"><result type="tiles">CommonLayout</result></action>
    <action name="b"><result type="tiles">CommonLayout</result></action>
    <action name="b/customize"><result type="tiles">CommonLayout</result></action>
    <action name="b/customize/app"><result type="tiles">CommonLayout</result></action>
    <action name="d/create"><result type="tiles">CommonLayout</result></action>
    <action name="d/view"><result type="tiles">CommonLayout</result></action>
    <action name="d/view/list"><result type="tiles">CommonLayout</result></action>
</package>

Every time when I am adding action, I have to duplicate the same line for every action, is there any configuration to mention layout for all actions ?

Roman C

You can use global results per package. For example

<package name="default" extends="struts-default">
  ...
  <global-results>
    <result type="tiles">CommonLayout</result>
  </global-results>
  ...
</package>
<package name="myapp" extends="default" namespace="/">
    <action name="a"/>
    <action name="a/create"/>
    <action name="b"/>
    <action name="b/customize"/>
    <action name="b/customize/app"/>
    <action name="d/create"/>
    <action name="d/view"/>
    <action name="d/view/list"/>
</package>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to integrate properly Tiles 3 with Struts2 ?

From Dev

Struts2 + Tiles + NETBEANS

From Dev

Set default value for struts 2 autocompleter

From Dev

How to set Relative Layout as default layout

From Dev

Struts2 Tiles setting a var to a tiles attribute as string

From Dev

Source Code fir Tiles struts-tiles2-1.4.0-SNAPSHOT

From Dev

Requested resource not available using Struts 2 - Tiles

From Dev

error while using tiles in struts2

From Dev

How To Set Default Layout For ASP Razor MVC

From Dev

How to set default Start screen layout?

From Dev

How to highlight an active element in the menu when clicked in Struts2 tiles?

From Dev

How to highlight an active element in the menu when clicked in Struts2 tiles?

From Dev

How to insert a value into Set collection in Struts 2

From Dev

How to insert a value into Set collection in Struts 2

From Dev

Struts 2 Default Page

From Dev

How to set an <html:radio> checked by default in Struts 1.1

From Dev

How to change default JSP/template location with Struts2

From Dev

How to handle exceptions thrown by default interceptors in struts2?

From Dev

Struts2 : How do I deactivate the default message of FieldValidators

From Dev

How to change default date formats in Struts2?

From Dev

How to exclude One action from default interceptor in Struts 2

From Dev

Struts2 : How do I deactivate the default message of FieldValidators

From Dev

How to exclude One action from default interceptor in Struts 2

From Dev

Struts2 and Tiles3 NoSuchMethodError exception at CompleteAutoloadTilesListener

From Dev

Struts2 and Tiles3 NoSuchMethodError exception at CompleteAutoloadTilesListener

From Dev

express-ejs-layout: how to set default view if no view was passed

From Dev

How to set default text in TextView to see it in the layout preview while binding?

From Dev

How to set the default page layout from RTL to LTR in Excel 2010?

From Dev

How to set default console keyboard layout in Arch Linux?

Related Related

  1. 1

    How to integrate properly Tiles 3 with Struts2 ?

  2. 2

    Struts2 + Tiles + NETBEANS

  3. 3

    Set default value for struts 2 autocompleter

  4. 4

    How to set Relative Layout as default layout

  5. 5

    Struts2 Tiles setting a var to a tiles attribute as string

  6. 6

    Source Code fir Tiles struts-tiles2-1.4.0-SNAPSHOT

  7. 7

    Requested resource not available using Struts 2 - Tiles

  8. 8

    error while using tiles in struts2

  9. 9

    How To Set Default Layout For ASP Razor MVC

  10. 10

    How to set default Start screen layout?

  11. 11

    How to highlight an active element in the menu when clicked in Struts2 tiles?

  12. 12

    How to highlight an active element in the menu when clicked in Struts2 tiles?

  13. 13

    How to insert a value into Set collection in Struts 2

  14. 14

    How to insert a value into Set collection in Struts 2

  15. 15

    Struts 2 Default Page

  16. 16

    How to set an <html:radio> checked by default in Struts 1.1

  17. 17

    How to change default JSP/template location with Struts2

  18. 18

    How to handle exceptions thrown by default interceptors in struts2?

  19. 19

    Struts2 : How do I deactivate the default message of FieldValidators

  20. 20

    How to change default date formats in Struts2?

  21. 21

    How to exclude One action from default interceptor in Struts 2

  22. 22

    Struts2 : How do I deactivate the default message of FieldValidators

  23. 23

    How to exclude One action from default interceptor in Struts 2

  24. 24

    Struts2 and Tiles3 NoSuchMethodError exception at CompleteAutoloadTilesListener

  25. 25

    Struts2 and Tiles3 NoSuchMethodError exception at CompleteAutoloadTilesListener

  26. 26

    express-ejs-layout: how to set default view if no view was passed

  27. 27

    How to set default text in TextView to see it in the layout preview while binding?

  28. 28

    How to set the default page layout from RTL to LTR in Excel 2010?

  29. 29

    How to set default console keyboard layout in Arch Linux?

HotTag

Archive