-2

I am trying to develop a Java Server which when accessed from a browser sends HTML and JavaScript code.

I want to create buttons on the web page which retrieve information from the back-end Java Server when clicked (such as displaying a picture or playing a video),

But I have no clue how JavaScript and Java will interact with each other.

ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
  • Java EE (Enterprise Edition) is what you'll need to learn in order to do this. Servlets on the low level, and RESTful web services on the high level. – Mordechai Jan 17 '17 at 04:59
  • JavaEE with servlets is a good option but quite a heavy load if you just need a simple HTTP server. There are other options like the ones explained in this question: http://stackoverflow.com/questions/3732109/simple-http-server-in-java-using-only-java-se-api – Johannes Müller Jan 17 '17 at 12:36

1 Answers1

-2

I think you should take a look at AJAX. That's pretty much what you want for that.

There are also some good Framworks for that task.

kaymcray
  • 19
  • 5
  • 1
    The question does not mention any feature that would require AJAX explicitly. But nonetheless, that might be a possible solution. – Johannes Müller Jan 17 '17 at 12:33
  • You're completely right. Maybe i should have clarified more, that I would go for this method of handling the communication between the clientside interface and the java server. But it will work quite well that way and understanding and using this method will simplify the understanding of a lot of other applications in that area. At least from a learning and teaching perspective. – kaymcray Jan 17 '17 at 12:39