How can I pass a controller variable to a jsp?

0

I have the following method in which I recover values, and I do an operation with these values, what I want to do is send my variable total to jsp, 'because I want to validate with that value, and for example, if my variable total is greater than 90, then it shows "HIGH LEVEL", if it is less than 90, it shows "VERY LOW" inside an input

@RequestMapping(value=""/pantallaTotal)
public void obtieneTotal(Model model, HttpServletRequest request){
    Object attribute = (Object) reqquest.getSession().getAttribute("listaUno");
    List<Factura>  listaFactura = (List<Factura>) attribute;
    Object attribute1 = (Object) reqquest.getSession().getAttribute("listaUno");
    List<Cliente>  listaCliente = (List<Cliente>) attribute1;

    Integer valor1 = listaFactura.get(0).getValor();
    Integer valor2 = listaCliente.get(0).getValor();

    Double total = valor1 * 1.5 + valor2 * 0.5;
    model.addAtribute("total", total);
}

How can I recover that total value, in my jsp and then show the result in an input ?, can it be with jquery or js? I hope you can help me, thanks

    
asked by Root93 10.09.2018 в 22:15
source

0 answers