Friday, 9 August 2013

making sure one task completes before another starts in java

making sure one task completes before another starts in java

Can anyone show me a way to force one task in java to complete before the
next task is allows to start? Specifically, I want to edit the code below
so that the first marked two lines of code are completely finished before
the next marked two lines are called.
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String idString = req.getParameter("id");
Long id = new Long(idString);
//complete the actions specified on next two lines
School school = new SchoolDAO().findSchool(id);
req.setAttribute("school", school);
//before even starting the actions specified on the next two lines
List<CourseSummary> coursesummaries = new
CourseSummaryDAO().findAllcsum(id);
req.setAttribute("coursesummaries", coursesummaries);
jsp.forward(req, resp);
}

No comments:

Post a Comment