页面接收action 参数 编码问题

Jsp页面传递了一个String类型的参数给action,在action端应该有相同名字的String类型的全局变量,还需要有对应的get和set方法,然后要进行转化,不然会是乱码的。

String name = new String(goodname.getBytes("ISO-8859-1"), "UTF-8");

转化为UTF-8的String。

action传递参数到action:xxx!xxx?name1=${name1}&&name2=${name2}name1和name2也需要对应的get和set公共方法。results里面的type应该为type = "redirect"。



你可能感兴趣的:(jsp,乱码,utf-8,redirect)