Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to pass javascript value to Java method within JSP  RSS feed

 
Hemanth Pallavajula
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

The basic illustration of the problem is:
1. I am having a textbox within a JSP page.
2. The value provided in the text box needs to be processed.
3. For processing the value I need to use a Java method as I need to pick up data from the session.
4. Now the problem is that I am not able to send the value of the textbox to the Java method when onBlur event occurs on the textbox.

Please help me in this regard. I have Googled but was unable to get any help.

Thanks in advance.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java code is run on the server, before your page is drawn in the user's browser.
Javascript is run in the browser, long after all of the Java has been run.

If you need something processed with Java, on the server, then you need to generate another post.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this article for a full explanation of why that cannot be done.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!