1 package org.nextime.ion.backoffice.action.security; 2 3 import java.io.IOException ; 4 import java.util.Collections ; 5 import java.util.Vector ; 6 7 import javax.servlet.ServletException ; 8 import javax.servlet.http.HttpServletRequest ; 9 import javax.servlet.http.HttpServletResponse ; 10 import org.apache.struts.action.ActionForm; 11 import org.apache.struts.action.ActionForward; 12 import org.apache.struts.action.ActionMapping; 13 import org.nextime.ion.backoffice.action.BaseAction; 14 import org.nextime.ion.framework.business.User; 15 import org.nextime.ion.framework.mapping.Mapping; 16 17 public class ListUsersAction extends BaseAction { 18 19 public ActionForward perform( 20 ActionMapping mapping, 21 ActionForm form, 22 HttpServletRequest request, 23 HttpServletResponse response) 24 throws IOException , ServletException { 25 26 checkUser(request); 28 29 try { 31 Mapping.begin(); 32 33 Vector users = User.listAll(); 34 Collections.sort(users); 35 Collections.reverse(users); 36 request.setAttribute("users",users); 37 38 Mapping.rollback(); 39 40 } catch (Exception e) { 41 Mapping.rollback(); 42 throw new ServletException (e); 43 } 44 45 return (mapping.findForward("view")); 47 48 } 49 50 } 51 | Popular Tags |