NETCTOSS02_资费管理模块

本文介绍了使用Struts2框架搭建的NETCTOSS02资费管理模块,详细讨论了如何访问数据库并显示查询结果在JSP页面上,同时应用了分页技术。在开发过程中,实体类Cost被用于数据模型,通过将JSP页面置于WEB-INF目录下增强了安全性。总结了在配置路径和理解目录结构方面的一些关键点。

NETCTOSS02_资费管理模块


结果展示:

用到的技术:

1.搭建struts2项目

2.访问数据库,查询结果显示在jsp中

3.分页技术


源代码及具体细节如下:

Cost.java  实体类

package com.qxl.netctoss.entity;

import java.sql.Timestamp;

public class Cost {
	private int costId;  //资费ID
	private String name;  //资费名称
	private double baseDuration;  //包在线时长
	private double baseCost;  //月固定费
	private double unitCost;  //单位费用
	private String status;  // 0:开通   1:暂停
	private String descr;  //资费信息说明
	private Timestamp creatime;  //创建日期
	private Timestamp startime;  //启用日期
	private String costType;  //费用类型
	
	public int getCostId() {
		return costId;
	}
	public void setCostId(int costId) {
		this.costId = costId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getBaseDuration() {
		return baseDuration;
	}
	public void setBaseDuration(double baseDuration) {
		this.baseDuration = baseDuration;
	}
	public double getBaseCost() {
		return baseCost;
	}
	public void setBaseCost(double baseCost) {
		this.baseCost = baseCost;
	}
	public double getUnitCost() {
		return unitCost;
	}
	public void setUnitCost(double unitCost) {
		this.unitCost = unitCost;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getDescr() {
		return descr;
	}
	public void setDescr(String descr) {
		this.descr = descr;
	}
	public Timestamp getCreatime() {
		return creatime;
	}
	public void setCreatime(Timestamp creatime) {
		this.creatime = creatime;
	}
	public Timestamp getStartime() {
		return startime;
	}
	public void setStartime(Timestamp startime) {
		this.startime = startime;
	}
	public String getCostType() {
		return costType;
	}
	public void setCostType(String costType) {
		this.costType = costType;
	}
	
	public String toString() {
		return "Cost [costId=" + costId + ", name=" + name + "]";
	}
	
}

ListCostAction.java  相关Action

package com.qxl.netctoss.action;

import java.util.List;

import com.qxl.netctoss.dao.CostDAO;
import com.qxl.netctoss.entity.Cost;
import com
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值