struts2  里copy出来的struts.xml 贴在项目的src里
<result type="redirectAction">
这行报错:Package with namespace /example cannot be found
这个错误怎么解决啊
 我用的myeclipse开发工具

解决方案 »

  1.   

    上面提示找不到访问路径 struts的访问路径是 <package namespace="/luger">加上
    <result    name=“hello”type="redirectAction">   是两个name属性值的相加就是访问路径 你肯定没有设计好 你再看看你struts.xml的设置
      

  2.   

    不是这一行吧
    是action那行吧
    里面namespace属性 的值/example
    你自己再理解理解 namespace是干什么的吧
      

  3.   

    xml信息都贴出来,异常也贴下~
      

  4.   

    xml version="1.0" encoding="UTF-8"?>
    -<web-app xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4" id="WebApp_9"> <display-name>Struts Blank</display-name> -<filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> -<filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> -<welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app>
    这是xml 的内容<result type="redirectAction">
    这行报错:Package with namespace /example cannot be found
      

  5.   

    <package name="export" extends="json-default"
    namespace="/export">
    <action name="*ExportWrite" class="exportOrderCabinExportWriteAction"
    method="{1}">
    <result name="findExportList">
    /export/exportOrderCabin_list.jsp
    </result>
    </action>
    </package>
    这是我现在用的一个好的配置访问的路应该加上 namespace 里面的内容吧
      

  6.   

    <package 。 namespace="/example">
    你的应该这样写吧
      

  7.   

    把前台的请求页面代码(form表单的代码)以及struts.xml代码全贴出来。  报的错误是命名空间找不到
      

  8.   

    前面我什么也没有做,就是把struts2 里copy出来的struts.xml 贴在项目的src里 给出的代码不是我自己写的,我是刚开始自学struts2。 出的这个错不知道怎么改啊!告诉我,开始学struts2要做的准备。要配置些什么。
      

  9.   

    <struts>
    <package name="example" extends="struts-default"namespace="/example">
    ...
    </package>
    </struts>