qq_34403667 2016-04-14 03:37 采纳率: 0%
浏览 1263

第一次搭建strust2 不成功

用的mye 10内置的strust2包
代码如下
package action;

import com.opensymphony.xwork2.ActionSupport;

public class hiAction extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;

@Override
public String execute() throws Exception {
    // TODO Auto-generated method stub
    System.out.println("调用");
    return "success";
}

}

配置文件如下
<?xml version="1.0" encoding="UTF-8"?>
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">


index.jsp


struts2

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter



struts2
/*

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">





/index.jsp



  • 写回答

2条回答

  • AAArlex 2016-04-14 03:55
    关注

    你看看你的web.xml里面有没有有配置struts2的拦截器,还有,你的struts配置文件是需要设置一个




    这样的东西的

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog