如果其他人不在jstl上工作 hiii我使用的是spring MVC,我有一个列表,我正在发送它作为对jsp的响应,但是在这个jsp中,我有一个属性isnew,它的类型是boolean,所以我希望在这个属性上有一个comaprison DAO代码 @自动连线 SessionFactory用户管理SessionFactory; 公共模型和视图获取通知(int-id){ System.out.println(“调用ios的方法”); 会话=usermanagementSessionFactory.openSession(); System.out.println(“获取会话后”); int id1=id; 系统输出打印项次(id1); Query Query=(Query)session.getNamedQuery(“getNotification”); setInteger(“userId”,id1); List list1=query.List(); ModelAndView mv=新的ModelAndView(“通知”); mv.addObject(“登录成功”,列表1); 返回mv; } 它不工作,请建议我如何解决这个问题
检查它是如何工作的。 我只想在通知是新的时候才显示它,这是返回登录成功的dao代码,控制器只调用此代码作为简单方法如果其他人不在jstl上工作 hiii我使用的是spring MVC,我有一个列表,我正在发送它作为对jsp的响应,但是在这个jsp中,我有一个属性isnew,它的类型是boolean,所以我希望在这个属性上有一个comaprison DAO代码 @自动连线 SessionFactory用户管理SessionFactory; 公共模型和视图获取通知(int-id){ System.out.println(“调用ios的方法”); 会话=usermanagementSessionFactory.openSession(); System.out.println(“获取会话后”); int id1=id; 系统输出打印项次(id1); Query Query=(Query)session.getNamedQuery(“getNotification”); setInteger(“userId”,id1); List list1=query.List(); ModelAndView mv=新的ModelAndView(“通知”); mv.addObject(“登录成功”,列表1); 返回mv; } 它不工作,请建议我如何解决这个问题,jsp,spring-mvc,jstl,Jsp,Spring Mvc,Jstl,检查它是如何工作的。 我只想在通知是新的时候才显示它,这是返回登录成功的dao代码,控制器只调用此代码作为简单方法 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 attri
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
您可以这样使用
<core:if test="${i.new}">
//待办事项陈述
//待办事项陈述
hiii@Alex我想用其他部分来处理这个问题,所以我需要doo@NavKumar使用
回答什么?问题是什么?还有什么“其他”?您的页面或JSTL中都没有“else”“不工作”不是一个适当的问题描述。澄清你的问题。
<c:choose>
<c:when test="${i.new}">
//to do statement
</c:when>
//to do statement
<otherwise>
</otherwise>
</c:choose>