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

📄 _creategroup__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 _creategroup__jsp extends com.caucho.jsp.JavaPage{
  private boolean _caucho_isDead;
  
  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, "/admin/forum/error.jsp", 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: createGroup.jsp,v $
 *	$Revision: 1.3 $
 *	$Date: 2000/12/18 02:06:21 $
 */

      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_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_string2, 0, _jsp_string2.length);
      	////////////////////
	// Security check
	
	// make sure the user is authorized to administer users:
	ForumFactory forumFactory = ForumFactory.getInstance(authToken);
	boolean isSystemAdmin = ((Boolean)session.getValue("jiveAdmin.systemAdmin")).booleanValue();
	boolean isGroupAdmin  = ((Boolean)session.getValue("jiveAdmin.groupAdmin")).booleanValue();
	
	// redirect to error page if we're not a group admin or a system admin
	if( !isGroupAdmin && !isSystemAdmin ) {
		throw new UnauthorizedException("Sorry, you don't have permission to create a group");
	}

      pageContext.write(_jsp_string2, 0, _jsp_string2.length);
      	////////////////////
	// get parameters
	
	String groupName         = ParamUtils.getParameter(request,"groupName");
	String groupDescription  = ParamUtils.getParameter(request,"groupDescription");
	boolean doCreate         = ParamUtils.getBooleanParameter(request,"doCreate");

      pageContext.write(_jsp_string2, 0, _jsp_string2.length);
      	//////////////////////////////////
	// global error variables
	
	String errorMessage = "";
	
	boolean errorGroupName = (groupName == null);
	boolean errorGroupAlreadyExists = false;
	boolean errors = (errorGroupName);

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      	//////////////////
	// load user of this page:
	
	ProfileManager manager = forumFactory.getProfileManager();
	
	// UserNotFoundException is caught by error page
	User user = manager.getUser(authToken.getUserID());

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      	////////////////////
	// create the group
	
	if( !errors && doCreate ) {
		try {
			Group newGroup = manager.createGroup(groupName);
			// add this user as an administrator of the new group
			newGroup.addAdministrator(user);
			if( groupDescription != null ) {
				newGroup.setDescription( groupDescription );
			}
		}
		catch( GroupAlreadyExistsException gaee ) {
			errorGroupAlreadyExists = true;
		}
	}

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      	////////////////
	// error check
	errors = (errorGroupName || errorGroupAlreadyExists);

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      	////////////////////
	// set error messages
	if( errors ) {
		if( errorGroupName ) {
			errorMessage = "请指定组名!";
		}
		else if( errorGroupAlreadyExists ) {
			errorMessage = "这个组已经存在,请选择一个不同的组名!";
		}
		else {
			errorMessage = "添加组时出现错误!";
		}
	}

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      	//////////////////////////////////////////////////////////////////////
	// if a user was successfully created, say so and return (to stop the 
	// jsp from executing
	if( !errors ) {
		response.sendRedirect(
			response.encodeRedirectURL("groups.jsp?msg=Group was created successfully!")
		);
		return;
	} 

      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);
      pageContext.write(_jsp_string10, 0, _jsp_string10.length);
      out.print(( doCreate?errorMessage:"" ));
      pageContext.write(_jsp_string11, 0, _jsp_string11.length);
      pageContext.write(_jsp_string12, 0, _jsp_string12.length);
      pageContext.write(_jsp_string13, 0, _jsp_string13.length);
      out.print(( (groupName!=null)?groupName:"" ));
      pageContext.write(_jsp_string14, 0, _jsp_string14.length);
      pageContext.write(_jsp_string15, 0, _jsp_string15.length);
      out.print(( (groupDescription!=null)?groupDescription:"" ));
      pageContext.write(_jsp_string16, 0, _jsp_string16.length);
      pageContext.write(_jsp_string17, 0, _jsp_string17.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("_creategroup__jsp.java", "e:\\jnjt\\admin\\forum\\createGroup.jsp");
    _caucho_line_map.add("/admin/forum/createGroup.jsp", 14, 1);
    _caucho_line_map.add("e:\\jnjt\\admin\\forum\\createGroup.jsp", 139, 1);
    _caucho_line_map.add("/admin/forum/createGroup.jsp", 2, 32);
    _caucho_line_map.add(9, 40);
    _caucho_line_map.add(14, 41);
    _caucho_line_map.add(17, 42);
    _caucho_line_map.add(20, 51);
    _caucho_line_map.add(130, 154);
    _caucho_line_map.add(134, 159);
    _caucho_line_map.add(137, 163);
    _caucho_line_map.add("/admin/forum/include/pageTitle.jsp", 9, 166);
    _caucho_line_map.add(14, 168);
    _caucho_line_map.add(15, 170);
    _caucho_line_map.add(16, 172);
    _caucho_line_map.add(19, 176);
    _caucho_line_map.add(24, 178);
    _caucho_line_map.add("e:\\jnjt\\admin\\forum\\createGroup.jsp", 139, 181);
    _caucho_line_map.add(141, 182);
    _caucho_line_map.add(167, 186);
    _caucho_line_map.add(177, 189);
    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/createGroup.jsp"), 1029826697530L, 5185L);
    _caucho_depends.add(depend);
  }

  private static byte []_jsp_string2;
  private static byte []_jsp_string6;
  private static byte []_jsp_string7;
  private static byte []_jsp_string4;
  private static byte []_jsp_string11;
  private static byte []_jsp_string13;
  private static byte []_jsp_string14;
  private static byte []_jsp_string15;
  private static byte []_jsp_string16;
  private static byte []_jsp_string8;
  private static byte []_jsp_string0;
  private static byte []_jsp_string10;
  private static byte []_jsp_string12;
  private static byte []_jsp_string17;
  private static byte []_jsp_string9;
  private static byte []_jsp_string1;
  private static byte []_jsp_string3;
  private static byte []_jsp_string5;
  static {
    try {
      _jsp_string2 = "\r\n \r\n".getBytes("GB2312");
      _jsp_string6 = "\r\n			&nbsp;:&nbsp;\r\n		".getBytes("GB2312");
      _jsp_string7 = "\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_string11 = "\r\n</span>\r\n\r\n<p>\r\n\r\n<font size=\"-1\">这样创建了一个没有许可,没有管理,没有用户的组。一旦您创建了这样的组,您必须编辑它的属性。\r\n \r\n</font>\r\n\r\n<p>\r\n\r\n".getBytes("GB2312");
      _jsp_string13 = "\r\n<tr bgcolor=\"#ffffff\">\r\n	        <td><font size=\"-1\">组名:</font></td>\r\n	<td><input type=\"text\" name=\"groupName\" size=\"30\" maxlength=\"100\"\r\n		 value=\"".getBytes("GB2312");
      _jsp_string14 = "\">\r\n	</td>	\r\n</tr>\r\n\r\n".getBytes("GB2312");
      _jsp_string15 = "\r\n<tr bgcolor=\"#ffffff\">\r\n	<td><font size=\"-1\">组说明:<br>\r\n              (可选)</font></td>\r\n	<td>\r\n		<textarea name=\"groupDescription\" wrap=\"virtual\" cols=\"40\" rows=\"5\"\r\n 		>".getBytes("GB2312");
      _jsp_string16 = "</textarea>\r\n	</td>	\r\n</tr>\r\n\r\n</table>\r\n</td>\r\n</table>\r\n<br clear=\"all\"><br>\r\n\r\n<script language=\"JavaScript\" type=\"text/javascript\">\r\n<!--\r\ndocument.f.groupName.focus();\r\n//-->\r\n</script>\r\n\r\n<p>\r\n\r\n<center>\r\n	<input type=\"submit\" value=\"添加\">\r\n</center>\r\n\r\n</form>\r\n".getBytes("GB2312");
      _jsp_string8 = "\r\n	</span>\r\n	</td>\r\n	</table></td>\r\n	</table>\r\n".getBytes("GB2312");
      _jsp_string0 = "\r\n".getBytes("GB2312");
      _jsp_string10 = "\r\n<span class=\"errorText\">\r\n	".getBytes("GB2312");
      _jsp_string12 = "\r\n<form action=\"createGroup.jsp\" method=\"post\" name=\"f\">\r\n<input type=\"hidden\" name=\"doCreate\" value=\"true\">\r\n\r\n<b>新组信息:</b>\r\n<p>\r\n\r\n<table bgcolor=\"#999999\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"95%\" align=\"right\">\r\n<td>\r\n<table bgcolor=\"#999999\" cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\">\r\n\r\n".getBytes("GB2312");
      _jsp_string17 = "\r\n\r\n</body>\r\n</html>\r\n\r\n".getBytes("GB2312");
      _jsp_string9 = "\r\n\r\n\r\n\r\n\r\n<p>\r\n".getBytes("GB2312");
      _jsp_string1 = "\r\n\r\n".getBytes("GB2312");
      _jsp_string3 = "\r\n\r\n<html>\r\n<head>\r\n	<title></title>\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_string5 = "\r\n		".getBytes("GB2312");
    } catch (java.io.UnsupportedEncodingException e) {
      e.printStackTrace();
    }
  }
}

⌨️ 快捷键说明

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