4.2. Defining view states
Prev | 4. Rendering views | Next

## 4.2. Defining view states

Use the `view-state` element to define a step of the flow that renders a view and waits for a user event to resume:

    <view-state id="enterBookingDetails">
        <transition on="submit" to="reviewBooking" />
    </view-state>

By convention, a view-state maps its id to a view template in the directory where the flow is located. For example, the state above might render `/WEB-INF/hotels/booking/enterBookingDetails.xhtml` if the flow itself was located in the `/WEB-INF/hotels/booking` directory.

Below is a sample directory structure showing views and other resources like message bundles co-located with their flow definition:

Flow Packaging

Prev | Up | Next
4. Rendering views | Home | 4.3. Specifying view identifiers