如何使用JSTL从JSP页面获取值

时间:2013-03-25 16:32:53

标签: jsp jstl

<%
    com.BeanPaket.kontrolBean kontrol = new kontrolBean();
    String epostavalue = kontrol.getEposta();
%>

<sql:query var="kutuphane" dataSource="${dataSource}">
    SELECT * FROM kutuphane.odunc_kitaplar WHERE eposta = ?

</sql:query>

如何在&lt; %%&gt;中输入我认可的值?标记到sql查询中以从数据库中获取列表?

1 个答案:

答案 0 :(得分:0)

试试这个:

<sql:query var="kutuphane" dataSource="${dataSource}">
SELECT * FROM kutuphane.odunc_kitaplar WHERE eposta = ?
   <sql:param value="${epostavalue}" />
</sql:query>