2013年9月16日星期一

ajax request strcut2 the action, action is not running

 This post last edited by the showbo on 2013-09-16 09:41:06
jsp

var pars = 'errorid=' + value;
new Ajax.Request('/test/static/studentstaticgeterrors.action', { method:'post', parameters: pars,onComplete:cuFunction } );


spring. xml
<bean name="/static/studentstaticgeterrors" class="test.StudentStaticGetErrorsAction" scope="request">
<property name="errorDao" ref="errorDao"></property>
</bean>


strcut2. xml
<package name="static" namespace="/static" extends="default jfreechart-default">
<action name="studentstaticgeterrors" class="/static/studentstaticgeterrors" method="execute">
</action>


action. java

public class StudentStaticGetErrorsAction extends ActionSupport{
private ErrorDao errorDao;
private String errorid;

public void setErrorDao(ErrorDao errorDao){
this.errorDao = errorDao;
}

public ErrorDao getErrorDao(){
return errorDao;
}

public void setErrorid(String errorid){
this.errorid = errorid;
}

public String getErrorid(){
return errorid;
}

public String execute() throws Exception{
System.out.println("成功运行到此处!");
return null;
}
}


background does not show "successful running into here !" jsp in errorid value is yes. Hope someone can- pointing, thank
------ Solution ------------------------------- -------------
profile package than using the class = "/ static / studentstaticgeterrors" this what ? You can find this StudentStaticGetErrorsAction class inside it your way
------ Solution - -------------------------------------------
you alone to run your the . action, take a look at what is wrong , you may have a problem right path .
------ Solution ---------------------------------------- ----
estimate your Action wrong path . Directly in the browser, the path of the output Action , see if you can perform .
------ Solution ---------------------------------------- ----
path issues now. A closer look .
------ For reference only -------------------------------------- -

run directly . action can be run , but just did not respond to a request . . .
------ For reference only -------------------------------------- -
AJAX changed the wording on the line, though still do not know why , or thank you for your enthusiastic answer

没有评论:

发表评论