SSH2用法
JSP 页面内容
<tr>
<td>${id }</td>
<td><s:url action="querybyid" id="url">
<s:param name="noteID">${id }</s:param>
</s:url> <s:a href="%{url}">${title }</s:a></td>
<td>${content }</td>
<td><s:date name="times" format="yyyy-MM-dd HH:mm:ss" /></td>
<td>${author }</td>
<td>${type }</td>
</tr>点链接进入ACTION
package com.news.user.action;
import java.util.List;
import com.news.user.dao.NewsDao;
import com.news.user.po.News;
import com.news.user.service.NewsService;
import com.opensymphony.xwork2.ActionSupport;
public class QueryByIdAction extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = -2161673580079651325L;
private NewsService newsService;
//private NewsDao newsDao;
private News newss;
public NewsService getNewsService() {
return newsService;
}
public void setNewsService(NewsService newsService) {
this.newsService = newsService;
}
public News getNewss() {
return newss;
}
public void setNewss(News newss) {
this.newss = newss;
}
public String execute(String noteID) throws Exception{
this.setNewss(newsService.queryById(noteID));
return SUCCESS;
}
}
想通过execute方法进行查询查询,再在另一个JSP中显示出来,不晓得怎么的就是进不到ACTION中来
<action name="querybyid" class="com.news.user.action.QueryByIdAction">
<result>/queryByid.jsp</result>
</action>
<bean id="querybyidAction" class="com.news.user.action.QueryByIdAction">
<property name="newsService">
<ref bean="newsService"/>
</property>
</bean>
请问下,那里有错呀