易截截图软件、单文件、免安装、纯绿色、仅160KB

JSP页面处理数值的问题

问题描述:
    用户登陆,我把扣量discount传到该用户要显示的页面了,
    如 url=xxx.jsp?userId= <%=userId%>&discount= <%=discount%>,输入查询条件进行JDBC查询(这里面是按没有扣量的进行处理的)。一点“查询”后,页面做了刷新,discount为null了。
    扣量后的值我写了一个通用的方法:扣量后的值用下面的函数处理
  discountValue(String oldNum,String discount,String validateDate) //validateDate 有效期  discount扣量 如20%
这个函数是没有问题的。
  //数据的四舍五入  float-->int  validate 有效期
public static int discountValue(String oldNum,String discount,String validate) 

    if(discount==null)
    discount="0.0f";
    if(validate==null)
    validate="";
   
    //validate与当前时间比较  大于当前时间才做处理,否则 按oldNum处理
    int todayDateValue=Integer.parseInt(getCurrentDate().replaceAll("-", ""));
    int validateValue=0;
    float num=0.0f;
    if(!validate.equals(null) && validate.length()>0)
    {
    validateValue=Integer.parseInt(validate.replaceAll("-", ""));
    }
   
  &nbs


相关问答:

在jsp中用session怎么实现购买功能 - Java / Web 开发

我想做够购物车用session 但是不知道怎么获取购买数量 谁有具体的代码吗 希望能割舍

下面是购物车的核心代码 
有了这个 就应该能够做出来吧
Java code:

public void doPost(HttpServletRequest reque ......

js在jsp中不能调用问题。

我的程序如下:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv=&q ......

jsp中显示菜单(递归)

问题描述:

    例如我要显示的内容如下所示

一级目录1
    一级目录1子类1
        子类1
    一级目录1子类2
      ......

jsp中include.inc的作用是什么? - Java / Web 开发

jsp中include.inc的作用是什么?

include.inc啥意思?没听说过

Java code:
<%include file="include.inc"%>加载网站目录include.inc文件内容

包含一个静态页面吧···

& ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号