how to dynamically select an option in listbox using jquery and jstl in jsp page
<p>Hi i have one listbox with some values.
 i want to select it's value based on a value in array list using JSTL.
 My code is something like that</p>

<pre><code>&lt;select id='lstType' name="lstType"&gt;
        &lt;option value="abc" selected="yes"&gt;abc&lt;/option&gt;
        &lt;option value="bcd"&gt;bcd&lt;/option&gt;
    &lt;option value="efg"&gt;efg&lt;/option&gt;
 &lt;/select&gt;
</code></pre>

<p>and a arraylist having some object of entity class.</p>

<pre><code>class entity{
   String str;
}
</code></pre>

<p>Now on jsp page i am fetching like this</p>

<pre><code>$("#lstCategory option[value = &lt;c:out value="${entity.str}"/&gt;]").attr("selected", true);
</code></pre>
