Initial Page Render

sanity edited this page Mar 25, 2013 · 3 revisions

When someone visits http://lastcalc.com/, rendering the initial page is handled by MainPageServlet.doGet().

We verify that they are using a supported browser (redirecting them to an appropriate message if not), and then determine whether they are visiting a specific Worksheet (which would be a url like "http://lastcalc.com/AB1234"). If not, we create a worksheet and redirect them to it.

If they are visiting a specific worksheet, we need to retrieve it and render it. A worksheet (see Worksheet.java) is mainly a list of Lines, each of which consists of a question and an answer.

MainPageServlet uses the excellent JSoup library to programmatically piece together the HTML page, including the Lines (if any), and the Help Panel.