I am trying similar thing as of this question
redirect external url in browser
but it is not working with me at all.
Action code:
public String getMail(){
try { //some code
url = accessToken.getCallbackUrl();
if(url != null){
return "redirect";
}
return "input";
} catch (UnsupportedOperationException e) {
return "input";
}
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
Struts.xml
<action name="getMail" method="getMail"
class="test.MailAction">
<result name="input">/index.jsp</result>
<result name="redirect" type="redirect">${url}</result>
</action>
I wrote setter-getter also for url.
and when I am trying to manually write this url in browser then it is working perfectly.But, automatically it is not redirecting