String t1 = request.getParameter("t1");
        String t2 = request.getParameter("t2");
        List<String> terms = new ArrayList<String>();
        for (int i = 1; i < 51; i++) {
            terms.add(t + i);
        }
Imagine I had vars t1 to t50, is it possible to loop each t using a counter? Something like above, but obvi that doesn't work.
You don't need the temporary variables, t1, t2, etc. Otherwise you were on the right track.
    List<String> terms = new ArrayList<String>();
    for (int i = 1; i < 51; i++) {
        terms.add(request.getParameter("t" + i));
    }
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With