【发布时间】:2015-04-02 12:14:34
【问题描述】:
我在动作名称之后实现参数,例如“http://localhost:8080/webapp/book/view/abc” 但是当我发送另一个语言参数时,例如“http://localhost:8080/webapp/book/view/กขค”(这是泰语) 它不起作用,这是我的操作代码。
@Getter @Setter String bookingNo;
@Action(value = "view/*", params = {"bookingNo", "{1}"}, results = {@Result(name = SUCCESS, location = "view.jsp")})
public String view() {
// show something like this: กขค
log.info("bookingNo: " + bookingNo);
// show correct encoding value
log.info("bookingNo after unescapeHtml: " + StringEscapeUtils.unescapeHtml(bookingNo));
return SUCCESS;
}
我的问题是如何设置 unescapeHtml 或其他选项来为所有 Action 中的所有方法获取正确的参数编码?
PS。我已经在我的 tomcat7 中将 URIEncode 配置为 UTF-8,我尝试实现 Interceptor 但我不知道如何取消它?
【问题讨论】: