📄 index2ejsp.java
字号:
import hell.userdetail;
import ejb.*;
import javax.ejb.*;
import java.math.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.rmi.RemoteException;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class index2ejsp extends HttpJspBase {
// begin [file="/index.jsp";from=(3,3);to=(23,0)]
private Login login = null;
public void jspInit() {
try {
InitialContext ic = new InitialContext();
Object objRef = ic.lookup("Login");
LoginHome home = (LoginHome)PortableRemoteObject.narrow(objRef, LoginHome.class);
login = home.create();
} catch (RemoteException ex) {
System.out.println("Couldn't create Login bean."+ ex.getMessage());
} catch (CreateException ex) {
System.out.println("Couldn't create Login bean."+ ex.getMessage());
} catch (NamingException ex) {
System.out.println("Unable to lookup home: "+ "Login "+ ex.getMessage());
}
}
public void jspDestroy() {
login = null;
}
// end
static {
}
public index2ejsp( ) {
}
private static boolean _jspx_inited = false;
public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
}
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;
String _value = null;
try {
if (_jspx_inited == false) {
synchronized (this) {
if (_jspx_inited == false) {
_jspx_init();
_jspx_inited = true;
}
}
}
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/index.jsp";from=(0,141);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/index.jsp";from=(1,48);to=(3,0)]
out.write("\r\n\r\n");
// end
// HTML // begin [file="/index.jsp";from=(23,2);to=(90,8)]
out.write("\r\n<html>\r\n<head>\r\n <title>欢迎光临</title>\r\n <style type=\"text/css\">\r\n<!--\r\nbody {\r\n\tmargin-top: 0px;\r\n}\r\n.style5 {font-family: \"????\"; font-size: 18px; }\r\na:link {\r\n\ttext-decoration: none;\r\n\tfont-family: \"????\";\r\n\tcolor: #FF6600;\r\n}\r\na:visited {\r\n\ttext-decoration: none;\r\n}\r\na:hover {\r\n\ttext-decoration: underline;\r\n}\r\na:active {\r\n\ttext-decoration: none;\r\n}\r\n.style6 {font-family: monospace, sans-serif, \"????\", \"????\"}\r\n.STYLE7 {font-family: \"????\"; font-size: 18px; font-weight: bold; }\r\n-->\r\n </style>\r\n<Script Language=\"JavaScript\">\r\n<!--\r\nfunction check(){\r\n if(document.login.userid.value==\"\")\r\n { alert(\"用户不能为空!\")\r\n return;}\r\n if(document.login.password.value==\"\")\r\n { alert(\"密码不能为空!\")\r\n return;\r\n }\r\n document.login.submit();\r\n}\r\n\r\nfunction MM_callJS(jsStr) { //v2.0\r\n return eval(jsStr)\r\n}\r\n//-->\r\n</Script>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head>\r\n<body bgcolor=\"white\" onLoad=\"MM_callJS('Today.getday()')\">\r\n<h1><b><center>\r\n</center></b></h1>\r\n<div align=\"center\"></div>\r\n<td width=\"248\" ><div align=\"center\">欢迎光临网上商城!</div></td>\r\n<hr>\r\n<table width=\"936\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#CCCCCC\">\r\n</table>\r\n<form name=\"login\" method=\"post\" >\r\n <p align=\"left\">用户:\r\n <input type=\"text\" name=\"userid\" size=\"15\">\r\n <span class=\"style1\"></span> </p>\r\n <p align=\"left\">密码:\r\n <input type=\"password\" name=\"password\" size=\"15\">\r\n </p>\r\n <p align=\"left\">\r\n <input name=\"submit\" type=\"submit\" onClick=\"check()\" value=\"登陆\">\r\n <input name=\"reset\" type=\"reset\" value=\"重填\">\r\n </form>\r\n <div align=\"left\">\r\n ");
// end
// begin [file="/index.jsp";from=(90,10);to=(111,0)]
String userid = request.getParameter("userid");
String password = request.getParameter("password");
session.setAttribute("userId",userid);
if ( userid != null && userid.length() > 0 && password != null && password.length() > 0) {
try{
userdetail a =null;
a = login.checkpassword( userid , password );
if (a==null){
response.sendRedirect("check.jsp");
}
else{
response.sendRedirect("booklist.jsp");
}
} catch (Exception ee){
System.out.println(ee.toString());
}
}
// end
// HTML // begin [file="/index.jsp";from=(111,2);to=(116,0)]
out.write("\r\n </div>\r\n<p> </p>\r\n</body>\r\n</html>\r\n");
// end
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -