struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harring Figueiredo" <harri...@gmail.com>
Subject Re: [S2 Tip] Use namespaces to organize your application into logical "modules"
Date Fri, 23 Mar 2007 14:16:25 GMT
Ted,

Thank you so much for sending this out. I was wandering what was the
difference between namespace and package. I guess this explain well.

Thanks !

hff

On 3/23/07, Ted Husted <husted@apache.org> wrote:
>
> Many Struts applications contain hundreds of pages. To help organize
> large applications, the Struts configuration is designed around the
> notions of "packages" and "namespaces". Each package can set its own
> defaults, including a namespace setting.
>
> <struts>
>     <package name="example" namespace="/example" extends="struts-default">
>
>         <action name="HelloWorld" class="example.HelloWorld">
>             <result>/example/HelloWorld.jsp</result>
>         </action>
>
>         <!-- Add actions here -->
>     </package>
> </struts>
>
> Use the namespace attribute to create logical modules or units of work
> within an application, each with its own identifying prefix. In an
> accounting application, the actions relating to "payables" might be in
> one namespace, and actions relating to "receivables" in another.
>
> Namespaces avoid conflicts between action names. Each namespace can
> have it's own "menu" or "help" action, each with its own
> implementation. While the prefix appears in the browser URI, the tags
> are "namespace aware", so the namespace prefix does not need to be
> embedded in forms and links.
>
> -HTH, Ted
> <http://www.husted.com/ted/blog/>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message