我从动作类中获取某个网址后,我想重定向该网址[https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=abcdefg]并自动在浏览器中显示该网址。但是现在我收到了No Action Mapped 404消息,尽管我正确地从动作类中传递了url。
public String getMail(){
try { //some code
url = accessToken.getCallbackUrl();
if(url != null){
return "redirect";
}
return "input";
} catch (UnsupportedOperationException e) {
return "input";
}
}
<action name="getMail" method="getMail"
class="test.MailAction">
<result name="input">/index.jsp</result>
<result name="redirect" type="redirect">${url}</result>
</action>
答案 0 :(得分:1)
我只是错过了getter,setter for url。现在只是工作:D
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}