How can I make it so that sesion.setAttribute ("Surnames", dbapellidos); take me two last names

0

I have a class in which I get two surnames from a database;

dbapellidos=rs.getString("Apellidos");

but I want to pass it to a jsp page through session

sesion.setAttribute("Apellidos", dbapellidos);

and when I get it on the page, I only get the first name:

session.getAttribute("Apellidos");

I have tried to put two last names followed by a script and if you take it.

Thank you very much in advance

    
asked by gulez 24.05.2018 в 10:41
source

1 answer

1

If you have the commons-lang library in your application's classpath:

sesion.setAttribute("Apellidos", StringEscapeUtils.escapeJava(dbapellidos));

and

String apellidos = session.getAttribute( StringEscapeUtils.unescapeJava("Apellidos"));
    
answered by 24.05.2018 в 11:03