Assign JavaScript variable to Java Variable in JSP

后端 未结 7 1400
猫巷女王i
猫巷女王i 2020-11-30 04:49

Ello there,

I\'m trying to assign the value of a javascript variable to a java variable. But I don\'t have clue how to do this? Say for example I have this:

相关标签:
7条回答
  • 2020-11-30 05:44

    You need to read something about a JSP's lifecycle. Try this: http://en.wikipedia.org/wiki/File:JSPLife.png

    JavaScript runs on the client, but in order to change the jsp, you need access to the server. This can be done through Ajax(http://en.wikipedia.org/wiki/Ajax_%28programming%29).

    Here are some Ajax-related links: http://www.openjs.com/articles/ajax_xmlhttp_using_post.php

    http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_first

    0 讨论(0)
提交回复
热议问题