P
P
P_Alexander2017-12-28 16:52:47
Java
P_Alexander, 2017-12-28 16:52:47

How to launch the start page correctly?

I am writing my first Java EE project + servlet + tomcat + jsp
At the moment, when starting the project, the start page is launched and the url looks like this - localhost:8085
Tell me how can I make the url look like this when starting the start page - localhost:8085/warmStar.
In web.xml, I registered a list and a servlet that serves it, well, as I understand it, the servlet listens to the url /warmStar, maybe I asked the question incorrectly, but How can I do that when loading, immediately there was such a url - localhost: 8085 / warmStar.
If you immediately sendredirect in doGet, then there will be multiple redirects, and if you request, then a blank screen.

WarmStar
warmStar.WarmStar


WarmStar
/warmStar

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2017-12-28
@P_Alexander

What would I advise. Throw in Tomcat, JEE, and especially JSP.
Take the right microservice framework instead of Tomcat, like jooby.org (I'm working with it right now), sparkjava or springboot.
Get the right templater like www.mitchellbosecke.com/pebble/home (I'm here), freemarker (velocity is morally obsolete), thymeleaf and make sane templates
. kitchens work fine, if cho), connect always.
To read - https://medium.com/@espina.edgar/java-micro-framew...
Oh yes, in the Tomcat settings you need to specify the default web-application. Then it will open at your desired url

<Context path="" docBase="/usr/local/tomcat/mywebapps/myapplication">
                <WatchedResource>WEB-INF/web.xml</WatchedResource>
            </Context>

Oh yes - servlets too - in the furnace!
And yes, ask questions, I'll try to answer.
And yes, I walked this path about 10 years ago with tomcat and all this zombie enterprise, evaded to python + twisted + flusk, now I’m drawn back with Java 8.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question