毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> java技术 >> 正文

description The server encountered an internal error () that prevented it from fulfilling this request.

更新时间:2013-1-30:  来源:毕业论文

struts.xml的配置:
 <action name="NewscontentAction" class="com.news.action.NewscontentAction" >
        <result name="show">/index.jsp</result>
        <result name="error">/error.jsp</result>  
 </action>


index.jsp的代码:
<div class="column">
      <ul class="latestnews">
      <s:action name="NewscontentAction!listHotNewscontent" executeResult=“true” />
        <s:iterator value="#session.hotnewscontent" status="list">
        <li><img src="images/6.jpg" alt="" />
          <p><strong><a href="#"><s:property value="newstitle"/></a></strong><s:property value="content" /></p>
        </li>
        </s:iterator>
      </ul>
</div>


NewscontentAction.java代码:
package com.news.action;
import java.util.List;
import java.util.Map;
import com.news.dao.NewscontentDAO;
import com.news.dao.impl.NewscontentDAOImpl;
import com.news.model.Newscontent;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class NewscontentAction extends ActionSupport{
private int id;
private Newscontent newscontent;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Newscontent getNewscontent() {
return newscontent;
}
public void setNewscontent(Newscontent newscontent) {
this.newscontent = newscontent;
}
public String execute() throws Exception
{
return SUCCESS;
}
public String listHotNewscontent() throws Exception
{
String result="";
NewscontentDAO newscontentDAO=new NewscontentDAOImpl();
List list=newscontentDAO.searchNewscontent();
if(list==null)
{
result="error";
}
else
{
ActionContext act=ActionContext.getContext();
Map map=act.getSession();
map.put("hotnewscontent", list);
result="show";
}
return result;

}

}
本人想实现的效果就是访问index.jsp的同时,加载NewscontentAction中的listHotNewscontent方法,但是运行tomcat,访问http://localhost:8080/news1/index.jsp的时候,老是提示:
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:161)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:340)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
应该是<s:action>哪里用错了,求大侠指点。

<s:action name="NewscontentAction!listHotNewscontent" executeResult=“true” /> 标点符号有问题

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。