开发者

how to click a html hyperlink from a java file

I am passing an html hyperlink component to a java file

<html:a href="google.com" visible="false" id="googlelink">

The visibility of this link is set to false. In the java file, when a particular condition is met, I would like to set the onclick event for this link. Meaning, when the condition is met I would like to navigate to "Google Page".

TestA.java

if (condition) {
// click the googlelink component and开发者_开发技巧 navigate to google page
}

Thanks, Sony


Assuming your TestA.java is a servlet, you can do something like this:-

response.sendRedirect("http://www.google.com");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜