我正在为 IBM WebSphere Portal 6.1 编写一个 JSR 286 portlet。我有以下代码:
@ProcessAction(name="processForm")
public void processForm(ActionRequest request, ActionResponse response)
throws PortletException, IOException {
String formField1 = request.getParameter("formField1"));
System.err.println("formField1: " + formField1);
}
如果用户在 HTML 表单上提交 '<',系统会输出:
formField1: '<'
但是,如果用户提交 '<' 在 HTML 表单上,系统还输出:
formField1: '<'
这使得无法确定用户在 HTML 表单中实际输入的值。有没有解决的办法?
我在这里找到了一篇文章,它建议进行直接替换,但它没有解决区分表单上两个不同值的问题。