I am writing a java class that extends HttpServlet thus overwrites doPost() method. Inside the doPost() method, some data object is assembled, but I am not sure what is a better way to return the data. For instance,

```
public class FormSubmission extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // http request is parsed to assemble an object, e.g., a List
        List L = parseRequest(request);

        // Question: how to return List L for use by Server?         
    }
}    

```

One way I can think of is to declare a static variable as

```
Public static List L;

```

and call `FormSubmission.L`, which basically makes List L a global variable. 

Another way is to write data bytes to a file so that it can be read back into a List later. 

But is there better way to handle such situation? 

***Use cases based on Comment:***

Two forms with HTTP/POST are created in main page "index.html", Form A and B. It is required that a user submits Form A first, and then submits Form B. Submitting Form A triggers the above ***doPost()*** method, such that ***List L*** is constructed. The scenario is to how to make this List available to process Form B submission. Specifically, how to have Form B's ***doPost()*** method be able to access ***List L*** created from A during the previous stage.