I am using JSP tag files to add “widgets” to my application pages.
Is it possible to have an action associated with a JSP tag file, so it will be populated with dynamic content just like a normal page and then “injected” in some place?
Let’s say I have tag file that I invoke like this: <c:onlinemembers />. It displays the list of online members.
I need to have a way of populating it with dynamic data before it is displayed.
Any suggestions?
EDIT: as pointed out by Alexandr, this is good on Struts 2.0.x, where Struts integrates Dojo tags. Since Struts 2.1.x, jQuery should be used instead (with similar mechanism).
All depends on your Struts2 version.
OR you can use the built-in Struts2/Dojo AJAX feature.
in Struts.xml you should map loadDynamicDivAjaxAction to returning a normal JSP snippet as a result. That’s it…