Struts2 jsp用EL表达式取不到Action中的属性

红帽子 2014-04-18
[img][/img]
红帽子 2014-04-18
提供啦get set 方法
红帽子 2014-04-18
package com.suncity.ht.action.impl;

import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.suncity.entity.dto.UsersDto;
import com.suncity.ht.action.BaseAction;
import com.suncity.ht.biz.UsersService;

@Controller("usersAction")
@Scope("prototype")
public class UsersAction extends BaseAction{

	private static final Log logger = LogFactory.getLog(UsersAction.class);

	@Resource(name = "usersService")
	private UsersService usersService;
	
	private UsersDto usersDto;
	
	/**
	 * 游戏者注册
	 * @throws Exception 
	 */
	public String register() throws Exception{
		logger.info("====================== 游戏者注册开始=================");
		usersService.register(usersDto);
		logger.info("====================== 游戏者注册结束=================");
		return SUCCESS;
	}
	
	/**
	 * 用户管理查询
	 * @return
	 * @throws Exception
	 */
	public String queryByPage() throws Exception{
		if(usersDto == null){
			usersDto = new UsersDto();
		}
		usersService.queryByPage(usersDto, this.getPaginationUtil());
//		this.request.setAttribute("paginationUtil", this.getPaginationUtil());
		return SUCCESS;
	}
	
	

	public UsersDto getUsersDto() {
		return usersDto;
	}

	public void setUsersDto(UsersDto usersDto) {
		this.usersDto = usersDto;
	}

	
}

红帽子 2014-04-18
									<c:forEach items="${paginationUtil.list }" var='users'>
										<tr>
											<td class="center">
												<label>
													<input type="checkbox" class="ace" />
													<span class="lbl"></span>
												</label>
											</td>
		
											<td>
												<a href="#">${users.userName }</a>
											</td>
											<td>
												${users.name }
											</td>
											<td class="hidden-480">
												<c:if test="${users.sex eq 1 }">男</c:if>
												<c:if test="${users.sex ne 1 }">男</c:if>
											</td>
											<td>
												${users.email }
											</td>
											<td class="hidden-480">
												${users.qq }
											</td>
											<td>
												${users.yy }
											</td>
											<td>
												${users.address }
											</td>
										</tr>
									</c:forEach>
红帽子 2014-04-18
红帽子 2014-04-18
顶顶顶顶顶顶.
Global site tag (gtag.js) - Google Analytics