Search code examples
javascriptjspjsp-tags

I need to pass a parameter expected by a . tag file, using javascript


I have a .tag file that renders an HTML output but it expects an attribute. I need to pass the required data to that tag file using a javascript file. Is there a way to do that?


Solution

  • .tag files are just Servlets (they run on the server) so the only way you have to pass values from JS to the .tag is launching a request with those values on it to the jsp that includes the .tag and access them via the Request object like: ${requestScope.myParam}