Custom Attributes

The NStruts Custom Attributes allows to publish actions without needs to write configuration items (i.e. XML tags).
Outlined below there are the available NStruts attributes:

[Action]

Applies to Class and Method
Allow Multiple false
constructor Action( string path )
Example [Action( "/custom" )]
class NStruts.Attributes.ActionAttribute


This attribute can be used in order to declare a new NStruts's Action

property type feature
Name string Form-Object's Name associated to action
Scope string Form-Object's scope (context|session|application|cache)
Path string Action's path - mandatory

[ActionContainer]

Applies to Class and Method
Allow Multiple false
constructor ActionContainer()
Example [ActionContainer]
class NStruts.Attributes.ActionContainerAttribute


This attribute can be used in order to declare that within class there are Method Level Actions (see ReflectionAction )

[Forward]

Applies to Class and Method
Allow Multiple true
constructor Forward( string name, string path )
Example [Forward( "success", "/ViewActionDetails.aspx")]
class NStruts.Attributes.ForwardAttribute


This attribute can be used in order to declare a new action's forward. (w) It has sense only if is declared an ActionAttribute first

property type feature
Name string name that identify the forward object - mandatory
Path string Forward's path - mandatory
Redirect bool it indicates if you want use the http redirect to invoke the forward's path (i) default is false

[FormObject]

Applies to Class
Allow Multiple false
constructor FormObject( string name )
Example [FormObject( "user" )]
class NStruts.Attributes.FormObjectAttribute


This attribute can be used in order to delclare a new NStruts's FormObject

property type feature
Name string Form-Object's Name - mandatory

Last edited Feb 14, 2007 at 7:49 AM by bsorrentino, version 4

Comments

No comments yet.