title: Cannot set JSTL User variable instead of java.lang.String
body: <p>So I have a code listed below, I want to set ${tempUser} from session scope or ${userToEdit} from request scope if exists to new variable so I'm not gonna need to duplicate my code and gonna use ${userBean.login} etc.
  The problem is userBean is still the string and it throws the exception (no login property). How can I create variable of User type here?</p>
  
  <pre><code>    &lt;c:set var="userBean" scope="page"&gt;${tempUser}&lt;/c:set&gt;
  
      &lt;c:if test="${not empty userToEdit}"&gt;
          &lt;c:set var="userBean"&gt;${userToEdit}&lt;/c:set&gt;
      &lt;/c:if&gt;
  
      &lt;div class="section no-pad-bot" id="index-banner"&gt;
          &lt;div class="container"&gt;
              &lt;h2 class="header center orange-text"&gt;
                  &lt;c:choose&gt;
                      &lt;c:when test="${not empty userToEdit}"&gt;
                          Edit user
                      &lt;/c:when&gt;
                      &lt;c:otherwise&gt;
                          Add user
                      &lt;/c:otherwise&gt;
                  &lt;/c:choose&gt;
                  &lt;c:out value="${userBean}"/&gt;
                  ${userBean.login}
              &lt;/h2&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>