• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling java method defined in jsp

 
Nidheesh Krishna
Ranch Hand
Posts: 60
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to call a java method defined in jsp inside a javascript method defined in same jsp page?
 
Tim Moores
Saloon Keeper
Posts: 3326
61
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, you should not define methods in JSPs - they are meant as a view template, not for any kind of serious processing. If you need some custom processing, use a tag file.

Secondly, JavaScript and JSP are entirely separate: the former is executed on the client, while the latter is executed on the server - and never the twain shall meet :-)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65661
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this article to understand how JSP operates and why what you are asking makes little sense.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!