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

📄 index1_jsp.java

📁 原创, svn用户管理工具. svn是现在非常流行的源代码管理工具,但由于没有管理工具,加权限修改密码等只能修改svn的配置文件. 本WEB工具可以很好的解决这个问题,管理员账号(仓库名+admin)
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.yoyorock.Util.*;
import com.yoyorock.svnadmin.*;
import java.util.*;

public final class index1_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  static {
    _jspx_dependants = new java.util.Vector(1);
    _jspx_dependants.add("/define.jsp");
  }

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=GBK");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n\r\n\r\n");
      out.write('\r');
      out.write('\n');

  response.setHeader("Cache-Control", "no-store");
  response.setHeader("Pragma", "no-cache");
  response.setDateHeader("Expires",0);
  request.setCharacterEncoding("GBK");

  final String RESPOSITORY_ROOT = "C:/test";

      out.write('\r');
      out.write('\n');
      out.write("\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />\r\n<title>SVNADMIN,登录</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody {\r\n\tmargin-left: 0px;\r\n\tmargin-top: 0px;\r\n\tmargin-right: 0px;\r\n\tmargin-bottom: 0px;\r\n}\r\nbody,td,th {\r\n\tfont-size: 14px;\r\n}\r\n-->\r\n</style></head>\r\n\r\n<body>\r\n");


  String strLogined;
  String strUsername;
  String strUserpwd;
  String strRepository;
  String strCheckCode;
  String strSessionCheckCode;
  String strMessage = "";
  RightControl rightCtrl;
  boolean bIsAllBlank = false;

  try
  {
    rightCtrl = new RightControl();
    session.setMaxInactiveInterval(3 * 60);
    strLogined = (String)session.getAttribute("strLogined");
    if (null == strLogined)
      strLogined = "no";
    strSessionCheckCode = (String)session.getAttribute("CheckCode");
    if (null == strSessionCheckCode)
      strSessionCheckCode = "";
    strUsername = request.getParameter("uname");
    strUserpwd = request.getParameter("upwd");
    strRepository = request.getParameter("repos");
    strCheckCode = request.getParameter("checkcode");
    if (null == strUsername && null == strUserpwd
        && null == strRepository && null == strCheckCode)
    {
	bIsAllBlank = true;
    }
    if (null == strUsername)
      strUsername = "";
    if (null == strUserpwd)
      strUserpwd = "";
    if (null == strRepository)
      strRepository = "";
    if (null == strCheckCode)
      strCheckCode = "";

    //所有用户名都转成小写保存
    strUsername = strUsername.toLowerCase();

    if (strLogined.equals("yes"))
    {//已登录
	response.sendRedirect(response.encodeRedirectURL("listpath.jsp"));
	return;
    }

    //未登录
    if (!bIsAllBlank)
    {
	strRepository = strRepository.trim();
	if (!strSessionCheckCode.equals(strCheckCode))
	{
	    strMessage = "验证码不符,请重新输入";
	}
	else if (strRepository.length() > 0)
	{
	    rightCtrl.syncFromFiles(RESPOSITORY_ROOT, strRepository);
	    if (!rightCtrl.ExistsRepository(RESPOSITORY_ROOT, strRepository))
	    {
		strMessage = "仓库名["+strRepository+"]不存在,请重新输入";
	    }
	    else if (!rightCtrl.CheckPassword(strUsername, strUserpwd))
	    {
		strMessage = "账号或密码错误,请重新输入";
	    }
	    else
	    {
		session.setAttribute("strUsername", strUsername);
		session.setAttribute("strLogined", "yes");
		session.setAttribute("strRepository", strRepository);
		session.setAttribute("rightCtrl", rightCtrl);
		response.sendRedirect(response.encodeRedirectURL("listpath.jsp"));
		return;
	    }
	}
    }


      out.write("\r\n\r\n<table width=\"100%\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\" bgcolor=\"#6699FF\">\r\n  <tr>\r\n    <td bgcolor=\"#99CCFF\"><strong>SVN 权 限 管 理</strong></td>\r\n  </tr>\r\n</table>\r\n<br />\r\n<form action=\"index.jsp\" method=\"POST\">\r\n<table width=\"50%\" border=\"0\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" bgcolor=\"#6699FF\">\r\n  <tr>\r\n    <td align=\"center\" bgcolor=\"#99CCFF\"><strong>用 户 登 录</strong></td>\r\n  </tr>\r\n  <tr>\r\n    <td bgcolor=\"#FFFFFF\"><table width=\"100%\" border=\"0\">\r\n      <tr>\r\n        <td width=\"40%\" align=\"right\">仓 库</td>\r\n        <td width=\"20%\"><label>\r\n          <input type=\"text\" name=\"repos\"  size=\"20\" />\r\n        </label></td><td width=\"40%\"></td>\r\n      </tr>\r\n      <tr>\r\n        <td align=\"right\">用户名</td>\r\n        <td><input type=\"text\" name=\"uname\" size=\"20\" value=\"");
      out.print(strUsername);
      out.write("\"/></td><td></td>\r\n      </tr>\r\n      <tr>\r\n        <td align=\"right\">密 码</td>\r\n        <td><input type=\"password\" name=\"upwd\" size=\"21\" value=\"\"/></td><td></td>\r\n      </tr>\r\n      <tr>\r\n        <td align=\"right\">校验码</td>\r\n        <td ><input type=\"text\" name=\"checkcode\" size=\"20\" onkeypress=\"if( window.event.keyCode==13) submit();\"></td>\r\n<td align=\"left\" ><img alt=\"checkcode\" src=\"VoteImage\"></td>\r\n      </tr>\r\n    </table>\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td align=\"center\" bgcolor=\"#FFFFFF\"><input type=\"submit\" name=\"Submit\" value=\"登录\" />\r\n     \r\n    <input type=\"reset\" name=\"Submit2\" value=\"重填\" /></td>\r\n  </tr>\r\n  ");

 if (strMessage.length()> 0)
 {
    out.write("<tr><td align=\"center\" bgcolor=\"#FFFFFF\">"+strMessage+"</td></tr>");
 }
  
      out.write("\r\n</table>\r\n</form>\r\n");

  }
  catch (Exception e)
  {
      out.write("<B>Exception:"+e.getMessage()+"</B><br>\r\n");
  }

      out.write("\r\n</body>\r\n</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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