0
hiii i am using spring MVC and i have list which  ia m sending as my response to  jsp but ibn in this jsp i have a attribute isnew which is of type boolean so i want a comaprison on this attribute soo  sode is

    <core:forEach var="i" items="${loginsuccess}" >
        <core:if test="${i.isNew eq true}"> 
                <core:out value="${i.notofication}"></core:out> </br>   
                </core:if>
        </core:forEach>

DAO CODE

@Autowired
    SessionFactory usermanagementSessionFactory;

    public ModelAndView  getNotifications(int id){

        System.out.println("Method ios called");
        Session session = usermanagementSessionFactory.openSession();

        System.out.println("after Getting Session");
        int  id1  = id;
        System.out.println(id1);
        Query query=(Query) session.getNamedQuery("getNotification");
        query.setInteger("userId",id1);

        List<Message> list1= query.list();

        ModelAndView mv = new ModelAndView("notifications");

         mv.addObject("loginsuccess" ,list1);
        return mv;



}

 its not working please suggest me how can i resolve this problem 

それがどのように機能するかを確認します。新しい場合にのみ通知を表示したい、これはログインの成功を返すdaoコードであり、コントローラーはこのコードを単純なメソッドとして呼び出すだけです

4

2 に答える 2

1

これはうまくいくはずです

<core:if test="${i.new}"> 
于 2013-10-05T11:41:04.583 に答える