小弟用struts 2开发  遇到个奇怪的问题
JSP页面<body>
   <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="font1"></table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>
<td height="5"></td>
     </tr>
</table>
<div class="doubleselect">
<s:form name="s" action="member_add" method="post">
<table width="98%" border="0" align="center" cellpadding="5"cellspacing="1" bgcolor="#AED2F6" class="font1">
<tr>
    <td align="center" colspan="2" bgcolor="#BDDAF8" class="font1">
                             兴动卡信息录入
    </td>
</tr>
<tr>
    <td bgcolor="#F1F7FD">
<s:doubleselect doubleList="#request.listMap.get(top)"                   list="#request.clist" doubleName="month" name="year"
doubleHeaderValue="请选择月份" headerValue="请选择年份" label="数据月份"></s:doubleselect>
    </td>
                            </tr>
                            <tr>
              <td bgcolor="#BDDAF8">
文档上传:
    </td>
     <td align="left" bgcolor="#F1F7FD">
<input name="xls" type="file" class="box3"></input>
<font color="red">*仅限excel</font>
     </td>
                            </tr>
                            <tr>
      <td height="30" colspan="2" align="center" bgcolor="#FFFFFF">
<input name="Submit43" type="submit" class="btn01" value="提 交"
onMouseOut="this.className='btn01'"onMouseOver="this.className='btn02'" onclick="return check();">
<input name="Submit432" type="button" class="btn01" value="返 回"
onMouseOut="this.className='btn01'"onMouseOver="this.className='btn02'"onClick="javascript:history.back();">
      </td>
</tr>
</table>
<div style="”color: red”">
         <s:fielderror />
</div>
</s:form>
</div>
<script>  function check()
  {
   
    if(s.xls.value.length<1)
    {
     alert('请上传文件');
     return false;
    }
   
  }
</script>
</body>struts.xml文件<struts>
<constant name="struts.i18n.encoding" value="gb2312"></constant>
<constant name="struts.devMode" value="true" />
<constant name="struts.multipart.saveDir" value="D:\temp\"></constant>
<constant name="struts.multipart.maxSize" value="1073741824" /><package name="sportsclub" extends="struts-default" namespace="/">
         <action name="member_*"  class="com.sports.club.action.MemberAction" method="{1}">
<result>/admin/member_{1}.jsp</result>
<result name="toAdd">/admin/member_add.jsp</result>
<result name="add">/admin/member_add_success.jsp</result>
</action>

</package>
</struts>MemberAction.javapublic class MemberAction extends ActionSupport { /**
 * 
 */
private static final long serialVersionUID = 1L;
private String year;
private String month;
private List list=new ArrayList();
private File xls;
private String xlsFileName;
HttpServletRequest request=ServletActionContext.getRequest();
         
         public String add(){
System.out.println(xls);
try {
FileInputStream is = new FileInputStream(xls);
String url="admin/membercard/"+xlsFileName;//数据中的地址
String realpath=request.getRealPath("/"+url);
FileOutputStream os = new FileOutputStream(realpath);
System.out.println(realpath);
byte[] buffer = new byte[40000];
int length =0;
while((length=is.read(buffer))>0)
{
os.write(buffer,0, length);
}
is.close();
os.close();
Input in = new Input();
in.input(realpath,month,year);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "add";
}
谁能告诉我 为什么会是No result defined for action com.sports.club.action.MemberAction and result input 
明明有return啊  我把 add()方法去掉 就报错是No such method  说明读到了action的 add方法   
跪求解决方法

解决方案 »

  1.   

    配置没有定义input对应的页面
      

  2.   

    method="{1}" ?
    为什么不指定方法名?
    action name="member_*" ? 这命名规范
      

  3.   

    action name="member_*"  这个使用的是通配符啊 
      

  4.   

    input对应的页面 对应的页面怎么配置呢 
      

  5.   

    说错了  一定要配置input页面吗
      

  6.   

    你画面可能有问题,因而调回原来画面,但是你没有指定input的视图!
      

  7.   

    private File xls;
    private String xlsFileName;
    struts2上传文件还需要一个参数
    private String xlsContentType;
    以及他们的setter方法;LZ的出问题是因为struts2在传递参数时出错了,因此Add()方法并没有执行
    直接返回了input,而LZ又没定义input视图所以No result defined for action com.sports.club.action.MemberAction and result input