📄 userform_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
import ws.woa.core.*;
import ws.woa.util.*;
public class UserForm_jsp extends HttpJspBase {
private static java.util.Vector _jspx_includes;
public java.util.List getIncludes() {
return _jspx_includes;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
javax.servlet.jsp.PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=Shift_JIS");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
/**
* WOA User Management, Add/Modify Form
*/
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
ws.woa.core.UserInfo user = null;
synchronized (request) {
user = (ws.woa.core.UserInfo) pageContext.getAttribute("user", PageContext.REQUEST_SCOPE);
if (user == null){
try {
user = (ws.woa.core.UserInfo) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "ws.woa.core.UserInfo");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException("Cannot create bean of class " + "ws.woa.core.UserInfo", exc);
}
pageContext.setAttribute("user", user, PageContext.REQUEST_SCOPE);
}
}
out.write("\r\n");
ws.woa.core.GroupInfo[] groups = null;
synchronized (request) {
groups = (ws.woa.core.GroupInfo[]) pageContext.getAttribute("groups", PageContext.REQUEST_SCOPE);
if (groups == null){
try {
groups = (ws.woa.core.GroupInfo[]) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "ws.woa.core.GroupInfo[]");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException("Cannot create bean of class " + "ws.woa.core.GroupInfo[]", exc);
}
pageContext.setAttribute("groups", groups, PageContext.REQUEST_SCOPE);
}
}
out.write("\r\n\r\n");
out.write("<SCRIPT LANGUAGE=\"JavaScript\">\r\nfunction submit_check(){\r\n if(!checkNotEmpty('Account',document.UserForm.Account) ||\r\n !checkBytes('Account',document.UserForm.Account,20)||\r\n !checkNotEmpty('Password',document.UserForm.Password)||\r\n !checkBytes('Password',document.UserForm.Password,20)||\r\n !checkNotEmpty('Name',document.UserForm.Name)||\r\n !checkBytes('Name',document.UserForm.Name,100)||\r\n !checkBytes('Email',document.UserForm.Mail,100)||\r\n !checkBytes('Tel',document.UserForm.Tel,20)||\r\n !checkBytes('Address',document.UserForm.Address,200)){\r\n return false;\r\n } else {\r\n ");
if(request.getParameter("INSERT_FORM")!=null){
out.write("\r\n return confirm('Add new?');\r\n ");
} else {
out.write("\r\n return confirm('Modify?');\r\n ");
}
out.write("\r\n }\r\n}\r\n");
out.write("</SCRIPT>\r\n\r\n");
out.write("<h2>ユーザ管理");
out.write("</h2>\r\n\r\n");
out.write("<FORM ACTION=\"user.module\" METHOD=\"POST\" NAME=\"UserForm\" ONSUBMIT=\"return submit_check();\">\r\n");
out.write("<TABLE>\r\n");
out.write("<TR>\r\n ");
out.write("<TH>Account");
out.write("</TH>\r\n ");
out.write("<TD>\r\n ");
out.write("<INPUT TYPE=\"TEXT\" NAME=\"Account\" VALUE=\"");
out.print( StrUtil.tagFilter(user.getAccount()) );
out.write("\">\r\n ");
out.write("</TD>\r\n");
out.write("</TR>\r\n");
out.write("<TR>\r\n ");
out.write("<TH>Password");
out.write("</TH>\r\n ");
out.write("<TD>\r\n ");
out.write("<INPUT TYPE=\"PASSWORD\" NAME=\"Password\" SIZE=\"20\"\r\n VALUE=\"");
out.print( StrUtil.tagFilter(user.getPassword()) );
out.write("\">\r\n ");
out.write("</TD>\r\n");
out.write("</TR>\r\n");
out.write("<TR>\r\n ");
out.write("<TH>Group");
out.write("</TH>\r\n ");
out.write("<TD>\r\n ");
out.write("<SELECT NAME=\"GroupID\">\r\n ");
for(int i=0;i<groups.length;i++){
out.write("\r\n ");
if(groups[i].getUseFlag()){
out.write("\r\n ");
out.write("<OPTION VALUE=\"");
out.print( groups[i].getGroupID() );
out.write("\"");
if(user.getGroupID()==groups[i].getGroupID()){
out.write(" SELECTED");
}
out.write(">");
out.print( StrUtil.tagFilter(groups[i].getGroupName()) );
out.write("\r\n ");
}
out.write("\r\n ");
}
out.write("\r\n ");
out.write("</SELECT>\r\n ");
out.write("</TD>\r\n");
out.write("</TR>\r\n");
out.write("<TR>\r\n ");
out.write("<TH>Name");
out.write("</TH>\r\n ");
out.write("<TD>\r\n ");
out.write("<INPUT TYPE=\"TEXT\" NAME=\"Name\" VALUE=\"");
out.print( StrUtil.tagFilter(user.getName()) );
out.write("\" />\r\n ");
out.write("</TD>\r\n");
out.write("</TR>\r\n");
out.write("<TR>\r\n ");
out.write("<TH>Email");
out.write("</TH>\r\n ");
out.write("<TD>\r\n ");
out.write("<INPUT TYPE=\"TEXT\" NAME=\"Mail\" SIZE=\"40\" VALUE=\"");
out.print(StrUtil.formFilter(user.getMail()));
out.write("\">\r\n ");
out.write("</TD>\r\n");
out.write("</TR>\r\n");
out.write("<TR>\r\n ");
out.write("<TH>Tel");
out.write("</TH>\r\n ");
out.write("<TD>\r\n ");
out.write("<INPUT TYPE=\"TEXT\" NAME=\"Tel\" SIZE=\"20\" VALUE=\"");
out.print(StrUtil.formFilter(user.getTel()));
out.write("\">\r\n ");
out.write("</TD>\r\n");
out.write("</TR>\r\n");
out.write("<TR>\r\n ");
out.write("<TH>Address");
out.write("</TH>\r\n ");
out.write("<TD>\r\n ");
out.write("<INPUT TYPE=\"TEXT\" NAME=\"Address\" SIZE=\"60\" VALUE=\"");
out.print(StrUtil.formFilter(user.getAddress()));
out.write("\">\r\n ");
out.write("</TD>\r\n");
out.write("</TR>\r\n");
out.write("<TR>\r\n ");
out.write("<TH>UseFlag");
out.write("</TH>\r\n ");
out.write("<TD>\r\n ");
out.write("<SELECT NAME=\"UseFlag\">\r\n ");
out.write("<OPTION VALUE=\"1\"");
if(user.getUseFlag()){
out.write(" SELECTED");
}
out.write(">Usable\r\n ");
out.write("<OPTION VALUE=\"0\"");
if(!user.getUseFlag()){
out.write(" SELECTED");
}
out.write(">Unusable\r\n ");
out.write("</SELECT>\r\n ");
out.write("</TD>\r\n");
out.write("</TR>\r\n");
out.write("</TABLE>\r\n\r\n\r\n");
out.write("<BR>\r\n");
if(request.getParameter("INSERT_FORM")!=null){
out.write("\r\n ");
out.write("<INPUT TYPE=\"SUBMIT\" NAME=\"INSERT_EXEC\" VALUE=\"Add New\">\r\n");
} else {
out.write("\r\n ");
out.write("<INPUT TYPE=\"SUBMIT\" NAME=\"UPDATE_EXEC\" VALUE=\"Modify\">\r\n ");
out.write("<INPUT TYPE=\"HIDDEN\" NAME=\"UserID\" VALUE=\"");
out.print( user.getUserID() );
out.write("\">\r\n");
}
out.write("\r\n");
out.write("<INPUT TYPE=\"RESET\" VALUE=\"Reset\">\r\n");
out.write("<INPUT TYPE=\"BUTTON\" VALUE=\"Go Back\" onClick=\"javascript:history.back();\">\r\n");
out.write("</FORM>\r\n");
} catch (Throwable t) {
out = _jspx_out;
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 + -