题目: 所属省份: 河南省北京 标签: 所属科目政治高数英语 板块: 普通高校民办高校 | |
来源: 来源URL: | |
信息发布 | |
Issue.action类 :cry:
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.all.dao.AdminDao;
import com.all.dao.TopicDao;
import com.all.entity.TopicEntity;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
public class IssueAction extends ActionSupport implements SessionAware{
/**
* 文章发表 Action
*/
private static final long serialVersionUID = -3238385317493022591L;
TopicDao td = new TopicDao();
AdminDao ad=new AdminDao();
private TopicEntity topic;
@SuppressWarnings("unchecked")
private Map session;
public TopicEntity getTopic() {
return topic;
}
public void setTopic(TopicEntity topic) {
this.topic = topic;
}
public String execute() throws Exception {
//topic.setSaid(ad.getId((String)session.get("adminName")));
//topic.setSaid(1);
System.out.print(session.get("adminName"));
if (td.insertTopic(topic) == 1) {
return Action.SUCCESS;
} else {
//System.out.println(ad.getId((String)session.get("adminName")));
return Action.ERROR;
}
}
@SuppressWarnings("unchecked")
public void setSession(Map session) {
this.session=session;
}
}
提示错误:
Action class [cn.cstp.org.action.LoginAction] not found - action - file:/E:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/test-scope/WEB-INF/classes/struts.xml:7:67
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:374)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:329)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:429)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)