开发者社区> 问答> 正文

struts不跳转的问题?报错

我用ssh做了个项目,整合ssh测试的时候,struts出了点问题,action不能成功跳转,也不报错,就显示空白页。

代码如下

入口代码:

<body>

    <a

  </body>

action代码

public class TestAction extends Action {

public ActionForward test(ActionMapping mapping, ActionForm form,

HttpServletRequest request, HttpServletResponse response) {

// TODO Auto-generated method stub

return mapping.findForward("show");

}

}

跳转页面:

 <body>

    <h1>信息</h1>

  </body>

代码应该没有什么错误,配置也没什么问题,就是不跳转 求大神指导。。



配置

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd">


<struts-config>

  <form-beans />

  <global-exceptions />

  <global-forwards />

  <action-mappings >

    <action

      input="/WEB-INF/test.jsp"

      parameter="flag"

      path="/test"

      type="com.test.struts.action.TestAction"

      cancellable="true" >

      <forward name="show" path="/WEB-INF/for.jsp" />

    </action>



  </action-mappings>


  <message-resources parameter="com.test.struts.ApplicationResources" />

</struts-config>


展开
收起
爱吃鱼的程序员 2020-06-22 11:13:43 471 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    action的配置呢?

    后面加了,看下之所以action能执行跳转,是因为web.xml中配置了过滤器,将*.do的请求交给struts处理。所以相关配置需要进一步检查,不能在不全面检查的情况下就着急。
    2020-06-22 11:14:01
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关课程

更多

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载