0
votes

I am new to front end developing. I have so far a back-end program written in java with Eclipse that does all I want, saves the output in an object and prints it in the console (for my convenience).

My goal is to display this output information dynamically (meaning that the backend part of the program might update and send new output) in a webpage on a local server. Hence I have "transformed" or "added" a Dynamical webpage to my Eclipse project using "Project Facets" in Eclipse Project Properties, and created an index.jsp file hosted on a tomcat server (See picture of the File organisation).

Ultimately, I want to have my index.jsp file open in my browser and when my backend program (which I assume I have to compile in an executable jar) detects changes , display those changes in the webpage. Also, I have a button on my webpage for which I would like to send information back to my backend program when it is clicked.

Should I use POST request in my backend with the URL of the index.jsp (although I don t want to display the information in a form, just regular text and images)?

or create a Javabean class in the webcontent/WEB-INF/ (if I can access and modify it dynamically from my backend) and then use that to get and set data from the jsp page?

or am I obliged to use something like Spring ?

I ve heard I should seperate backend and front end, but I don t really understand how they communicate dynamically !

Thank you for your help !

1
RPC (RMI). CORBA (IIOP). DCOM. ReST (http). SOAP (http). Other search terms: n-tier Design. Middleware. Enterprise Service Bus. Gang of Four (Design Patterns, MVC). - Elliott Frisch

1 Answers

0
votes

Seeing your project structure I believe you want to build a simple Java Web, you don't need to separate your front-end and back-end unless you want to build something complex.

I'm not quite sure about your experience with Java Web, but if this is your first time I suggest to learn more about Servlet because this is the fundamental in building Java Web project. After knowing how Java handle Http Request is up to you to build pure Java Web project, or using something like Spring MVC even if you want to build a separate front-end that communicate using REST API towards the back-end.