I have a jsp linked to a javabean, with some code that decreases a variable by one within the bean using jsp:setproperty everytime a button is clicked (it's inside a javascript function that runs when you click a button).
However, the code runs every time the page is refreshed, not when the function is called. I'm pretty sure I know why (jsp is run on the server, javascript is run in the client, therefore js can't interface with the java code), but I don't know a way to actually do something like that properly.
I'm a javabean newbie so I'm probably overlooking something.
Thanks.
EDIT: I ended up doing something completely different and using this to make a hidden form in javascript that submits info to a different jsp and redirects back. It works kinda like sharing a javascript variable with jsp code when I can just grab it from a URL parameter.