Hi Ranch folk and critters
I am a Java Learner who just won't go where I am told. I learn best by making things my way, so I may be in trouble here. It's a kind of long dumb question.
I have latched on to the Phraseomatic because it amuses me, and that's my number 1 priority to stay with something. I have Got the Phraseomatic servlet running on my local Spring Tool Suite setup, on the tc server they provide, and I fancied it up, then I put the phrases into an embedded database and that's working purty good, podners.
But now I am trying to figure out this whole Spring thing, have made it through some Hello this and that tutorials.
I have figured out that in Spring, this Servlet app (KathyServlet and PhraseOMatic2) ought to be converted to a Spring MVC app somehow, and I started that, and I got a thing to work, still with the database, but tain't right. It generates the Phrase once when the app starts, not every time you hit the link.
I have the PhraseOMatic2.makePhrase() method in a very similar format to the original in the book and it's called from the html template via a Controller but I don't think I am using the right design in Spring.
Is there some way in Spring web apps that you should just call a java program such as PhraseOMatic2 in the straightforward way that it's done in the KathyServlet in the book? It just calls the method right there in the PrintWriter line like this
and we see the phrase on that line regenerated with a page refresh.
How would we do that in a Spring MVC web app page?