Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling java method defined in jsp  RSS feed

 
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: 3422
73
  • 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: 65767
130
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!