我的实体类是这样的
News{
Attache attache;
//省略getter和setter方法
}
Attache{
String path;
//省略getter和setter方法
}
再数据库中没有外键关联,我在前端想用El表达式这么取却出异常了
<c:forEach items="${newsList}" var="news">
${news.attche.path}
</c:forEach>
请问哪里出错了?应该怎么改?
我的实体类是这样的
News{
Attache attache;
//省略getter和setter方法
}
Attache{
String path;
//省略getter和setter方法
}
再数据库中没有外键关联,我在前端想用El表达式这么取却出异常了
<c:forEach items="${newsList}" var="news">
${news.attche.path}
</c:forEach>
请问哪里出错了?应该怎么改?
这样是不行的,newlist是object封装的,要指定类型,或强转。