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

📄 _createforum__jsp.java

📁 JSP聊天系统
💻 JAVA
字号:
/*
 * JSP generated by Resin 2.1.4 (built Fri Aug  2 14:16:52 PDT 2002)
 */

package _admin;
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 _createforum__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, 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: createForum.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 create forums::
	ForumFactory forumFactory = ForumFactory.getInstance(authToken);
	ForumPermissions permissions = forumFactory.getPermissions(authToken);
	boolean isSystemAdmin = permissions.get(ForumPermissions.SYSTEM_ADMIN);
	boolean isUserAdmin   = permissions.get(ForumPermissions.FORUM_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 create forums");
		response.sendRedirect("error.jsp");
		return;
	}

      pageContext.write(_jsp_string2, 0, _jsp_string2.length);
      	////////////////////
	// Get parameters
	boolean doCreate         = ParamUtils.getBooleanParameter(request,"doCreate");
	String forumName         = ParamUtils.getParameter(request,"forumName");
	String forumDescription  = ParamUtils.getParameter(request,"forumDescription");

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      	////////////////////
	// Error variables
	boolean forumNameError = (forumName==null);
	
	boolean errors = forumNameError;
	
	String errorMessage = "An error occured.";

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      	//////////////////////////////
	// create forum if no errors and redirect to forum main page
	
	if( !errors && doCreate ) {
		Forum newForum = null;
		String message = null;
		try {
			if( forumDescription == null ) {
				forumDescription = "";
			}
			newForum = forumFactory.createForum( forumName, forumDescription );
			message = "Forum \"" + forumName + "\" created successfully!";
			request.setAttribute("message",message);
			response.sendRedirect("forumPerms.jsp?forum="+newForum.getID());
			return;
		}
		catch( UnauthorizedException ue ) {
			message = "Error creating forum \"" + forumName
				+ "\" - you are not authorized to create forums.";
		}
		catch( Exception e ) {
			message = "Error creating forum \"" + forumName + "\"";
		}
		request.setAttribute("message",message);
		response.sendRedirect("error.jsp");
		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);
      	///////////////////////////////////////////
	// print out error message if there was one
	if( errors && doCreate ) {

      pageContext.write(_jsp_string10, 0, _jsp_string10.length);
      out.print(( 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);
      	if( forumNameError && doCreate ) { 
      pageContext.write(_jsp_string14, 0, _jsp_string14.length);
      	} 
      pageContext.write(_jsp_string15, 0, _jsp_string15.length);
      out.print(( (forumName!=null)?forumName:"" ));
      pageContext.write(_jsp_string16, 0, _jsp_string16.length);
      pageContext.write(_jsp_string17, 0, _jsp_string17.length);
      out.print(( (forumDescription!=null)?forumDescription:"" ));
      pageContext.write(_jsp_string18, 0, _jsp_string18.length);
      pageContext.write(_jsp_string19, 0, _jsp_string19.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() != 2057024146)
      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("_createforum__jsp.java", "D:\\resin-2.1.4\\webapps\\e-forum\\admin\\createForum.jsp");
    _caucho_line_map.add("/e-forum/admin/createForum.jsp", 10, 1);
    _caucho_line_map.add(2, 32);
    _caucho_line_map.add(9, 40);
    _caucho_line_map.add(15, 42);
    _caucho_line_map.add(18, 51);
    _caucho_line_map.add(32, 64);
    _caucho_line_map.add(50, 81);
    _caucho_line_map.add(102, 126);
    _caucho_line_map.add(106, 131);
    _caucho_line_map.add(109, 135);
    _caucho_line_map.add("/admin/include/pageTitle.jsp", 9, 138);
    _caucho_line_map.add(14, 140);
    _caucho_line_map.add(15, 142);
    _caucho_line_map.add(16, 144);
    _caucho_line_map.add(19, 148);
    _caucho_line_map.add(24, 150);
    _caucho_line_map.add("D:\\resin-2.1.4\\webapps\\e-forum\\admin\\createForum.jsp", 112, 153);
    _caucho_line_map.add(116, 158);
    _caucho_line_map.add(119, 160);
    _caucho_line_map.add(128, 163);
    _caucho_line_map.add(132, 165);
    _caucho_line_map.add(140, 170);
    com.caucho.vfs.Depend depend;
    depend = new com.caucho.vfs.Depend(appDir.lookup("admin/include/pageTitle.jsp"), 989631934000L, 553L);
    _caucho_depends.add(depend);
    depend = new com.caucho.vfs.Depend(appDir.lookup("admin/createForum.jsp"), 1029826112000L, 4188L);
    _caucho_depends.add(depend);
  }

  private static byte []_jsp_string11;
  private static byte []_jsp_string14;
  private static byte []_jsp_string12;
  private static byte []_jsp_string6;
  private static byte []_jsp_string7;
  private static byte []_jsp_string4;
  private static byte []_jsp_string10;
  private static byte []_jsp_string17;
  private static byte []_jsp_string9;
  private static byte []_jsp_string15;
  private static byte []_jsp_string16;
  private static byte []_jsp_string2;
  private static byte []_jsp_string8;
  private static byte []_jsp_string0;
  private static byte []_jsp_string18;
  private static byte []_jsp_string13;
  private static byte []_jsp_string19;
  private static byte []_jsp_string1;
  private static byte []_jsp_string3;
  private static byte []_jsp_string5;
  static {
    try {
      _jsp_string11 = "\r\n		</span>\r\n		<p>\r\n".getBytes("GB2312");
      _jsp_string14 = "\r\n	<span class=\"errorText\">\r\n	请填写论坛名.\r\n	</span>\r\n".getBytes("GB2312");
      _jsp_string12 = "\r\n注意:这样创建了一个没有许可的论坛。创建这样的论坛之后,您将被导航至论坛许可页面。\r\n \r\n\r\n<form action=\"createForum.jsp\" method=\"post\">\r\n<input type=\"hidden\" name=\"doCreate\" value=\"true\">\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_string10 = "		<span class=\"errorText\">\r\n		".getBytes("GB2312");
      _jsp_string17 = "\r\n论坛描述: <i>(可选)</i>\r\n<ul>\r\n	<textarea name=\"forumDescription\" cols=\"30\" rows=\"5\" wrap=\"virtual\">".getBytes("GB2312");
      _jsp_string9 = "\r\n\r\n\r\n\r\n\r\n<p>\r\n\r\n".getBytes("GB2312");
      _jsp_string15 = "\r\n<ul>\r\n	<input type=\"text\" name=\"forumName\" value=\"".getBytes("GB2312");
      _jsp_string16 = "\">\r\n</ul>\r\n\r\n".getBytes("GB2312");
      _jsp_string2 = "\r\n\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_string0 = "\r\n".getBytes("GB2312");
      _jsp_string18 = "</textarea>\r\n</ul>\r\n\r\n".getBytes("GB2312");
      _jsp_string13 = "\r\n论坛名:\r\n".getBytes("GB2312");
      _jsp_string19 = "\r\n<input type=\"submit\" value=\"创 建\">\r\n	\r\n</form>\r\n\r\n</body>\r\n</html>\r\n\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 + -