I am just starting with Servlets and I have some servlets that act as separate URLs to populate the database for some dummy testing. Something like form:
public class Populate_ServletName extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/plain");
}
}
I have about 6 such servlets that I want to execute in sequence. I was thinking about using setLocation to redirect the next page, but was not sure if this is the right approach, because redirects should happen after the records have been inserted. In particular, I am looking for something like this:
public class Populate_ALL extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/plain");
}
}
Any suggestions?
source
share