I extract the data from a DB through a connector, but when it comes to showing them in a list in a jsp, it shows them to me like this:
How can I format the Strings when I take them out or what can I do to show them with their accents and the ñ ??
Thank you.
With this code I extract:
con = new c(HOST, PORT, USER_PASS);
rs = (c.Flip) con.k(query);
for(int fila = 1; fila < con.n(rs.y[0]); fila++){
for(int col = 0; col < rs.x.length; col++){
if(con.at(rs.y[col], fila)!=null){
dataStr = con.at(rs.y[col], fila).toString();
}
if(dataStr!=null){
if(!dataStr.matches(".*\d+.*")){
muni.setName(dataStr);
} else if (!dataStr.contains("-")){
muni.setNhab(dataStr);
data = data + Integer.valueOf(dataStr);
if(selectedMuni.contains(muni.getName())){
muni.setBool("true");
} else {
muni.setBool("false");
}
}
}
}
result.add(muni);
With this code I show:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<c:forEach var="municipio" items="${requestScope.municipios}">
<option value="${municipio.name}" <c:if test="${municipio.bool eq 'true'}">selected</c:if>>${municipio.name}</option>'<c:forEach var="municipio" items="${requestScope.municipios}">