0

I have built a java program that does very simple reading, storing, and processing of server side data that it receives from some electronic sensors. This information now needs to be put onto a webpage.

Some calculations need to be done server side so I want to keep the Processing done in java rather than an interpretative language like javascript or python.

Anyway How do I get the information from the java program up onto a website using a java web application? I am a little unfamiliar with JSP and Servlets though they aren't too complicated I do not know how to get my current working program to work with those and print out the server side information.

It doesn't need to be anything fancy this is just a simple program to do some real time remote monitoring over the web of some electronics.

I do know and understand HTML as well so i do know how to work with those.

2
  • First you need to have a server which is compatible with Java (you can create your own HTTP server in Java alone, but I wouldn't recommend doing that). How you integrate everything depends on the server you use and IDE you use. A common free server is tomcat. Commented May 3, 2015 at 23:52
  • On a broad scale, you want to make sure that the bits that do your calculations and such are their own Java classes that aren't tangled up with whatever UI you have in place, and then you can call those classes from both the existing UI and your Web UI. I generally recommend Spring for Web applications, and Spring Boot makes it very easy to get started with an embedded Web server. Commented May 4, 2015 at 0:47

1 Answer 1

1

You can use tomcat+spring, here is link to a tutorial that teaches you how to create a RESTful webservice https://spring.io/guides/gs/rest-service/

What you'll need to do is basically mapping the http requests to some functions that will call your functions in your original program.

Sign up to request clarification or add additional context in comments.

1 Comment

Worth mentioning start.spring.io, which takes care of more than half of that tutorial.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.