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

📄 _createaccount__jsp.java

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

package _forum;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import com.coolservlets.forum.*;
import com.coolservlets.forum.util.*;
import java.util.Date;
import java.text.SimpleDateFormat;

public class _createaccount__jsp extends com.caucho.jsp.JavaPage{
  private boolean _caucho_isDead;
  	///////////////////
	// global variables
	
	private final static String errorFieldColor = "#D5E9FD";

  	////////////////////////
	// global page variables
	
	// date formatter for today's date
	private final SimpleDateFormat todayDateFormatter = 
		new SimpleDateFormat("MMMM d");

  	///////////////////////
	// breadcrumb variables
	
	// change these values to customize the look of your breadcrumb bar
	
	// Colors
	final static String crumbBgcolor = "#999999";
	final static String crumbFgcolor = "#ccccdd";

  
  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, "/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: createAccount.jsp,v $
 *	$Revision: 1.4 $
 *	$Date: 2000/12/18 02:02:08 $
 */

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      	////////////////////////
	// Authorization check
	
	// check for the existence of an authorization token
	Authorization authToken = SkinUtils.getUserAuthorization(request,response);
	
	// if the token was null, they're not authorized. Since this skin will
	// allow guests to view forums, we'll set a "guest" authentication
	// token. This way, either registered users or guests can create a new account.
	if( authToken == null ) {
		authToken = AuthorizationFactory.getAnonymousAuthorization();
	}

      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      	///////////////////////
	// page forum variables
	
	// do not delete these
	ForumFactory forumFactory = ForumFactory.getInstance(authToken);
	User user = forumFactory.getProfileManager().getUser(authToken.getUserID());

      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      	//////////////////
	// get parameters
	
	boolean doCreate = ParamUtils.getBooleanParameter(request,"doCreate");
	String newUsername = ParamUtils.getParameter(request,"username");
	String newPassword = ParamUtils.getParameter(request,"password");
	String confirmPassword = ParamUtils.getParameter(request,"confirmPassword");
	String newEmail = ParamUtils.getParameter(request,"email");
	String newName = ParamUtils.getParameter(request,"name");
	boolean autoLogin = ParamUtils.getCheckboxParameter(request,"autoLogin");

      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      	//////////////////
	// global error vars
	
	String errorMessage = "";
	
	boolean errorUsername         = (newUsername == null);
	boolean errorPassword         = (newPassword == null);
	boolean errorConfirmPassword  = (confirmPassword == null);
	boolean errorEmail            = (newEmail == null);
	boolean errorName             = (newName == null);
	boolean errorNoMatchPasswords = true;
	if( !errorPassword && !errorConfirmPassword ) {
		errorNoMatchPasswords = !newPassword.equals(confirmPassword);
	}
	boolean errors = (errorUsername || errorPassword || errorConfirmPassword
						|| errorEmail || errorName || errorNoMatchPasswords );

      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      	//////////////////
	// error message
	if( errors ) {
		errorMessage = "您填写的资料有错误,请检查后重新输入!";
	}

      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      	//////////////////////////
	// create user, if no errors
	if( !errors ) { 
		try {
			User newUser = forumFactory.getProfileManager()
			                           .createUser(newUsername,newPassword,newEmail);
			newUser.setName( newName );
			// getting to this point means the account was created successfully.
			// We store a success message so the main page can display it.
			SkinUtils.store(request,response,"message",
				"建立账号成功 . 您已经登录,登录名为 : " + newUsername + ".");
			// set this new user's authorization token
			SkinUtils.setUserAuthorization(request,response,newUsername,newPassword,autoLogin);
			// redirect to main page
			response.sendRedirect("index.jsp");
			return;
		}
		catch( UserAlreadyExistsException uaee ) {
			errorMessage = "对不起,用户名\"" + newUsername + "\" 已经  "
				+ "存在 . 请您另选不同的用户名注册 .";
			errorUsername = true;
			errors = true;
		}
	}

      pageContext.write(_jsp_string2, 0, _jsp_string2.length);
      	//////////////////////
	// Header file include
	
	// The header file looks for the variable "title"
	String title = "Jive 论坛 : 实例层 ";

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      
/**
 *	$RCSfile: header.jsp,v $
 *	$Revision: 1.3 $
 *	$Date: 2000/12/18 02:04:56 $
 */

      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_string3, 0, _jsp_string3.length);
      pageContext.write(_jsp_string4, 0, _jsp_string4.length);
      	/////////////////////
	// header variables
	
	// change these values to customize the look of your header
	
	// Colors
	String headerBgcolor = "#000000";
	String headerFgcolor = "#ffffff";
	
	// header image vars
	String headerImgURL = "";
	String headerImgSRC = "images/jnjtzxlt.gif";
	String headerImgWidth = "140";
	String headerImgHeight = "60";
	String headerImgAltText = "Jive: 实例层";
	
	// Header text
	String headerText = "";

      pageContext.write(_jsp_string5, 0, _jsp_string5.length);
      out.print(( headerFgcolor ));
      pageContext.write(_jsp_string6, 0, _jsp_string6.length);
      out.print(( headerImgURL ));
      pageContext.write(_jsp_string7, 0, _jsp_string7.length);
      out.print(( headerImgSRC ));
      pageContext.write(_jsp_string8, 0, _jsp_string8.length);
      out.print(( headerImgWidth ));
      pageContext.write(_jsp_string9, 0, _jsp_string9.length);

⌨️ 快捷键说明

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