配置文件
<package name="notice" extends="default" namespace="/content/notice">
<action name="notice_*" class="action.notice.NoticeAction" method="{1}">
<result name="success" type="dispatcher">/content/notice/addnotice.jsp</result>
<result name="search" type="dispatcher">/content/notice/ListNotice.jsp</result>
<result name="input" type="dispatcher">/content/notice/ListNotice.jsp</result>
</action>
-------------------------action-----------------------------public String getNoticeList() {
String ret = ERROR_JSON;
String noticeType = this.getSingleValParam("noticeType");
if (noticeType != null && !("").equals(noticeType)) {
if (this.session.get("currentLoginUser") != null) {
Login l = (Login) this.session.get("currentLoginUser");
if (("drafts").equals(noticeType)) {
notice.setNoticeSender(l.getLoginId());
notice.setNoticeState(2);
} else if (("receive").equals(noticeType)) {
notice.setNoticeReceiver(l.getLoginId() + "");
notice.setNoticeState(0);
} else if (("send").equals(noticeType)) {
notice.setNoticeSender(l.getLoginId());
notice.setNoticeState(0);
}
// 搜索
if (flag != null && flag.equals("search")) {
notices = noticeBiz.getNoticeList(currentPage, pageSize,
noticeSmallTime, noticeBigTime, notice, orderParam);
} else {
notices = noticeBiz.getNoticeList(currentPage, pageSize,
noticeSmallTime, noticeBigTime, notice, orderParam);
}
int allCount = noticeBiz.getCount(noticeSmallTime,
noticeBigTime, notice);
PageAjax pageAjax = new PageAjax(currentPage, pageSize,
allCount, notices);
this.setJSONResponseData(pageAjax);
ret = SUCCESS_JSON;
} else {
this.setJSONResponseMsg("登录信息异常!");
ret = ERROR_JSON;
}
}
return ret;
}SUCCESS_JSON=“success_json”是这个值
<package name="notice" extends="default" namespace="/content/notice">
<action name="notice_*" class="action.notice.NoticeAction" method="{1}">
<result name="success" type="dispatcher">/content/notice/addnotice.jsp</result>
<result name="search" type="dispatcher">/content/notice/ListNotice.jsp</result>
<result name="input" type="dispatcher">/content/notice/ListNotice.jsp</result>
</action>
-------------------------action-----------------------------public String getNoticeList() {
String ret = ERROR_JSON;
String noticeType = this.getSingleValParam("noticeType");
if (noticeType != null && !("").equals(noticeType)) {
if (this.session.get("currentLoginUser") != null) {
Login l = (Login) this.session.get("currentLoginUser");
if (("drafts").equals(noticeType)) {
notice.setNoticeSender(l.getLoginId());
notice.setNoticeState(2);
} else if (("receive").equals(noticeType)) {
notice.setNoticeReceiver(l.getLoginId() + "");
notice.setNoticeState(0);
} else if (("send").equals(noticeType)) {
notice.setNoticeSender(l.getLoginId());
notice.setNoticeState(0);
}
// 搜索
if (flag != null && flag.equals("search")) {
notices = noticeBiz.getNoticeList(currentPage, pageSize,
noticeSmallTime, noticeBigTime, notice, orderParam);
} else {
notices = noticeBiz.getNoticeList(currentPage, pageSize,
noticeSmallTime, noticeBigTime, notice, orderParam);
}
int allCount = noticeBiz.getCount(noticeSmallTime,
noticeBigTime, notice);
PageAjax pageAjax = new PageAjax(currentPage, pageSize,
allCount, notices);
this.setJSONResponseData(pageAjax);
ret = SUCCESS_JSON;
} else {
this.setJSONResponseMsg("登录信息异常!");
ret = ERROR_JSON;
}
}
return ret;
}SUCCESS_JSON=“success_json”是这个值
解决方案 »
- 为什么课本的代码会出错呢
- 大神们在线等待啊,万分火急,帮帮忙
- 小妹问个用jdbc创建oracle表空间的问题,请帮忙看看吧!
- 请问Quartz中如何获取Quartz的数据连接!
- jsf缓存问题,请高人指点;
- axis是什么东西?
- 想加入几个SSH框架讨论的群,向各位请教一下JAVAEE的知识,麻烦觉得自己加入的群不错的朋友推荐下!
- struts的html:link标签中,如何访问jsp页面中text输入框的内容。
- struts中的<html:textarea>标签用法??
- 不知道有人问过了没有?jb9自带的tomcat的连接池配置??
- websphere6.0 struts1部署异常 但是tomcate和websphere5.1正常
- struts1迭代
检查自身action中是否有匹配的result,如果有则执行这个result,如果没有则执行下一步
检查所在的包中的全局result,有匹配的则执行,没有则下一步
递归查找自己所在包的父包中的全局result,如有匹配则执行,如果还没有struts就会抛出异常。
if (data.msg == "success") {
var currentPage = data.data.currentPage;
var allCount = data.data.allCount;
var pageSize = data.data.pageSize;
var result = '<table id="noticeList" width="700" border="1" bordercolor="#2E9AFE" style="border-collapse: collapse">' +
'<tr align="center" height="40px" class="list_title" >' +
'<td width="70" class="logid"><b>序号</b></td>' +
'<td width="100" class="logtitle"><b>标题</b></td>' +
'<td width="100" class="logtitle"><b>级别</b></td>' +
'<td width="100" class="logtime"><b>时间</b></td>' +
'<td width="100" class="noborder"><b>其他</b></td>' +
'</tr>';