-1

For most of time I have worked on the server side using Java, Spring, Hibernate and databases. But now I have decided to learn front end programming using HTML5, CSS3 and Javascript.

I have a simple and elementary question here. How do we invoke java methods from java script ? For example on click of a button or to perform some validations on the server side.

I understand that we can perform ReST calls using Jersey. Are there any other ways to make a call to Java from JavaScript. Since I am a beginner here, I don't want to use Ajax, Servlets or JSP for now.

I have already built a simple application using SWT: SWT: Table Resizing Issue. I am thinking of using this opportunity to learn web programming.

I have already tried searching for answer on StackOverflow but couldn't find one. I hope that I am not duplicating any question.

Thanks.

Community
  • 1
  • 1
RDM
  • 1,136
  • 3
  • 28
  • 50

1 Answers1

0

If you are building a web application that run on the browser (because JavaScript can be also used to build desktop application: NodeJS, Electron…), so everything going from the browser to the backend server should be a http request, this is how the web work. Server Side framework is just doing the job of behalf of you by transforming backend code (Java, .NET, PHP …) to Browser language (html, css and JavaScript) and then performing server call using Http methods (Get, Post …).

Rafik
  • 300
  • 2
  • 7