単に完了した時点での日時の取得はできるのですが、再読込を行うと日時が更新されてしまいます。
更新されないようにするには、どのような保持の仕方をすればいいのでしょうか。
ざっくりとしてますが....
/**********BackingBean(SeigoBb.java)************/ public String today() { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); return sdf.format(date); } public String now_time() { Date date = new Date(); SimpleDateFormat sdf1 = new SimpleDateFormat("hh時mm分ss秒"); return sdf1.format(date); } /*********JSFページ****************/ <ui:composition template="resources/templates.xhtml"> <ui:define name="content"> <!-- ここを書き換える --> <p class="itiran_border">2011年度 分野一覧</p> <div align="center"> <p:button outcome="2011_ii/2011ii_kakomon_1.xhtml" value="医学・医療編" onclick="#{cB.setCountup(1)}"/> <!----> </div> <div id="ii" style="display: block"> <table border="1"> <tr> <th class="comp">完了</th> <th></th> <th>解答日時</th> <!--**************--> <th class="comp">完了</th> <th></th> <th>解答日時</th> </tr> <tr> /*完了日時を表示する*/ <th class="ans">#{seigoBb.seigo().get(0)}</th> <th><link href="2011_ii/2011ii_kakomon_1.xhtml">問1</link></th> <th>#{seigoBb.today()}<br/>#{seigoBb.now_time()}</th> <!--****************************************************--> /*完了日時を表示する*/ <th class="ans">#{seigoBb.seigo().get(25)}</th> <th><link href="2011ii_kakomon_1.xhtml">問26</link></th> <th>1</th> </tr>
イメージだけでもいいので、どうかご教授のほどよろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/01/15 02:15
2016/01/16 01:05
2016/01/18 03:27