• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to pass javascript value to Java method within JSP

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read this article for a full explanation of why that cannot be done.
 
reply
    Bookmark Topic Watch Topic
  • New Topic