Win a copy of Murach's Java Programming 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: 3755
78
  • 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: 66041
140
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.
 
BWA HA HA HA HA HA HA! Tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!