Search code examples
javahtmlstruts

To get a value in JavaScript which is set in HttpRequest Object in Middle Layer?


Can anyone suggest me how to get a value from my variable, in JavaScript, which is set in HttpRequest Object in Middle Layer?

I am doing something like this servletRequest.setAttribute("retriggerRequest", retriggerRequest);. I want to check retriggerRequest value in my JavaScript and work accordingly. Is there any way out? Any suggestions would be helpful :) Thanks!!

Note: Its a post request so I can't get it from the url.


Solution

  • Use hidden textfield for it.

    <input name='myvalue' type="hidden" value=${myvalue} />