N
N
nadom2016-04-24 15:33:36
Java
nadom, 2016-04-24 15:33:36

JavaServlets how best to return an HTML page?

Good time of the day.
There is a service (at 127.0.0.1:8080/test).
I have several resources that process requests at different addresses (127.0.0.1:8080/test/page1, 127.0.0.1:8080/test/page2 ...).
I want each resource to return HTML (the skeleton for HTML is stored in a file, the script skeleton from another file and the script depending on the user's status are appended to it).
What is the best way to organize such a structure?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
sirs, 2016-04-25
@sirs

If I understand your question correctly, then you need the Command pattern

A
Anton, 2016-04-28
@MrJcnby

If I understand correctly, then you have JavaServlets - one with the address 127.0.0.1:8080/test/page1 and the other 127.0.0.1:8080/test/page2 , you want to return an HTML page on request. The servlet has standard request and response.
By request, you define parameters from the client, and in response, write a response to the client, including HTML. A simple example is here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question