I have JSP where I am displaying list of data in a tabular format. One of the columns in each will have 3 different links. Have 3 different methods in Action class, so that
Premise: the sentence
could not assign the data returned by the Action class to the struts variable in JSP.
is wrong because there is nothing like a "Struts variable" in the rendered HTML page.
That said, there are several ways to achieve your goal (although not completely clear):
Load the content when rendering the page, then hide / show it through javascript; this is the fastest way, but there are cases where it is discouraged, for example :
Add / remove the content through a standard POST / GET submit; this is the old way, you reload everything, recharge everything and have to manually handle anchors and page-related operations.
Add the content through AJAX calls, and remove it through javascript (raw javascript, jQuery, struts2-jQuery-plugin, or other libraries); this is probably what you need, if solution n.1 doesn't fit your case.
To stick with the current standards / best practices / tools that will simplify your work, you should use:
Side note: if you inject a JSP snippet containing others struts2-jquery
tags, you need to read this.