java se spring を利用しています。
jspのviewでDBの情報を一覧で表示しようとした際に
性別項目を日本語に変換したいのですが、対応するやり方を検索することができなかった為
どなたかご教授いただければ幸いです。
やりたいこと
jspで性別を日本語で表示したい
男性(jsp)=m(DB上) 女性(jsp)=f(DB上)
※DBはMysqlで性別の項目はString型です
<table class="table table-bordered table-hover"> <tr> <th>姓</th> <th>名</th> <th>性別</th> <th>誕生日</th> </tr> <c:forEach items="${employees}" var="employee" varStatus="status"> <tr> <th>${employee.familyName}</th> <th>${employee.firstName}</th> <th>${employee.sex}</th> <th> <fmt:formatDate value="${employee.birthday}" pattern="yyyy/MM/dd" /></th> </tr> </c:forEach> </table>
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/08/22 03:21
2017/08/22 04:00
2017/08/22 04:31
2017/08/22 05:54