重新整合进jbpm,运行的时候发现错误:
There is no Action mapped for namespace / and action name role_list. - [unknown location]这个错误出现的很奇怪,我查看了struts.xml发现里面的配置action都是写成这样的:
//这个class是spring中的bean id
/test.jsp
action中class 都没有写包名,都只写了一个action的名字,这样肯定找不到相应的class啊,但是这样不是错的,因为我将所有的action 都交给了spring管理,也就是说在spring容器初始化的时候这些action bean就已经存在了,我将struts与spring也进行了整合(整合方式:插件包struts2-spring-plugin-x-x-x.jar):
原因是:Struts 2框架整合Spring后,处理用户请求的Action并不是Struts框架创建的,而是由Spring插件创建的。创建实例时,不是利用配置Action时指定的class属性值,根据bean的配置id属性,从Spring容器中获得相应的实例
***************************************
index主页是会跳到liginUIjsp的
********************
页面的结构是这样的:common.jspf(包含jquery**.js,pageCommon.js,pageUtils.js.menu.js和一些所有的css),
然后在每个页面中:%@ include file=="/WEB-INF/jsp/public/common.jspf">
js的常规函数(删除前的弹出确认框,全选功能等)都写在pageCommon.js中
关于页面的标题的问题: (代码中的%%请去除,新浪ZTM恶心)
问题的描述是这样的:
后台的页面index是这样儿的:
<frameset rows="100,*,25" framespacing=0 border=0 frameborder="0">
<frame noresize name="TopMenu" scrolling="no" src="${pageContext.request.contextPath}/homeAction_top.action">
<frameset cols="180,*" id="resize">
<frame noresize name="menu" scrolling="yes" src="${pageContext.request.contextPath}/homeAction_left.action">
<frame noresize name="right" scrolling="yes" src="${pageContext.request.contextPath}/homeAction_right.action">
</frameset>
<frame noresize name="status_bar" scrolling="no" src="${pageContext.request.contextPath}/homeAction_bottom.action">
</frameset>
上述标红的是左边的菜单列表:我现在想实现的效果是,比如说列表中有部门管理和菜单管理,当我点击部门管理的时候,在右frame中会显示部门管理的内容,这个时候我也想实现页面的title(就是你抬头看到的选项卡的标题)变为部门管理,这个应该怎么实现呢???在left.jsp中 <title>导航菜单</title>只能写一个啊,如何变化呢??
解决的办法是这样的,因为同时要变化的还有右边的页面内容,而且我们要变化的标题肯定也是要反映右边的内容,所以可以知道肯定是拿到右边页面中的title就可以了!!【注意右边页面初始时right.jsp中啥也没有,我们会载入新的页面放在对应right 的frame中,那么是怎么对应的呢,oa第二天讲过了,拿点击的链接的target对应frame的name】。怎么拿到右边页面的title??怎么显示成当前页面而定title???怎样做的更好??这三个问题是我们依次来解决,如果让我想的话,我肯定会去找js的方法,事实证明确实这样实现的:parent.document.title = "聚友网_hxx OA - " + document.title; 即可,,在前面加上所有页面的统一前缀,颜色对应一次解决上面的三个问题!!
$%%(function()
让主窗口的title与当前操作的(右侧的)窗口的title一致
parent.document.title = "聚友网_hxx OA - " + document.title;
在文本框中显示提示语,提示语由 showText 属性指定
$%%("input[type=text][showText]").each(function(){
this.value = $(this).attr("showText");
});
设置所有的文本框在选中时,选中文本框中的文本
$%%("input[type=text]").each(function(){;
%%this.onFocus = function() { this.select(); }; // 用这行代码不起作用!?
$%%(this).focus(function(){ // 改用jQuery实现
%%this.select();
});
});
//
});
上面标红的代码:涉及到一个知识点:
frame网页如何显示子网页标题?(因为后台的页面使用的是四个部分frame)
1、&&&parent&&&.document.title = document.title;放在子页面中可以实现。
2、&&&document&&&.title = document.getElementById_x('iframe1').contentWindow.document.title;放在父页面上可以实现。
<&&&script type="text/javascript"> &&document.title = document.getElementById_x('urldns').contentWindow.document.title; 1. 这段放到下面 2. 最好设置延时setTimeout函数,因为载入子页面需要点时间 3. 最最好的办法是子页面里放函数,这样能确保子页面载入完后修改title 4. 注意子页面和页面都要在同一个域里。不同的域没有权限。 |