@View

Target: Class annotated with @StageDefinition or any attribute of the same class.

Description: Injects a view on a stage.

Remarks: Can be used on the class or on an attribute. If used on an attribute, the attribute type must be ViewObject. See the examples for the different usages.

JavaDoc: Click here

Attributes:

Name Description Data type Required Default value
engine Rendering engine type. String No Inferred from the target extension.
target The view file or template. String Yes -
defaultView This is the second attribute Boolean No False

Engine: The engine identifies the ViewRenderer that will be called to render the given view template. The ViewRenderers are registered in the IoC with a given ID that is by convention identical to the extension on it's templates files.

I.e.: JSPViewRenderer is registered as "jsp".

Only when this convention is not respected will we have to declare with ViewRenderer engine we want to use, with the correspondent IoC registered ViewRenderer id.

Examples:

@StageDefinition(name = "MyStage", service = "myservice")
@View(target = "myView.jsp")
public class MyStage {
 ...
}

@StageDefinition(name = "MyStage", service = "myservice")
public class MyStage {

 @View(target="aView.jsp")
 ViewObject view;

 @View(engine="JSP", target="anotherView.jsp")
 ViewObject view2;
 ...
}

See also:

Back to annotation reference