⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _usersearch__jsp.java

📁 JSP聊天系统
💻 JAVA
字号:
/*
 * JSP generated by Resin 2.1.2 (built Tue Jun 11 08:26:56 PDT 2002)
 */

package _admin._forum;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.util.*;
import com.coolservlets.forum.*;
import com.coolservlets.forum.util.*;
import com.coolservlets.forum.util.admin.*;

public class _usersearch__jsp extends com.caucho.jsp.JavaPage{
  private boolean _caucho_isDead;
  	//////////////////
	// page variables
	private final String YES = "<font color='#006600' size='-1'><b>Yes</b></font>";
	private final String NO  = "<font color='#ff0000' size='-1'><b>No</b></font>";

  
  public void
  _jspService(javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
    throws java.io.IOException, javax.servlet.ServletException
  {
    com.caucho.jsp.QPageContext pageContext = (com.caucho.jsp.QPageContext) com.caucho.jsp.QJspFactory.create().getPageContext(this, request, response, null, true, 8192, true);
    javax.servlet.jsp.JspWriter out = (javax.servlet.jsp.JspWriter) pageContext.getOut();
    javax.servlet.ServletConfig config = getServletConfig();
    javax.servlet.Servlet page = this;
    javax.servlet.http.HttpSession session = pageContext.getSession();
    javax.servlet.ServletContext application = pageContext.getServletContext();
    response.setContentType("text/html;charset=gb2312");
    request.setCharacterEncoding("GB2312");
    try {
      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      
/**
 *	$RCSfile: userSearch.jsp,v $
 *	$Revision: 1.3.2.2 $
 *	$Date: 2001/02/28 23:56:08 $
 */

      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      com.coolservlets.forum.util.admin.AdminBean adminBean;
      synchronized (session) {
        adminBean = (com.coolservlets.forum.util.admin.AdminBean) session.getValue("adminBean");
        if (adminBean == null) {
          adminBean = new com.coolservlets.forum.util.admin.AdminBean();
          session.putValue("adminBean", adminBean);
        }
      }
      pageContext.write(_jsp_string2, 0, _jsp_string2.length);
      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      	////////////////////////////////
	// Jive authorization check
	
	// check the bean for the existence of an authorization token.
	// Its existence proves the user is valid. If it's not found, redirect
	// to the login page
	Authorization authToken = adminBean.getAuthToken();
	if( authToken == null ) {
		response.sendRedirect( "login.jsp" );
		return;
	}

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      	////////////////////
	// Security check
	
	// make sure the user is authorized to create forums::
	ForumFactory forumFactory = ForumFactory.getInstance(authToken);
	ForumPermissions permissions = forumFactory.getPermissions(authToken);
	boolean isSystemAdmin = permissions.get(ForumPermissions.SYSTEM_ADMIN);
	boolean isUserAdmin   = permissions.get(ForumPermissions.USER_ADMIN);
	
	// redirect to error page if we're not a forum admin or a system admin
	if( !isUserAdmin && !isSystemAdmin ) {
		request.setAttribute("message","No permission to search forums");
		response.sendRedirect("error.jsp");
		return;
	}

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      	//////////////////////
	// get parameters
	
	// paging vars:
	String query = ParamUtils.getParameter(request,"q");

      pageContext.write(_jsp_string3, 0, _jsp_string3.length);
      	///////////////////////
	// pageTitleInfo variable (used by include/pageTitle.jsp)
	String[] pageTitleInfo = { "用户:用户搜索" };

      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      	///////////////////
	// pageTitle include

      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      	if( pageTitleInfo != null ) { 
      pageContext.write(_jsp_string4, 0, _jsp_string4.length);
      	for( int i=0; i<pageTitleInfo.length; i++ ){ 
      pageContext.write(_jsp_string5, 0, _jsp_string5.length);
      out.print(( pageTitleInfo[i] ));
      pageContext.write(_jsp_string5, 0, _jsp_string5.length);
      	if( (i+1)<pageTitleInfo.length ) { 
      pageContext.write(_jsp_string6, 0, _jsp_string6.length);
      	} 
      pageContext.write(_jsp_string7, 0, _jsp_string7.length);
      	} 
      pageContext.write(_jsp_string8, 0, _jsp_string8.length);
      	} 
      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      pageContext.write(_jsp_string9, 0, _jsp_string9.length);
      	/////////////////////////////
	// do a search
	ProfileManager manager = forumFactory.getProfileManager();
	Iterator userIterator = manager.users();
	Hashtable results = new Hashtable();
	while( query!=null && userIterator.hasNext() ) {
		User user = (User)userIterator.next();
		int userID = user.getID();
		String name = user.getName();
		String username = user.getUsername();
		String email = user.getEmail();
		if( name.toLowerCase().indexOf(query.toLowerCase()) > -1 
			|| username.toLowerCase().indexOf(query.toLowerCase()) > -1
			|| email.toLowerCase().indexOf(query.toLowerCase()) > -1 ) 
		{
			results.put(""+userID, user);
		}
	}
	if( results.size() == 0 ) {

      pageContext.write(_jsp_string10, 0, _jsp_string10.length);
      
	} else { 

      pageContext.write(_jsp_string11, 0, _jsp_string11.length);
      	Enumeration resultsEnum = results.elements();
		while( resultsEnum.hasMoreElements() ) {
			User user = (User)resultsEnum.nextElement();
			int userID = user.getID();
			String username = user.getUsername();
			String name = user.getName();
			String email = user.getEmail();
			boolean isNameVisible = user.isNameVisible();
			boolean isEmailVisible = user.isEmailVisible();
	
      pageContext.write(_jsp_string12, 0, _jsp_string12.length);
      out.print(( userID ));
      pageContext.write(_jsp_string13, 0, _jsp_string13.length);
      out.print(( username ));
      pageContext.write(_jsp_string14, 0, _jsp_string14.length);
      out.print(( (name!=null)?name:"<i>no name</i>" ));
      pageContext.write(_jsp_string15, 0, _jsp_string15.length);
      out.print(( email ));
      pageContext.write(_jsp_string16, 0, _jsp_string16.length);
      out.print(( username ));
      pageContext.write(_jsp_string17, 0, _jsp_string17.length);
      out.print(( username ));
      pageContext.write(_jsp_string18, 0, _jsp_string18.length);
      	}
	
      pageContext.write(_jsp_string19, 0, _jsp_string19.length);
      	} 
      pageContext.write(_jsp_string20, 0, _jsp_string20.length);
    } catch (java.lang.Throwable _jsp_e) {
      pageContext.handlePageException(_jsp_e);
    } finally {
      JspFactory.getDefaultFactory().releasePageContext(pageContext);
    }
  }

  private com.caucho.java.LineMap _caucho_line_map;
  private java.util.ArrayList _caucho_depends = new java.util.ArrayList();

  public boolean _caucho_isModified()
  {
    if (_caucho_isDead)
      return true;
    if (com.caucho.util.CauchoSystem.getVersionId() != 2057024144)
      return true;
    for (int i = _caucho_depends.size() - 1; i >= 0; i--) {
      com.caucho.vfs.Depend depend;
      depend = (com.caucho.vfs.Depend) _caucho_depends.get(i);
      if (depend.isModified())
        return true;
    }
    return false;
  }

  public long _caucho_lastModified()
  {
    return 0;
  }

  public com.caucho.java.LineMap _caucho_getLineMap()
  {
    return _caucho_line_map;
  }

  public void destroy()
  {
      _caucho_isDead = true;
      super.destroy();
  }

  public void init(com.caucho.java.LineMap lineMap,
                   com.caucho.vfs.Path appDir)
    throws javax.servlet.ServletException
  {
    com.caucho.vfs.Path resinHome = com.caucho.util.CauchoSystem.getResinHome();
    com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
    mergePath.addMergePath(appDir);
    mergePath.addMergePath(resinHome);
    mergePath.addClassPath(getClass().getClassLoader());
    _caucho_line_map = new com.caucho.java.LineMap("_usersearch__jsp.java", "e:\\jnjt\\admin\\forum\\userSearch.jsp");
    _caucho_line_map.add("/admin/forum/userSearch.jsp", 10, 1);
    _caucho_line_map.add(18, 16);
    _caucho_line_map.add(2, 37);
    _caucho_line_map.add(9, 45);
    _caucho_line_map.add(15, 47);
    _caucho_line_map.add(18, 56);
    _caucho_line_map.add(24, 57);
    _caucho_line_map.add(74, 94);
    _caucho_line_map.add(78, 99);
    _caucho_line_map.add(81, 103);
    _caucho_line_map.add("/admin/forum/include/pageTitle.jsp", 9, 106);
    _caucho_line_map.add(14, 108);
    _caucho_line_map.add(15, 110);
    _caucho_line_map.add(16, 112);
    _caucho_line_map.add(19, 116);
    _caucho_line_map.add(24, 118);
    _caucho_line_map.add("e:\\jnjt\\admin\\forum\\userSearch.jsp", 87, 121);
    _caucho_line_map.add(125, 146);
    _caucho_line_map.add(137, 157);
    _caucho_line_map.add(147, 165);
    _caucho_line_map.add(151, 167);
    _caucho_line_map.add(154, 169);
    _caucho_line_map.add(160, 172);
    com.caucho.vfs.Depend depend;
    depend = new com.caucho.vfs.Depend(mergePath.lookup("file:/e:/jnjt/admin/forum/include/pageTitle.jsp"), 989631934000L, 553L);
    _caucho_depends.add(depend);
    depend = new com.caucho.vfs.Depend(mergePath.lookup("file:/e:/jnjt/admin/forum/userSearch.jsp"), 1029827598084L, 4569L);
    _caucho_depends.add(depend);
  }

  private static byte []_jsp_string2;
  private static byte []_jsp_string10;
  private static byte []_jsp_string9;
  private static byte []_jsp_string6;
  private static byte []_jsp_string4;
  private static byte []_jsp_string7;
  private static byte []_jsp_string15;
  private static byte []_jsp_string3;
  private static byte []_jsp_string20;
  private static byte []_jsp_string8;
  private static byte []_jsp_string14;
  private static byte []_jsp_string0;
  private static byte []_jsp_string12;
  private static byte []_jsp_string13;
  private static byte []_jsp_string17;
  private static byte []_jsp_string16;
  private static byte []_jsp_string19;
  private static byte []_jsp_string1;
  private static byte []_jsp_string5;
  private static byte []_jsp_string18;
  private static byte []_jsp_string11;
  static {
    try {
      _jsp_string2 = "\r\n \r\n".getBytes("GB2312");
      _jsp_string10 = "\r\n		<i>没有查询到任何结果</i>\r\n".getBytes("GB2312");
      _jsp_string9 = "\r\n\r\n\r\n\r\n\r\n<p>\r\n\r\n结 果:<p>\r\n\r\n\r\n".getBytes("GB2312");
      _jsp_string6 = "\r\n			&nbsp;:&nbsp;\r\n		".getBytes("GB2312");
      _jsp_string4 = "\r\n	<table class=\"pageHeaderBg\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n	<td><table class=\"pageHeaderFg\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n	<td>\r\n	<span class=\"pageTitle\">\r\n	".getBytes("GB2312");
      _jsp_string7 = "\r\n	".getBytes("GB2312");
      _jsp_string15 = "\r\n			<br>\r\n			<span style=\"font-size:8pt\">".getBytes("GB2312");
      _jsp_string3 = "\r\n\r\n<html>\r\n<head>\r\n	<title></title>\r\n	<style type=\"text/css\">\r\n	.userHeader {\r\n		font-size : 8pt;\r\n		text-align : center;\r\n	}\r\n	</style>\r\n	<link rel=\"stylesheet\" href=\"style/global.css\">\r\n</head>\r\n\r\n<body background=\"../images/background.gif\" bgcolor=\"#ffffff\" text=\"#000000\" link=\"#0000ff\" vlink=\"#800080\" alink=\"#ff0000\">\r\n".getBytes("GB2312");
      _jsp_string20 = "\r\n\r\n</form>\r\n\r\n</body>\r\n</html>\r\n\r\n".getBytes("GB2312");
      _jsp_string8 = "\r\n	</span>\r\n	</td>\r\n	</table></td>\r\n	</table>\r\n".getBytes("GB2312");
      _jsp_string14 = "</b>\r\n			<br>\r\n			".getBytes("GB2312");
      _jsp_string0 = "\r\n".getBytes("GB2312");
      _jsp_string12 = "\r\n	\r\n	<tr bgcolor=\"#ffffff\">\r\n		<td align=\"center\">".getBytes("GB2312");
      _jsp_string13 = "</td>\r\n		<td>\r\n			<b>".getBytes("GB2312");
      _jsp_string17 = "';\">\r\n		</td>\r\n		<td align=\"center\">\r\n			<input type=\"radio\" name=\"props\" value=\"\"\r\n			 onclick=\"location.href='removeUser.jsp?username=".getBytes("GB2312");
      _jsp_string16 = "</span>\r\n		</td>\r\n		<td align=\"center\">\r\n			<input type=\"radio\" name=\"props\" value=\"\"\r\n			 onclick=\"location.href='editUser.jsp?user=".getBytes("GB2312");
      _jsp_string19 = "\r\n</table>\r\n</td>\r\n</table>\r\n\r\n".getBytes("GB2312");
      _jsp_string1 = "\r\n\r\n".getBytes("GB2312");
      _jsp_string5 = "\r\n		".getBytes("GB2312");
      _jsp_string18 = "';\">\r\n		</td>\r\n	</tr>\r\n	".getBytes("GB2312");
      _jsp_string11 = "\r\n\r\n<p>\r\n\r\n<form>\r\n\r\n<table bgcolor=\"#666666\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n<td>\r\n<table border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"100%\">\r\n<tr bgcolor=\"#eeeeee\">\r\n	<td class=\"userHeader\" width=\"1%\" nowrap>&nbsp;ID&nbsp;</td>\r\n	<td width=\"59%\"><b>用户名</b><br>姓名<br>电子邮件</td>\r\n	<td class=\"userHeader\" width=\"20%\" nowrap>编辑<br>属性<br>许可 </td>\r\n	<td class=\"userHeader\" width=\"20%\" nowrap>删除</td>\r\n</tr>\r\n	".getBytes("GB2312");
    } catch (java.io.UnsupportedEncodingException e) {
      e.printStackTrace();
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -