テーブルから単一のセル値を取得する必要があります。そして、SpringMVCでHibernateを使用しています。
私がしたことは:
Session s = getSessionFactory().getCurrentSession();
query q= s.createQuery("select xxx from abc where asd=:asd");
<c:choose> <c:when> <c:otherwise>
ここで、この単一の値を文字列変数に保存し、この文字列変数を使用して、タグを使用してjspページ内の他の文字列と比較する必要があります...
これは私が今持っているものです。
@Transactional
public String getUseNis(String code) {
Session s = getSessionFactory().getCurrentSession();
Query q = s.createQuery("select useNis from tle_location where code = :code");
q.setString("code", code);
String result = (String) q.uniqueResult();
return result;
jspページの戻り値を使用して、yesまたはnoのいずれかを確認する必要があります...それをjspページに渡す方法。