今天写程序中遇到的问题主要有:
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(); 的不同是:前者提交时得不到页面中表单中提交的数据