java.lang.NoSuchMethodException

[code="java"]java.lang.NoSuchMethodException: com.kinrich.action.MediaAction.deleteMedia()
java.lang.Class.getMethod(Class.java:1581)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:75)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
[/code]
[color=red]报错[/color]

[color=red]Action[/color]
[code="java"]
public String deleteMedia() throws Exception{
String[] mediaid = request.getParameterValues("mediaid");
for (int i = 0; i < mediaid.length; i++) {
manageMediaDao.deleteMedia(Integer.parseInt(mediaid[i]));
}
return getList();

}

[/code]

[color=red]页面[/color]
[code="java"]

function deleteMedia(){ if(confirm("你确定要删除?")){ form1.action="media!deleteMedia.action"; form1.method="post"; form1.submit(); } }
  <c:forEach var="medialist" items="${medialist}">
                        <tr>
                            <td class="alignM">
                                <input type="checkbox" name="mediaid" value="${medialist.id}" />
                            </td>


/c:forEach
[/code]

[color=red]struts[/color]
[code="java"]
<?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">

<!-- spring提供的实现类, 作用:根据请求,到spring容器中寻找得到对应的Action -->
value="org.apache.struts2.spring.StrutsSpringObjectFactory" />

<package name="kinrich" extends="struts-default">
    <interceptors>
        <!-- Basic stack -->
        <interceptor-stack name="myStack">
            <interceptor-ref name="logger" />
            <interceptor-ref name="component" />
            <interceptor-ref name="servlet-config" />
            <interceptor-ref name="static-params" />
            <interceptor-ref name="params" />
            <interceptor-ref name="conversionError" />
            <interceptor-ref name="validation" />
            <interceptor-ref name="workflow" />
            <interceptor-ref name="defaultStack" />
        </interceptor-stack>
    </interceptors>
    <default-interceptor-ref name="myStack" />


    <action name="media" class="mediaAction">
        <result name="show">/ManageMemor.jsp</result>
        <result name="input">/updateToMemor.jsp</result>
    </action>
</package>


[/code]

查看全部
damiean
damiean
2011/03/21 14:25
  • struts
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

0个回复