系统采用Struts2框架进行开发。先来看看Struts2框架是如何配置到应用程序中的。
在WEB-INF/web.xml文件的配置代码如下:
< <bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest"
name="myRequestParser" class="com.daowen.util.RequestParseWrapper"
scope="default" optional="true" />
<package name="admin" extends="struts-default" namespace="/admin">
<action name="usersmanager" class="com.daowen.action.UsersAction">
</action>
<action name="friendlinkmanager" class="com.daowen.action.FriendlinkAction">
</action>
<action name="jiaodiantumanager" class="com.daowen.action.JiaodiantuAction">
</action>
</action>
<action name="sysconfigmanager" class="com.daowen.action.SysconfigAction">
</action>
5.2登录功能的实现
图5-1 登录信息
public class LoginAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
try {
response.setContentType("application/x-www-form-urlencoded; charset=UTF-8");
List userlist=null;
Session s=HibernateSessionFactory.getSession();
Transaction t=s.beginTransaction();
String username=request.getParameter("username");
String password=request.getParameter("password");
String action=request.getParameter("action");
System.out.println("action="+action+"username="+username+"password="+password);
SQLQuery query=s.createSQLQuery("select * from [users] where username='"+username+"'");
userlist=query.list();
String s1="";
if(!userlist.isEmpty())
s1="res=true";
else
s1="res=false";
System.out.println("json="+s1);
response.getWriter().write(s1);
}
5.3注册功能的实现
图5-3 注册功能
<script src="<%=SystemParam.getSiteRoot()%>/webui/jquery/jquery-1.5.2.min.js"
type="text/javascript"></script>
<script type="text/javascript" src="<%=SystemParam.getSiteRoot() %>/webui/jquery/jquery.validate.min.js"></script>
<script type="text/javascript" src="<%=SystemParam.getSiteRoot() %>/webui/jquery/jquery.metadata.js" ></script>
<script type="text/javascript" src="<%=SystemParam.getSiteRoot() %>/webui/jquery/messages_cn.js" ></script>
<script type="text/javascript">
$(function(){
$.metadata.setType("attr","validate");
$("#form1").validate();
})
5.4商品管理功能的实现
图5-4 商品管理模块
<tr>
<td align="right">商品编号:</td>
<td><input name="spno"
validate="{required:true,messages:{required:'请输入商品编号'}}"
value="${requestScope.shangpin.spno}" class="input-txt" type="text"
id="spno" />
</td>
</tr>
<tr>
<td align="right">商品类别:</td>
<td><input type="hidden" name="sptype" /> <input type="hidden"
name="sptypeid" /> <web:dropdownlist id="sptype" cssclass="dropdown"
value="${requestScope.shangpin.sptypeid}"
datasource="${sptype_datasource}" textfieldname="mingcheng"
valuefieldname="id">
</web:dropdownlist></td>
</tr>
</div>
5.5订单管理模块的实现
订单管理模块主要实现管理员对进行中的订单、历史订单信息的查询,进行退款、拒绝、介绍并发货等操作。订单管理模块如图6-2所示。
图5-5 订单管理模块
<link href="<%=SystemParam.getSiteRoot() %>/webui/treetable/skin/jquery.treetable.theme.default.css" rel="stylesheet"
type="text/css" />
<script src="<%=SystemParam.getSiteRoot() %>/webui/treetable/js/jquery.treetable.js" type="text/javascript"></script>
<script src="<%=SystemParam.getSiteRoot() %>/webui/combo/combo.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$(".ui-record-table").recordTable();
$("#btnDelete").click(function(){
if($(".check:checked").length<1)
{
$.dialog.alert("请选择需要删除的记录");
return;
}
5.6会员管理模块的实现
图5-6 会员管理模块
<head>
<title>会员信息</title>
<link href="<%=SystemParam.getSiteRoot()%>/admin/css/common.css"
rel="stylesheet" type="text/css" />
<link href="<%=SystemParam.getSiteRoot()%>/admin/css/web2table.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript"
src="<%=SystemParam.getSiteRoot()%>/webui/jquery/jquery-1.9.0.js"></script>
<link
href="<%=SystemParam.getSiteRoot()%>/webui/artDialog/skins/default.css"
rel="stylesheet" type="text/css" />
<script
src="<%=SystemParam.getSiteRoot()%>/webui/artDialog/jquery.artDialog.source.js"
type="text/javascript"></script>
<script
src="<%=SystemParam.getSiteRoot()%>/webui/artDialog/iframeTools.source.js"
type="text/javascript"></script>
标签:jquery,javascript,管理系统,text,宠物,js,webui,type From: https://www.cnblogs.com/mao4399/p/17016438.html