How do I pass Javascript variable to and JSTL?

前端 未结 3 805
遥遥无期
遥遥无期 2021-01-06 13:59

How do I pass Javascript variable to and JSTL?



        
3条回答
  •  北荒
    北荒 (楼主)
    2021-01-06 14:32

    You need to send it as a request parameter. One of the ways is populating a hidden input field.

    
    
    

    This way you can get it in the server side as request parameter when the form is been submitted.

    
    

    An alternative way is using Ajax, but that's a completely new story/answer at its own.

    See also:

    • Communication between Java/JSP/JSF and JavaScript
    • Your previous question regarding the subject
    • Your other previous question regarding the subject

    If you can't seem to find your previously asked questions back, head to your user profile!

提交回复
热议问题