这是我引入的标签
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 
这是我Action中的代码
 
this.getRequest().getSession().setAttribute("person", person);  
this.getRequest().getSession().setAttribute("David", "David");  
 
这是我页面的代码
<c:out value='${person.name}></c:out>   //person是一个类  
<c:out value='${David}></c:out>
为什么,页面取不到 person那个类的值。
 
                    
                    
                5 回答
 
                    
                    
                            慕婉清6462132
                            
                                
                            
                        
                        
                                                
                    TA贡献1804条经验 获得超2个赞
看看'${person}'能不能取到,如果能的话,就去看看有没有getName()方法,或者name是不是public的。
感觉你少写一半的分号。。。
 
                    
                    
                            慕无忌1623718
                            
                                
                            
                        
                        
                                                
                    TA贡献1744条经验 获得超4个赞
目前的代码看不出问题,我能想到的两种情况:
(1)person类中没有getName()方法
(2)有getName()方法,但是那个name的值正好就是空的
添加回答
举报
0/150
	提交
		取消
	
 
                     
                    