<p>I've just inherited some old Struts code.</p>

<p>If Struts (1.3) follows the MVC pattern, how do the Action classes fill the View with variables to render in HTML ?</p>

<p>So far, I've seen the Action classes push variables in <code>(1)</code> the HTTP request with</p>

<pre><code>request.setAttribute("name", user.getName())
</code></pre>

<p><code>(2)</code> in ActionForm classes, using methods specific to the application:</p>

<pre><code>UserForm form = (UserForm) actionForm;
form.setUserName(user.getName());
</code></pre>

<p>and <code>(3)</code> a requestScope variable, that I see in the JSP layer (the view uses JSP), but I can't see in the Action classes.</p>

<pre><code>&lt;p style='color: red'&gt;&lt;c:out value='${requestScope.userName}' /&gt;&lt;/p&gt;
</code></pre>

<p>So, which of these is considered old-school, and what's the recommended way of pushing variables in the View in Struts ?</p>

[{'answer_id': 82512, 'author': 'Arno', 'author_id': 13685, 'author_profile': 'https://Stackoverflow.com/users/13685', 'pm_score': 1, 'selected': False, 'text': '<p>My Struts days are long over, but as far as I remember we used to place one view-specific bean (which would work as a holder for fine-graner beans or collections of beans) into the request scope within our Action.perform() implementation. This view-specific bean would then be rendered by the view.</p>\n'}, {'answer_id': 82517, 'author': 'Olaf Kock', 'author_id': 13447, 'author_profile': 'https://Stackoverflow.com/users/13447', 'pm_score': 1, 'selected': True, 'text': "<p>As <code>Struts 1.3</code> is considered old-school, I'd recommend to go with the flow and use the style that already is used throughout the application you inherited.</p>\n\n<p>If all different styles are already used, pick the most used one. After that, pick your personal favourite. Mine would be 1 or 3 - the form (2) is usually best suited for data that will eventually be rendered inside some form controls. If this is the case - use the form, otherwise - don't.</p>\n"}]
['https://Stackoverflow.com/questions/82359', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15649/']