This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I understand what to do with Frontman if I am going from a form jsp to a view but what happens if I need to run code in between?
Do all of these need to be either in the /command/ directory or the /pages/ directory -- if not how do I get to them?
index.jsp user fills in data--> servlet loads javabean with setters and getters, and pojo data class, then searches for data based on index.jsp form and stores it in the javabean --> another jsp displays data from the database --> redirect back to index.jsp for next search
I have read the article. With your help I was able to build the example but in the example a servlet is never used, instead the GetHelloWorldMessageCommand sets the values that are used in the view that it forwards to.
So I am missing a piece and being new at both servlets and Java I am probably missing things that are obvious to someone with more experience. I don't understand how frontman passes control to the servlets that will lookup data and store it in the bean.
I am trying to take an existing training servlet project and convert it to Frontman. Pseudo code below.
program flow if using Frontman...
The questions are for 3):
What is the call to be used in frontman to pass control to the servlet , redirect(?) forward(?) forwardToCommand(?)
Does the AddToEmailListServlet.java (and the other servlets) have to be in the commands package?
in Front man you have the commands that handle that -- why a servlet at all
That is what I'm trying to wrap my head around. Now that you say this I see that Frontman is built on javax.servlet.http.HttpServlet. That is what I missed before.
To confirm what I think you are saying -- the commands classes replace the servlets in the project . To finish the project conversion I would move the logic that was in the servlets into the command classes. The command classes would be in the commands package.