20080415遇到的问题

今天写程序中遇到的问题主要有:

1、url 传值

eg:

  function clickName(obj) {

         // 被选中的公告的id
     var idStr = obj.parentNode.getElementsByTagName("input")[0].value;
  var str= "./HM_Temp_list.do?method=HM_Temp_edit&idStr="+idStr;
     document.forms[0].action = str;
     document.forms[0].submit();
 }

这里,str的值获得时《&idStr="+idStr;》中间不能有空格,否则后台action中得不到值。

2、menu权限

在menu.xml中添加配置信息,并往表中添加数据。

3、把用户信息封装到bean中,再下一个页面取出时 

(1)放入  

// 实例化存放session的bean
  CommonClass commonbean = new CommonClass();
  // 把数据放在bean中
  commonbean.setContentH(actionform.getContentH());
  commonbean.setContentM(actionform.getContentM());
  commonbean.setContentS(actionform.getContentS());  
  //把数据放在session中
  HttpSession session = request.getSession(); 
  session.setAttribute(Globals.First_Guide_Session, commonbean);

(2)取出:

  // 实例化存放session的bean
  CommonClass commonbean = new CommonClass();
  commonbean = (CommonClass)request.getSession().getAttribute(Globals.First_Guide_Session);
  commonbean.setTempID(str);
  // 把模板ID信息放入bean中
  request.getSession().setAttribute(Globals.First_Guide_Session, commonbean);

4、jsp中提交值

window.location 和     document.forms[0].action =“////”;     document.forms[0].submit(); 的不同是:前者提交时得不到页面中表单中提交的数据

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值