我尝试创建 XSP Servlet 并希望在我的 Web 应用程序中完全支持泰语(和/或其他亚洲/阿拉伯字母)。
此脚本是来自https://frostillic.us/blog/posts/159496067A27FD3585257A70005E7BC1的自定义版本
环境:Domino 9.0.1 FP6,Windows Server 2008
package com.testing.servlet;
import java.io.*;
import java.util.*;
import com.ibm.commons.util.StringUtil;
import com.ibm.xsp.webapp.DesignerFacesServlet;
import javax.faces.context.FacesContext;
import javax.servlet.*;
import javax.servlet.http.*;
import lotus.domino.*;
public class Testing extends DesignerFacesServlet {
//Session
private static Session getCurrentSession(FacesContext context) {
return (Session) context.getApplication().getVariableResolver()
.resolveVariable(context, "session");
}
private void incinerate(Object... dominoObjects) {
for (Object dominoObject : dominoObjects) {
if (null != dominoObject) {
if (dominoObject instanceof Base) {
try {
((Base)dominoObject).recycle();
} catch (NotesException e) {
System.out.println("[FAILED TO RECYCLE]");
e.printStackTrace();
}
}
}
}
}
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
HttpServletRequest req = (HttpServletRequest)servletRequest;
HttpServletResponse res = (HttpServletResponse)servletResponse;
ServletOutputStream out = res.getOutputStream();
FacesContext facesContext = this.getFacesContext(req, res);
Session session = null;
Database database = null;
View view = null;
Document doc = null;
}
}
}
}
结果
start
Counter: 5
???????????? // thai letter display as ????
done
如何显示泰文而不是????
Smart猫小萌
相关分类