dictionary_provinceadd.jsp
来自「java开发的办公系统 1.系统管理 (地区管理,部门管理,菜单管理,用户管理」· JSP 代码 · 共 162 行
JSP
162 行
<%@ include file="../../include/configuration.jsp"%><%@ include file="../../include/authorizemanager.jsp"%><%@ page import="com.vere.dictionary.bean.*"%><%@ page import="com.vere.dictionary.item.*"%><%@ page import="com.vere.dictionary.xml.*"%><%@ page contentType="text/html; charset=gb2312" %><% SessionFactory sessionFactory=(SessionFactory)session.getAttribute("sessionFactory"); ParameterUtils.setCharacterEncoding(request); String status=ParameterUtils.getString(request,"status"); String message=""; //添加 if(status.equals("add")) { message=ParameterUtils.getString(request,"message"); String province_cn_name=ParameterUtils.getString(request,"province_cn_name");//省份/大洲中文名称 String province_en_name=ParameterUtils.getString(request,"province_en_name");//省份/大洲英文名称 String country_id=ParameterUtils.getString(request,"country_id");//国家 if(province_cn_name==null||province_cn_name.equals("")){ out.print("province_cn_name 省份/大洲中文名称不能为空"); return; } if(province_en_name==null||province_en_name.equals("")){ out.print("province_en_name 省份/大洲英文名称不能为空"); return; } if(country_id==null||country_id.equals("")){ out.print("country_id 国家不能为空"); return; } Dictionary_provinceItem item=new Dictionary_provinceItem(); item.setProvince_cn_name(province_cn_name); item.setProvince_en_name(province_en_name); item.setCountry_id(country_id); Dictionary_provinceBean bean=new Dictionary_provinceBean(); int keyId=bean.addItemAndMaxId(item); if(keyId>0) { item.setId(Integer.toString(keyId)); Dictionary_provinceXmlBean xmlBean=new Dictionary_provinceXmlBean(); xmlBean.addXmlItem(item); } }%><html><head><title><%=titleName%></title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><link href="../../css/css.css" rel="stylesheet" type="text/css"><script language="javascript" src="../../js/check.js"></script><link href="../../css/date.css" rel="stylesheet" type="text/css"><script src="../../js/ShowDate.js"></script><script language="javascript"> init();</script></head><script language="javascript"> function back() { location="dictionary_province.jsp"; } function Check() { var form=form1; if(form.province_cn_name.value=="") { alert("请输入省份/大洲中文名称!"); form.province_cn_name.focus(); return; } if(form.province_en_name.value=="") { alert("请输入省份/大洲英文名称!"); form.province_en_name.focus(); return; } if(form.country_id.value=="") { alert("请输入国家!"); form.country_id.focus(); return; } form.status.value="add"; form.message.value=1; form.submit(); }</script><body><form action="" method="post" name="form1" > <table class="firsttable"> <tr> <td align="center" valign="top"> <table class="centertable"> <tr> <td></td> </tr> <tr> <td align="center" class="addborder"> <table class="addTable"> <tr align="center" > <td colspan="2"> <font class="message"> <% if(message.equals("1")) { out.println("添加成功:继续"); } %> </font> </td> </tr> <tr > <td >省份/大洲中文名称:</td> <td ><input name="province_cn_name" type="text" id="province_cn_name" value="" ></td> </tr> <tr > <td >省份/大洲英文名称:</td> <td ><input name="province_en_name" type="text" id="province_en_name" value="" ></td> </tr> <tr > <td >国家:</td> <td > <select name="country_id" id="country_id"> <% Dictionary_countryXmlBean dictionary_countryXmlBean=new Dictionary_countryXmlBean(); List dictionary_countryXmlList=dictionary_countryXmlBean.findXml(); Iterator dictionary_countryXmlE=dictionary_countryXmlList.iterator(); while(dictionary_countryXmlE.hasNext()){ Dictionary_countryItem dictionary_countryItem=(Dictionary_countryItem)dictionary_countryXmlE.next(); if(ParameterUtils.getString(request,"country_id").equals(dictionary_countryItem.getId())) out.println("<option value='"+dictionary_countryItem.getId()+"' selected>"+dictionary_countryItem.getCountry_cn_name()+"</option>"); else out.println("<option value='"+dictionary_countryItem.getId()+"' >"+dictionary_countryItem.getCountry_cn_name()+"</option>"); } %> </select> </td> </tr> <tr > <td colspan="2" align="center"> <input name="Button" type="button" class="button" onClick="Check()" value="确定"> <input name="Submit2" type="button" class="button" onClick="back()" value="返回"> </td> </tr> </table> </td> </tr> <tr> <td></td> </tr> </table> </td> </tr> </table><input type="hidden" name="status" ><input type="hidden" name="message" ></form></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?