{"id":363,"date":"2012-01-06T22:21:33","date_gmt":"2012-01-06T14:21:33","guid":{"rendered":"http:\/\/inbreak.net\/?p=363"},"modified":"2012-01-06T22:21:33","modified_gmt":"2012-01-06T14:21:33","slug":"struts2%e7%b1%bb%e5%9e%8b%e8%bd%ac%e6%8d%a2%e9%94%99%e8%af%af%e5%af%bc%e8%87%b4ognl%e8%a1%a8%e8%be%be%e5%bc%8f%e6%b3%a8%e5%85%a5%e6%bc%8f%e6%b4%9e%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/www.inbreak.net\/archives\/363.html","title":{"rendered":"STRUTS2\u7c7b\u578b\u8f6c\u6362\u9519\u8bef\u5bfc\u81f4OGNL\u8868\u8fbe\u5f0f\u6ce8\u5165\u6f0f\u6d1e\u5206\u6790"},"content":{"rendered":"
\u6587\u7ae0\u524d\uff0c\u5148Ps\u4e00\u4e0b<\/p>\n
\u8fd9\u6587\u7ae0\u6709\u6f0f\u6d1e\u5f71\u54cd\u5230\u767e\u5ea6\uff0c\u6240\u4ee5\u5148\u53d1\u767e\u5ea6\uff0c\u4fee\u8865\u540e\uff0c\u6b63\u5728\u548c\u5251\u5fc3\u5546\u91cf\u5c0f\u8303\u56f4\u7fa4\u53d1\u5404\u4e2a\u4e92\u8054\u7f51\u5b89\u5168\u56e2\u961f\uff0c\u7ed3\u679c\u8001\u5916\u4e5f\u7814\u7a76\u51fa\uff0c\u5e76\u4e14\u76f4\u63a5\u7206\u51fa\u8fd9\u4e2a\u6587\u7ae0\u7684\u6700\u7ec8POC\u3002\u60f3\u60f3\u521a\u597d\u660e\u5929\u6211\u751f\u65e5\uff0c\u53d1\u4e86\uff0c\u5e86\u795d\u5427\u3002\u8eab\u5728\u4e92\u8054\u7f51\u516c\u53f8\u5b89\u5168\u56e2\u961f\uff0c\u6709\u7814\u7a76\u7684\u7ed3\u679c\uff0c\u603b\u8981\u5148\u4fdd\u8bc1\u81ea\u5df1\u5b89\u5168\u624d\u4f1a\u5f80\u5916\u53d1\uff0c\u8fd9\u662f\u57fa\u672c\u539f\u5219\u3002<\/p>\n
\u7ee7\u4e0a\u6b21struts\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c\u6f0f\u6d1e\u540e\uff0c\u524d\u6bb5\u65f6\u95f4\u53c8\u53d1\u5e03\u4e86\u4e00\u4e2a\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c\u6f0f\u6d1e\u3002\u5f71\u54cd\u8303\u56f4\u6781\u5e7f\uff0c\u5229\u7528\u65b9\u5f0f\u76f8\u5bf9\u4e0a\u6b21\u8981\u82db\u523b\u4e00\u70b9\uff0c\u4f46\u662f\u8bfb\u5b8c\u672c\u6587\uff0c\u6279\u91cf\u6293\u9e21\u4e0d\u96be\u3002<\/p>\n
\u51e0\u5929\u524d\uff0cKJ\u5c31\u5728\u5fae\u535a\u4e0a\u628a\u6211\u5356\u4e86\uff0c\u6211\u4eec\u786e\u5b9e\u5728\u7814\u7a76\u8fd9\u4e2a\u6f0f\u6d1e\uff0c\u5b98\u65b9\u65e9\u5c31\u53d1\u516c\u544a\u3002\u770b\u5230\u6f0f\u6d1e\u4ecb\u7ecd\u540e\uff0c\u7ffb\u9605\u4e86struts\u5b98\u7f51\u540e\uff0c\u4f5c\u8005\u7b2c\u4e00\u65f6\u95f4\u60f3\u5230\u7684\uff0c\u5c31\u662f\u6ca1\u89c1\u8fc7\u6bd4apache\u66f4\u50bbX\u7684\u5b98\u65b9\uff0cstruts\u7f51\u7ad9\u6ca1\u6709\u4efb\u4f55\u9875\u9762\u6709\u6b64\u6f0f\u6d1e\u7684\u8fde\u63a5\uff0c\u51ed\u7a7a\u5728\u90a3\u4e2a\u76ee\u5f55\u4e0b\u591a\u51fa\u4e2as007.html\u9875\u9762\uff08\u4f60\u80fd\u731c\u5230\u8fd9\u4e2a\u5730\u5740\uff1f\uff09\uff0c\u5982\u679c\u4e0d\u662f\u770b\u5230apache\u7684jira\u7cfb\u7edf\u7684\u4e00\u5219\u7559\u8a00\u4fe1\u606f\uff0c\u90fd\u4e0d\u77e5\u9053\u8fd9\u4e2a\u6f0f\u6d1e\u516c\u544a\u7684\u5b58\u5728\u3002\u65e0\u5948\u7684\u60f3\u8d77\u4e00\u4e2a\u7f51\u7edc\u6d41\u884c\u8bed\uff0c\u4ee5\u53ca\u4e00\u4e9b\u5176\u4ed6\u7f51\u7edc\u6d41\u884c\u8bed\u3002<\/p>\n
\u5b98\u65b9\u516c\u544a<\/strong><\/p>\n \u6211\u4eec\u770b\u770bapache\u7684jira\u7cfb\u7edf\u4e2d\u90a3\u5219\u7559\u8a00\u4fe1\u606f\uff0c\u4f5c\u8005\u91cd\u65b0\u63cf\u8ff0\u4e0b\uff1a<\/p>\n \u5230\u8fbeshowcase\u7684validation\u7684case\u9875\u9762\uff0c\u9009\u62e9field validation\u9875\u9762\u3002<\/p>\n \u5728int\u7c7b\u578b\u6216date\u7c7b\u578b\u7684\u8f93\u5165\u6846\u4e2d\uff0c\u8f93\u5165<\/p>\n \u5c31\u4f1a\u5728\u8fd4\u56de\u9875\u9762\u4e2d\uff0c\u663e\u793a\u51fastruts\u5e94\u7528\u7a0b\u5e8fapplication context\u4e2d\u7684\u5185\u5bb9\uff08toString\u540e\uff09\u3002\u5728application\u4e2d\uff0c\u901a\u5e38\u4f1a\u653e\u7740\u6570\u636e\u5e93\u8fde\u63a5\u7b49\u91cd\u8981\u6570\u636e\uff0c\u4e00\u65e6\u88ab\u83b7\u53d6\u7684\u540e\u679c\u5f88\u4e25\u91cd\u3002<\/p>\n \u7531\u4e8e\u8fd9\u4e2a\u4e1c\u897f\u662f\u4e2aognl\uff0c\u6240\u4ee5\u6f0f\u6d1e\u4e0a\u8bf4\uff0c\u53ef\u4ee5\u6267\u884c\u4efb\u610fognl\u4ee3\u7801\u3002\u4f46\u662f\u6f0f\u6d1e\u516c\u544a\u53ea\u7ed9\u51fa\u4e86\u7b80\u5355poc\uff0c\u5e76\u6ca1\u6709\u544a\u8bc9\u5927\u5bb6\u600e\u6837\u6267\u884c\u4ee3\u7801\u3002<\/p>\n \u4e4b\u524d\u7814\u7a76\u8fc7struts\u7684ognl\u6267\u884c\u673a\u5236\uff0c\u6240\u4ee5\u80fd\u5f88\u5feb\u7684\u5199\u51fa\u6267\u884c\u4efb\u610f\u4ee3\u7801\u7684poc\u6765\u3002\u8fd9\u4e2a\u4e0d\u662f\u96be\u9898\uff0c\u800c\u672c\u6587\u7684\u610f\u4e49\uff0c\u5728\u4e8e\u544a\u8bc9\u5927\u5bb6\u8fd9\u4e2a\u6f0f\u6d1e\u80cc\u540e\u7684\u6280\u672f\u7ec6\u8282\u3002<\/p>\n \u5206\u6790\u8865\u4e01<\/strong><\/p>\n \u5728\u5b98\u65b9\u7684\u516c\u544a\u4e0a\uff0c\u5df2\u7ecf\u8be6\u7ec6\u7684\u6307\u51fa\u4e86\u4fee\u8865\u7684\u4ee3\u7801\u3002<\/p>\n \u8fd9\u662f\u6f0f\u6d1e\u4fee\u8865\u7684\u4ee3\u7801\u53d8\u52a8\u6587\u4ef6<\/p>\n \u90a3\u51e0\u4e2a\u6d4b\u8bd5\u6587\u4ef6\uff0c\u5c31\u4e0d\u5fc5\u770b\u4e86\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u4e00\u5171\u4fee\u6539\u4e86\u8fd9\u51e0\u4e2a\u6587\u4ef6<\/p>\n \u4fee\u8865\u7684\u624b\u6bb5\u975e\u5e38\u7684\u7b80\u6d01\uff0c\u7b80\u6d01\u5230\u4ee4\u4eba\u53d1\u6307\uff0c\u5c45\u7136\u7528XSS\u7684\u4fee\u8865\u65b9\u5f0f\uff0c\u524d\u540e\u52a0\u4e24\u4e2a\u5f15\u53f7\uff0c\u4e4b\u540eescape\u4e00\u4e0b\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u8fd9\u6837\u7684\u4fee\u8865\uff0c\u9664\u975e\u4f60\u80fd\u7ed5\u8fc7apache\u7684escape\uff0c\u5426\u5219\u771f\u7684\u6ca1\u8f99\u3002\u4f5c\u8005\u77e5\u9053\u4e4b\u524d\u5199\u8fc7\u6587\u7ae0\uff0c\u8bf4\u8fc7\u53ef\u4ee5\u7ed5\u8fc7escape\uff0c\u4e0d\u8fc7\u90a3\u662f\u5728\u7279\u5b9a\u7684\u6761\u4ef6\u4e0b\u6210\u529f\uff0c\u800c\u5f53\u524d\u8fd9\u91cc\uff0c\u662f\u884c\u4e0d\u901a\u7684\u3002<\/p>\n \u770b\u4e0d\u61c2OGNL\u6ca1\u5173\u7cfb\uff0c\u6211\u4eec\u4e3e\u4e2a\u8d34\u8fd1\u7684\u4f8b\u5b50\uff0c\u540e\u9762\u4e5f\u4f1a\u6709\u771f\u5b9e\u4ee3\u7801\u89e3\u6790\uff0c\u6bd4\u8f83\u590d\u6742\uff0c\u4e0d\u719f\u6089\u7684\u53ef\u80fd\u770b\u4e0d\u61c2\uff0c\u6240\u4ee5\u5148\u7528js\u4f2a\u4ee3\u7801\u7ed9\u5927\u5bb6\u770b\u770b\u539f\u7406\u3002\u4e0b\u9762\u662f\u6bb5JAVASCRIPT\u4ee3\u7801\uff1a<\/p>\n \u539f\u6765\u7684\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c$url\uff0c\u662f\u53ef\u4ee5\u88ab\u7528\u6237\u63a7\u5236\u7684\uff0c\u4e8e\u662f\uff0c\u653b\u51fb\u8005\u63d0\u4ea4\u4e86<\/p>\n \u8fd9\u6bb5\u5c31\u53d8\u6210\u4e86<\/p>\n \u6700\u7ec8\uff0c#application\u4f1a\u88ab\u6267\u884c\uff0c\u5e76\u8fd4\u56de\u7ed3\u679c\u3002\u81f3\u4e8e\u90a3\u4e2a\u201c<\u201d\u7b26\u53f7\uff0c\u548c\u201c>\u201d\u7b26\u53f7\uff0c\u4e00\u70b9\u7528\u5904\u90fd\u6ca1\u6709\uff0c\u53ef\u4ee5\u5ffd\u7565\u3002\u5b98\u65b9\u7684\u4fee\u8865\u4ee3\u7801\uff0c\u4e5f\u76f8\u5f53\u4e8e\u5bf9$url\u53d8\u91cf\uff0c\u505a\u4e86EscapeJava\uff0c\u8fc7\u6ee4\u53cc\u5f15\u53f7\u3002\u770b\u5230\u8fd9\u91cc\uff0c\u4f5c\u8005\u7684\u5fc3\u90fd\u51c9\u4e86\u3002\u5c1d\u8bd5\u4e86\u51e0\u79cd\u8f6c\u4e49\u7ed5\u8fc7\uff0c\u5747\u4ee5\u5931\u8d25\u544a\u7ec8\u3002\u5b98\u65b9\u8fd8\u662f\u6709\u957f\u8fdb\u7684\uff0c\u8865\u4e01\u7b80\u5355\uff0c\u6709\u6548\uff08ps\uff1a\u6211\u540e\u6765\u770b\u4e86\u770b\uff0c\u597d\u50cf\u662f\u522b\u4eba\u5efa\u8bae\u5b98\u65b9\u8fd9\u4e48\u505a\u5f97\uff0c\u5f53\u7136\u4e5f\u53ef\u80fd\u767e\u5ea6\u7ffb\u8bd1\u7684\u4e0d\u51c6\u786e\uff09\u3002<\/p>\n \u6f0f\u6d1e\u539f\u7406<\/strong><\/p>\n \u8fd9\u4e9b\u5f00\u6e90\u7684\u7cfb\u7edf\uff0c\u6211\u4eec\u603b\u662f\u80fd\u901a\u8fc7\u8865\u4e01\uff0c\u53ef\u4ee5\u6709\u6548\u7684\u53cd\u63a8\u7684\u51fa\u6f0f\u6d1e\u7684\u4ea7\u751f\u548c\u5173\u952e\u70b9\u3002\u4ece\u4e0a\u4e00\u6bb5\u53ef\u4ee5\u770b\u5230\uff0c\u5b83\u7684\u7cbe\u9ad3\uff0c\u5176\u5b9e\u662f\u201c\u6ce8\u5165\u201d\u3002<\/p>\n \u8fd9\u6bb5\u6587\u5b57\uff0c\u53ef\u4ee5\u660e\u786e\u7684\u6307\u51fa\u7814\u7a76\u65b9\u5411\uff1a\u201cUser input is evaluated as an OGNL expression when there’s a conversion error\u201d\uff0c\u50cf\u4f5c\u8005\u8fd9\u79cd\u82f1\u8bed\u4e0d\u597d\u7684\u4eba\uff0c\u5c45\u7136\u4e5f\u770b\u61c2\u4e86\u3002\u53d1\u751f\u7c7b\u578b\u8f6c\u6362\u5931\u8d25\u9519\u8bef\u65f6\uff0c\u7528\u6237\u8f93\u5165\u7684ognl\u8868\u8fbe\u5f0f\uff0c\u4f1a\u88ab\u6267\u884c\u6389\u3002\u8fd9\u4e2a\u6f0f\u6d1e\u597d\u773c\u719f\u554a\uff0c\u6211\u4eec\u770b\u770b\u8fd9\u4e2a\u3002<\/p>\n \u771f\u662f\u5c61\u6d1e\u5c61\u8865\u554a\uff0c\u8fd9\u662fstruts2.0.8\u65f6\u4ee3\u9057\u7559\u4e0b\u6765\u7684\u8001\u95ee\u9898\u3002\u5f53\u65f6\u7684\u4fee\u8865\u8865\u4e01\uff0c\u4f5c\u8005\u4e5f\u770b\u8fc7\uff0c\u4e5f\u7814\u7a76\u8fc7\u8865\u4e01\u7ed5\u8fc7\u7684\u53ef\u80fd\u6027\u3002<\/p>\n \u5f88\u60ed\u6127\uff0c\u4f5c\u8005\u6ca1\u6709\u6167\u773c\u8bc6\u82f1\u96c4\uff0c\u7814\u7a76\u65b9\u5411\u9519\u4e86\uff0c\u6ca1\u6709\u6df1\u7a76\u4e0b\u53bb\uff0c\u5bfc\u81f4\u4e27\u5931\u826f\u6d1e\u554a\uff01\u5f53\u65f6\u7684\u6f0f\u6d1e\u539f\u7406\uff0c\u662f\u53d1\u751f\u9519\u8bef\u7684\u65f6\u5019\uff0c\u8f93\u5165\u4e86\u201c%{xxxxx}\u201d\uff0c\u5c31\u4f1a\u6267\u884c\uff0c\u56e0\u4e3aognl\u4f1a\u81ea\u52a8\u591a\u6b21\u7ffb\u8bd1\uff08while\u8bed\u53e5\uff09\u4ee3\u7801\u4e2d\u201c%{xxx}\u201d\uff0c\u5f53\u505a\u65b0\u7684\u4e00\u6bb5ognl\u6267\u884c\u3002\u800c\u5b98\u65b9\u7684\u4fee\u8865\uff0c\u662f\u628a\u8fd9\u4e2a\u591a\u6b21\u7ffb\u8bd1\u7684\u529f\u80fd\uff0c\u4ece\u4ee3\u7801\u4e2d\u9609\u5272\u6389\u4e86\u3002\u5f53\u65f6\u7684\u4f5c\u8005\uff0c\u5c31\u50cf\u4eca\u5929\u7684\u4f5c\u8005\u4e00\u6837\uff0c\u8ba4\u4e3a\u201c\u8865\u4e01\u7b80\u5355\uff0c\u6709\u6548\u201d\uff0c\u6240\u4ee5\u4e5f\u5c31\u6ca1\u60f3\u5230\uff0c\u8fd8\u53ef\u4ee5\u6ce8\u5165\u653b\u51fb\u3002\u6240\u4ee5\uff0c\u5927\u5bb6\u770b\u4e86\u4f5c\u8005\u7684\u6587\u7ae0\u540e\uff0c\u5343\u4e07\u4e0d\u8981\u4ee5\u4e3a\u4f5c\u8005\u5206\u6790\u5b8c\uff0c\u5c31\u7ed3\u675f\u4e86\uff0c\u5982\u679c\u4f60\u80fd\u575a\u6301\u518d\u591a\u5206\u6790\u4e00\u904d\uff0c\u6307\u4e0d\u5b9a\u4f1a\u6709\u5927\u60ca\u559c\uff0c\u5927\u673a\u7f18\u3002<\/p>\n \u8fd9\u91cc\u4f1a\u6709\u4e2a\u5173\u952e\u8bcd\uff0c\u53eb\u505a\u201cvalidate\u201d\uff0cstruts2\u7684\u4e16\u754c\u91cc\uff0c\u8fd9\u4e2a\u53eb\u505a\u201c\u9a8c\u8bc1\u6846\u67b6\u201d\uff0c\u662fstruts2\u7684\u4e00\u4e2a\u81ea\u5e26\u63d2\u4ef6\u3002\u5b83\u7684\u529f\u80fd\uff0c\u4ece\u7528\u6237\u53ef\u89c1\u7684\u89d2\u5ea6\u4e0a\u8bf4\uff0c\u662f\u8be5\u8f93\u5165\u6570\u5b57\u7684\u65f6\u5019\u8f93\u9519\u4e3a\u5b57\u6bcd\u4e86\uff0c\u8fd9\u65f6\u4f1a\u8fd4\u56de\u539f\u6765\u7684\u9875\u9762\uff0c\u663e\u793a\u51fa\u4e00\u4e2a\u9519\u8bef\u6d88\u606f\uff0c\u540c\u65f6\u663e\u793a\u7528\u6237\u539f\u672c\u8f93\u5165\u7684\u5185\u5bb9\u3002<\/p>\n \u95ee\u9898\u5c31\u51fa\u5728\u201c\u540c\u65f6\u663e\u793a\u7528\u6237\u539f\u672c\u8f93\u5165\u7684\u5185\u5bb9\u201d\u91cc\uff0cstruts2\u9a8c\u8bc1\u6846\u67b6\uff0c\u8981\u663e\u793a\u8fd9\u4e2a\u5185\u5bb9\u3002<\/p>\n \u4e00\u65e6\u53d1\u751f\u4e86\u7c7b\u578b\u8f6c\u6362\u9519\u8bef\uff0c\u5c31\u4f1a\u8d70\u4ee5\u4e0b\u6d41\u7a0b\uff1a<\/p>\n \u76f8\u5173\u4ee3\u7801\u7b2c\u4e00\u6b65\uff0c\u8bbe\u7f6eExprOverrides<\/p>\n \u8fd9\u4e2a\u51fd\u6570\u653e\u5165\u4e86\u4e00\u4e2aMAP\uff0cmap\u4f1a\u88ab\u540e\u9762\u7684\u4ee3\u7801\uff0c\u4f5c\u4e3aOGNL\u6267\u884c\u3002<\/p>\n MAP\u7684\u5185\u5bb9\u6765\u81ea\u4ee3\u7801\uff1a<\/p>\n \u5f88\u660e\u663e\u770b\u5230\uff0c\u8fd9\u91cc\u662f\u7528\u5355\u5f15\u53f7\u62fc\u63a5\u7684\uff0c\u53ef\u4ee5\u6ce8\u5165\u3002<\/p>\n tmpValue[0]\u7684\u503c\uff0c\u6765\u81ea<\/p>\n \u4e5f\u5c31\u662f\u53d1\u751f\u4e86\u7c7b\u578b\u8f6c\u6362\u9519\u8bef\u540e\uff0c\u653e\u5165\u9519\u8bef\u5b57\u6bb5\uff0c\u548c\u9519\u8bef\u5b57\u6bb5\u7684\u503c\u3002<\/p>\n \u5230\u4e86\u8fd9\u91cc\uff0c\u5176\u5b9e\u5e76\u4e0d\u4f1a\u6267\u884cognl\uff0c\u53ea\u6709\u5728\u6709\u53bb\u8c03\u7528findValue(“”)\uff0c\u5e76\u4f20\u5165\u76f8\u5173\u9519\u8bef\u5b57\u6bb5\u540d\u79f0\u65f6\uff0c\u624d\u4f1a\u6267\u884c\u5bf9\u5e94\u7684\u503c\u5185\u5bb9\uff0c\u4e5f\u5c31\u662f\u88ab\u6ce8\u5165\u7684OGNL\u8bed\u53e5\u3002<\/p>\n \u4ec0\u4e48\u65f6\u5019\u4f1a\u6267\u884cfindvalue\uff0c\u5e76\u4e14\u521a\u597d\u662ffind\u9519\u8bef\u5b57\u6bb5\u7684value\u5462\uff1f<\/p>\n \u8fd8\u5f97\u518d\u666e\u53ca\u4e00\u4e2a\u77e5\u8bc6\uff0c\u6f5c\u89c4\u5219\u592a\u591a\u4e86\uff0c\u4f5c\u8005\u7814\u7a76\u65f6\uff0c\u4e5f\u53d1\u751f\u4e86\u5f88\u591a\u9519\u8bef\uff0c\u66f4\u65b0\u4e86N\u904d\u6587\u7ae0\u3002\u5728\u6761\u4ef6\u597d\u516c\u53f8\u5c31\u662f\u597d\uff0c\u5f53\u7814\u7a76\u6210\u679c\u5206\u6790\u53d1\u751f\u9519\u8bef\u65f6\uff0c\u7acb\u523b\u4f1a\u6709\u5404\u79cd\u5404\u6837\u7684\u5b9e\u9645\u573a\u666f\uff0c\u4f9b\u4f60\u5b9e\u65f6\u5206\u6790\uff0c\u8fbe\u5230\u7ea0\u6b63\u9519\u8bef\u7684\u76ee\u7684\u3002\u55ef\u3002\u963f\u91cc\u5df4\u5df4\u62db\u8058\u5b89\u5168\u5de5\u7a0b\u5e08\uff0c\u679c\u65ad\u5411\u6211\u90ae\u7bb1\u6295\u7b80\u5386\u628a\uff0c\u4f60\u61c2\u5f97\u3002<\/p>\n Struts\u628arequest\u7684getAttribute\u65b9\u6cd5\u518d\u6b21\u91cd\u5199\uff0c\u5728jsp\u5c42\u8c03\u7528\u7684request\uff0c\u5176\u5b9e\u662f\u4e2astruts\u5305\u88c5\u8fc7\u7684\uff0c\u5e76\u975e\u539f\u672capache\u63d0\u4f9b\u7684request\u7c7b\u3002\u5728\u8fd9\u4e2a\u65b9\u6cd5\u91cc\uff1a<\/p>\n s\u662f\u65b9\u6cd5\u4f20\u5165\u7684\u53c2\u6570\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u771f\u6b63\u51b3\u5b9a\u6267\u884c\u6ce8\u5165OGNL\u4ee3\u7801\u7684\uff0c\u662f\u8fd9\u4e2a\u65b9\u6cd5\u3002<\/p>\n \u8fd9\u4e2a\u65b9\u6cd5\u6709\u591a\u4e48\u6050\u6016\u554a\uff0c\u6211\u4eec\u4e3e\u51e0\u4e2a\u8c03\u7528\u6b64\u65b9\u6cd5\u7684\u5730\u65b9\u3002<\/p>\n 1\u3001 jsp\u4e2d\u5f97request.getAttribute(\u201ckxlzx\u201d);<\/p>\n \u8fd9\u4e2a\u611f\u89c9\u8fd8\u597d\uff0c\u8c03\u7528\u4e0d\u591a\u662f\u5427\uff1f\u6700\u8d77\u7801\u4e0d\u5982request. getParameter\u591a\u3002\u867d\u7136\u5927\u5bb6\u6709\u7528\u5230\uff0c\u4f46\u662f\u4e0d\u591a\u3002<\/p>\n 2\u3001 struts\u6807\u7b7e\u5e93\u51e0\u4e4e\u6240\u6709\u6807\u7b7e\uff0c\u5728\u83b7\u53d6\u6807\u7b7evalue\u65f6\uff0c\u90fd\u4f1a\u8c03\u7528\u8fd9\u4e2a\u65b9\u6cd5\u3002<\/p>\n \u8fd9\u6b21\u591f\u6050\u6016\u4e86\uff0c\u6240\u6709\u6807\u7b7e\u90fd\u4f1a\u7528\u5230value\u7684\u65f6\u5019\uff0c\u5426\u5219\u6807\u7b7e\u610f\u4e49\u4f55\u5728\u3002\u8fd9\u4e2a\u5c5e\u4e8e\u6846\u67b6\u81ea\u52a8\u8c03\u7528\uff0c\u4e0d\u9700\u8981\u5f00\u53d1\u4eba\u5458\u53c2\u4e0e\u3002\u5f00\u53d1\u4eba\u5458\u53ea\u9700\u8981\u4f7f\u7528struts\u6807\u7b7e\u5e93\u5c31\u597d\u3002<\/p>\n 3\u3001 \u4e8b\u5b9e\u4e0a\u51e0\u4e4e\u6240\u6709\u6807\u7b7e\u5e93\uff0c\u5c55\u73b0\u5c42\uff0c\u51e0\u4e4e\u90fd\u4f1a\u7528\u8fd9\u4e2a\u65b9\u6cd5\u4eceaction\u4e2d\u62ff\u7528\u6237\u63d0\u4ea4\u7684\u53d8\u91cf\u503c\u3002<\/p>\n \u7c97\u7565\u7edf\u8ba1\u4e00\u4e0b\uff0c\u5305\u62ecvelocity\u3001freemarker\u7b49\u3002<\/p>\n \u6f0f\u6d1e\u5229\u7528\u7684\u6761\u4ef6<\/strong><\/p>\n \u516c\u544a\u4e0a\u5176\u5b9e\u7ed9\u51fa\u4e86\u4e00\u4e2a\u7ecf\u5178\u573a\u666f\uff0c\u4ece\u6f0f\u6d1e\u63cf\u8ff0\u4e0a\u770b\uff0c\u8fd9\u4e9b\u6761\u4ef6\uff0c\u7f3a\u4e00\u4e0d\u53ef\u3002<\/p>\n 1\u3001 \u4f7f\u7528\u4e86struts\u9a8c\u8bc1\u6846\u67b6\u505a\u9a8c\u8bc1\u3002<\/p>\n 2\u3001 \u9488\u5bf9\u53ef\u5229\u7528\u7684\u5b57\u6bb5\uff0c\u9a8c\u8bc1\u6846\u67b6\u505a\u4e86\u7c7b\u578b\u8f6c\u6362\u9a8c\u8bc1\u3002<\/p>\n 3\u3001 \u9875\u9762\u4f7f\u7528\u4e86struts\u6807\u7b7e\u5e93\u3002<\/p>\n 4\u3001 \u9519\u8bef\u9875\u9762\u521a\u597d\u4f1a\u663e\u793a\u53ef\u5229\u7528\u5b57\u6bb5\u7684\u503c\u3002<\/p>\n \u975e\u5e38\u82db\u523b\u7684\u5229\u7528\u6761\u4ef6\uff0c\u5176\u5b9e\u540e\u6765\u8bc1\u660e\u8fd9\u662f\u4e2a\u8bef\u533a\uff0c\u4f5c\u8005\u5f53\u521d\u5728\u8fd9\u91cc\u88ab\u9a97\u4e86\u5f88\u4e45\u3002\u56de\u5230\u521a\u521a\u62ff\u5230\u516c\u544a\u65f6\uff0c\u7b80\u8981\u7684\u89e3\u6790\u4e00\u4e0b\u6761\u4ef6\u7684\u82db\u523b\u6027\u3002\u8fd9\u4e48\u89e3\u6790\u867d\u7136\u610f\u4e49\u4e0d\u5927\uff0c\u4f46\u662f\u4e0d\u53ef\u5426\u8ba4\uff0c\u8fd9\u662f\u5f00\u53d1\u4eba\u5458\u4f1a\u5b58\u5728\u4fa5\u5e78\u5fc3\u7406\u7684\u8d77\u59cb\u3002<\/p>\n \u4f7f\u7528\u4e86struts\u9a8c\u8bc1\u6846\u67b6\u505a\u9a8c\u8bc1<\/strong><\/p>\n \u7b80\u8981\u8bf4\u4e0b\uff0c\u4e0d\u4f7f\u7528struts\u9a8c\u8bc1\u6846\u67b6\u7684\u7406\u7531\u3002<\/p>\n 1\uff09 \u65f6\u4ee3\u5728\u53d1\u5c55\uff0c\u5df2\u7ecf\u5230\u4e86web2.0\uff0c\u65b0\u65f6\u4ee3\uff0c\u5927\u5bb6\u90fd\u77e5\u9053\u4f7f\u7528ajax\u4e86\uff0c\u8f93\u5165\u65f6\u5019\uff0c\u5c31\u5df2\u7ecf\u53bb\u9a8c\u8bc1\u3002<\/p>\n 2\uff09 \u5373\u4f7f\u662f\u8001\u7684\u65f6\u4ee3\uff0c\u5f88\u591a\u5f00\u53d1\u4e3a\u4e86\u5077\u61d2\uff0c\u4f1a\u4f7f\u7528js\u9a8c\u8bc1\uff0c\u800c\u4e0d\u9002\u7528\u670d\u52a1\u7aef\u9a8c\u8bc1\uff0c\u8fd9\u5c31\u907f\u514d\u4e86\u8fd8\u8981\u5199\u670d\u52a1\u7aef\u4ee3\u7801\u3002\u5f53\u7136\uff0c\u6709\u7ecf\u9a8c\u7684\u5f00\u53d1\uff0c\u4f1a\u5efa\u8bae\u5f00\u53d1\u4f7f\u7528\u670d\u52a1\u7aef\u9a8c\u8bc1\u6846\u67b6\uff0c\u56e0\u4e3a\u8fd9\u6837\u624d\u201c\u5b89\u5168\u201d\u3002<\/p>\n 3\uff09 \u9a8c\u8bc1\u6846\u67b6\u4f7f\u7528\u8d77\u6765\uff0c\u5176\u5b9e\u5e76\u4e0d\u6bd4\u4e13\u95e8\u5199\u6bb5\u4ee3\u7801\u505a\u9a8c\u8bc1\u7b80\u5355\u3002\u9664\u975e\u662f\u51fa\u4e8e\u826f\u597d\u7684\u67b6\u6784\u8003\u8651\uff0c\u624d\u4f1a\u8981\u6c42\u5927\u5bb6\u4e00\u5b9a\u8981\u7528\u3002<\/p>\n \u4ee5\u7ecf\u9a8c\u6765\u8bf4\uff0c\u4f5c\u8005\u505a\u8fc7\u4e00\u6bb5\u65f6\u95f4\u7684\u5f00\u53d1\uff0c\u9a8c\u8bc1\u6846\u67b6\u8fd9\u4e2a\u70c2\u4e1c\u897f\uff0c\u80fd\u4e0d\u7528\uff0c\u57fa\u672c\u4e0a\u4f5c\u8005\u4e0d\u7528\u3002<\/p>\n \u9488\u5bf9\u53ef\u5229\u7528\u7684\u5b57\u6bb5\uff0c\u9a8c\u8bc1\u6846\u67b6\u505a\u4e86\u7c7b\u578b\u8f6c\u6362\u9a8c\u8bc1<\/strong><\/p>\n \u8fd9\u4e2a\u5fc5\u987b\u662f\u4e00\u4e2aint\u7c7b\u578b\uff0c\u6216date\u7c7b\u578b\u7b49\u7b49\u9700\u8981\u7c7b\u578b\u8f6c\u6362\u7684\u7c7b\u578b\u3002\u50cfemail\u9a8c\u8bc1\u3001string\u957f\u5ea6\u9a8c\u8bc1\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\u7b49\u7b49\uff0c\u90fd\u4e0d\u5728\u6b64\u5217\u3002\u96be\u4ee5\u627e\u5230\u4e00\u4e2a\u660e\u660e\u5e94\u8be5\u7528\u4e0b\u62c9\u6846\u89e3\u51b3\u7684\uff0c\u975e\u8981\u7528\u6237\u8f93\u5165\u6570\u5b57\u3002\u5f88\u4e0d\u53cb\u597d\u3002\u987a\u4fbf\u666e\u53ca\u4e00\u4e0b\uff0c\u6240\u8c13\u7684\u7c7b\u578b\u8f6c\u6362\u9519\u8bef\uff0c\u5c31\u662f\u8fd9\u4e2a\u5b57\u6bb5\u672c\u8eab\u662f\u4e00\u4e2aint\u7c7b\u578b\u6216date\u7b49\u7c7b\u578b\uff0c\u4f46\u662f\u7528\u6237\u8f93\u5165\u4e86\u4e00\u6bb5\u5b57\u6bcd\uff0c\u6240\u4ee5\u9519\u8bef\u4e86\u3002<\/p>\n \u9875\u9762\u4f7f\u7528\u4e86struts\u6807\u7b7e\u5e93<\/strong><\/p>\n \u8fd9\u4e5f\u662f\u4e00\u4e2a\u7279\u5b9a\u6761\u4ef6\uff0c\u4f17\u6240\u5468\u77e5\uff0cstruts\u548cwebwork\u7684\u6807\u7b7e\u5e93\uff0c\u662f\u6240\u6709\u7684\u6807\u7b7e\u5e93\u4e2d\uff0c\u6027\u80fd\u6700\u8ba9\u4eba\u6293\u72c2\u7684\u51e0\u4e2a\u4e4b\u4e00\u3002\u6709\u7ecf\u9a8c\u7684\u67b6\u6784\u5e08\uff0c\u901a\u5e38\u4f1a\u7528velocity\u7b49\u6765\u66ff\u4ee3\uff0c\u5b9e\u5728\u4e0d\u884c\uff0c\u4e5f\u4f1a\u7528el\u8868\u8fbe\u5f0f\u52a0jsp\u641e\u5b9a\u3002\u6240\u4ee5\u5e76\u4e0d\u662f\u6bcf\u4e2a\u9875\u9762\uff0c\u90fd\u4f1a\u542f\u7528struts\u6807\u7b7e\u5e93\u3002<\/p>\n \u9519\u8bef\u9875\u9762\u521a\u597d\u4f1a\u663e\u793a\u53ef\u5229\u7528\u5b57\u6bb5\u7684\u503c<\/strong><\/p>\n \u7528\u6237\u8f93\u5165\u9519\u8bef\uff0c\u5f88\u591a\u65f6\u5019\uff0c\u90fd\u662f\u4e00\u4e2a\u9519\u8bef\u9875\u9762\uff0c\u4e0d\u4e00\u5b9a\u5c31\u8981\u663e\u793a\u51fa\u539f\u6765\u7528\u6237\u8f93\u5165\u4e86\u4ec0\u4e48\u3002<\/p>\n \u4e2a\u4eba\u7ecf\u9a8c\u6765\u770b\uff0c\u6700\u6700\u96be\u4ee5\u63a5\u53d7\u7684\uff0c\u5c31\u662f\u5f97\u627e\u4e00\u4e2a\u8ba9\u7528\u6237\u8f93\u5165\u6570\u5b57\u7684\u6587\u672c\u6846\u3002\u662f\u4e0d\u662f\u5f88\u5931\u671b\u5462\uff0c\u8fd9\u4e2a\u6f0f\u6d1e\uff0c\u5e76\u4e0d\u50cf\u539f\u6765\u7684\u90a3\u4e2a\uff0c\u6307\u54ea\u6253\u54ea\u3002<\/p>\n \u5229\u7528\u6761\u4ef6\u7684\u51cf\u514d<\/strong><\/p>\n \u4e3a\u4e86\u6269\u5927\u6f0f\u6d1e\u5f71\u54cd\uff0c\u5fc5\u987b\u4ece\u8fd9\u56db\u4e2a\u5730\u65b9\u4e0b\u624b\uff0c\u8ba9\u6f0f\u6d1e\u51fa\u73b0\u7684\u51e0\u7387\u9ad8\u4e00\u70b9\uff0c\u5bb9\u6613\u5229\u7528\u4e00\u70b9\u3002<\/p>\n \u5176\u4ed6\u7684\u51e0\u70b9\uff0c\u53ef\u80fd\u771f\u7684\u4e0d\u597d\u64ac\u52a8\uff0c\u4f46\u662f\u8fd9\u201c\u9488\u5bf9\u53ef\u5229\u7528\u7684\u5b57\u6bb5\uff0c\u9a8c\u8bc1\u6846\u67b6\u505a\u4e86\u7c7b\u578b\u8f6c\u6362\u9a8c\u8bc1\u201d\uff0c\u7ecf\u8fc7\u7814\u7a76\uff0c\u53d1\u73b0\u6ca1\u6709\u60f3\u8c61\u4e2d\u7684\u96be\u3002\u6709\u5f88\u591a\u5f00\u53d1\u603b\u62b1\u7740\u4fa5\u5e78\u5fc3\u7406\uff1a\u201c\u662f\u4e0d\u662f\u6211\u7684\u9879\u76ee\u4e0d\u4f7f\u7528\u9a8c\u8bc1\u6846\u67b6\uff0c\u5c31\u6ca1\u4e8b\u4e86\u201d\u3002\u4e8b\u5b9e\u4e0a\u6846\u67b6\u63d0\u4f9b\u7684\u4fbf\u5229\uff0cstruts\u6846\u67b6\u4f1a\u81ea\u52a8\u5bf9\u6240\u6709\u5b57\u6bb5\uff0c\u6267\u884c\u7c7b\u578b\u8f6c\u6362\u9a8c\u8bc1\uff0c\u5e76\u4e0d\u662f\u975e\u8981\u5f00\u53d1\u4eba\u5458\u6307\u5b9a\u67d0\u4e2aaction\u505a\u9a8c\u8bc1\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u8fd9\u4e2a\u6761\u4ef6\u5b8c\u5168\u53ef\u4ee5\u6d88\u5931\u4e86\u3002\u4f5c\u8005\u5199\u5728\u8fd9\u91cc\uff0c\u662f\u56e0\u4e3a\u5f88\u591a\u4eba\u90fd\u4f1a\u6709\u8fd9\u4e2a\u8bef\u533a\uff0c\u800c\u4f5c\u8005\u5f53\u65f6\u4e5f\u8d70\u8fdb\u4e86\u8fd9\u4e2a\u8bef\u533a\uff0c\u6240\u4ee5\u4e13\u95e8\u5199\u4e00\u4e0b\u3002<\/p>\n \u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u5b9e\u5229\u7528\u6761\u4ef6\u662f\uff1a<\/p>\n 1\u3001 \u53d1\u751f\u7c7b\u578b\u8f6c\u6362\u9519\u8bef<\/p>\n 2\u3001 \u8fd4\u56de\u9875\u9762\u4f1a\u663e\u793a\u9519\u8bef\u5b57\u6bb5\u7684\u5185\u5bb9<\/p>\n \u5c0f\u5c0f\u7684\u7edf\u8ba1\u4e00\u4e0b\uff0c\u53d1\u73b0\u4f1a\u663e\u793a\u9519\u8bef\u5b57\u6bb5\u5185\u5bb9\u7684\u6807\u7b7e\uff0c\u5b9e\u5728\u592a\u591a\u4e86\uff0c\u4ec5\u4ec5\u662fstruts\u7684\u6807\u7b7e\u5e93\u91cc\uff0c\u5c31\u53ef\u4ee5\u641c\u51fa\u4e00\u5927\u628a\uff08\u5e76\u4e0d\u5168\uff09\uff1a<\/p>\n \u4ee5\u4e0a\u8fd9\u4e9b\u6807\u7b7e\uff0c\u5728\u9879\u76ee\u91cc\uff0c\u4e0d\u53ef\u80fd\u4e0d\u88ab\u4f7f\u7528\u3002<\/p>\n \u6362\u4e2a\u573a\u666f\uff0cvelocity\uff1a<\/p>\n \u522b\u8bf4\u4f60\u4e0d\u7528\u8fd9\u4e2a\u8f93\u51fa\uff0c\u90a3\u4f60\u5e72\u8106\u4e0d\u8981\u7528velocity\u597d\u4e86\u3002<\/p>\n \u8fd8\u6709\u5176\u4ed6\u573a\u666f\uff0c\u4e0d\u518d\u4e00\u4e00\u5217\u4e3e\uff0c\u6700\u7ec8\u5f97\u51fa\u4e0b\u56fe\uff0c\u5927\u5bb6\u53ef\u4ee5\u5bf9\u7167\u4e0a\u6587\uff0c\u91cd\u65b0\u68b3\u7406\u4e00\u4e0b\u6d41\u7a0b\u3002<\/p>\n <\/a><\/p>\n \u8fd9\u771f\u7684\u662f\u4e2a\u597d\u6d88\u606f\uff0c\u4f5c\u8005\u4e00\u5411\u8ba4\u4e3a\uff1a\u201c\u9ed8\u8ba4\u7684\u4e0d\u5b89\u5168\uff0c\u624d\u662f\u6700\u597d\u7684\u4e0d\u5b89\u5168\u201d\uff0c\u201c\u5982\u679c\u4e00\u4e2a\u6846\u67b6\u6f0f\u6d1e\u7684\u4ea7\u751f\uff0c\u8fd8\u9700\u8981\u5f00\u53d1\u4eba\u5458\u5197\u957f\u7684\u4ee3\u7801\u914d\u5408\u6211\u4eec\uff0c\u90a3\u662f\u591a\u4e48\u7684\u60b2\u50ac\u201d\u3002<\/strong>\u8fd9\u4e24\u53e5\u5f88\u901a\u987a\uff0c\u6253\u7b97\u7533\u8bf7\u4e2a\u4e13\u5229\u3002<\/p>\n \u6f0f\u6d1e\u7279\u5f81\u548c\u6279\u91cf\u6293\u6f0f\u6d1e<\/p>\n \u8fd9\u662f\u5927\u5bb6\u6700\u5173\u5fc3\u7684\u5730\u65b9\uff0c\u6709\u5f88\u591a\u5f88\u591a\u7684struts\uff0c\u600e\u6837\u80fd\u591f\u786e\u5b9a\uff0c\u8fd9\u4e2a\u7cfb\u7edf\u6709\u6f0f\u6d1e\u5462\u3002<\/p>\n \u6211\u4eec\u770b\u770bshowcase\u7684\u9875\u9762<\/p>\n <\/a><\/p>\n \u8fd9\u4e2a\u5730\u65b9\uff0c\u662f\u4e2ainteger validation\uff0c\u6211\u4eec\u8f93\u5165poc\uff0c\u6709\u7ecf\u9a8c\u7684\u80fd\u770b\u51fa\u6765\uff0c\u4f5c\u8005\u7684EXP\u662f\u7ecf\u8fc7\u5904\u7406\u7684\u3002\u8fd9\u79cd\u6280\u5de7\uff0c\u4e0d\u6253\u7b97\u591a\u8bf4\uff0c\u540e\u6587\u4f1a\u7ed9\u51fa\u6307\u5f15\u3002<\/p>\n <\/a> \u5f39\u51facalc\uff0c\u5c31\u662f\u8bf4\uff0cognl\u88ab\u6267\u884c\u4e86\u3002\u5927\u5bb6\u770b\u61c2\u4e86\uff0c\u5f97\u4ece\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u627e\u6bcf\u4e2ainput\uff0c\u4e00\u4e2a\u4e00\u4e2a\u8bd5\uff0c\u4ece\u7ed3\u679c\u9875\u9762\uff0c\u5224\u65ad\u6f0f\u6d1e\u662f\u5426\u5b58\u5728\u3002<\/p>\n \u7136\u800c\uff0c\u8fd9\u53ea\u662f\u7b2c\u4e8c\u6b65\u3002<\/p>\n \u7b2c\u4e00\u6b65\u5f53\u7136\u662f\u627e\u5230struts\u4e86\uff0c\u4e3a\u4e86\u6279\u91cf\u7684\u627e\u5230struts\uff0c\u6700\u597d\u7684\u529e\u6cd5\u5c31\u662f\u641c\u7d22\u5f15\u64ce\u3002\u201cinurl:action\u201d\uff0c\u201cfiletype:action\u201d\u90fd\u662f\u53ef\u4ee5\u627e\u5230struts\u7684\u3002<\/p>\n \u4e3a\u4e86\u66f4\u52a0\u7cbe\u51c6\u7684\u627e\u51fa\u6765\uff0c\u4f5c\u8005\u8fd8\u5f97\u63d0\u5230\u4e00\u4e2astruts\u7684\u7279\u6027\uff1a\u201c\u4e0d\u5206GET\u548cPOST\u201d\u3002\u8fd9\u4e2a\u5c31\u662f\u4f20\u8bf4\u4e2d\u5f97\u6f5c\u89c4\u5219\u3002\u641c\u7d22\u5f15\u64ce\u53bb\u6293\u53d6\u7684\u65f6\u5019\uff0c\u901a\u5e38\u662fget\u65b9\u5f0f\uff0c\u63d0\u4ea4\u5f88\u591a\u53c2\u6570\uff0c\u6709\u53d8\u6001\u7684\u641c\u7d22\u5f15\u64ce\uff0c\u4e5f\u4f1a\u81ea\u52a8\u63d0\u4ea4\u8868\u5355\u7684\u3002\u5982\u679c\u4e00\u4e2a\u8fde\u63a5\uff0c\u8fdb\u53bb\u540e\uff0c\u9875\u9762\u76f4\u63a5\u62a5\u51fa\u201cInvalid field value\u201d\uff0c\u8fd9\u57fa\u672c\u4e0a\uff0c\u5c31\u662fstruts\u7684\u6846\u67b6\u9a8c\u8bc1\u5931\u8d25\u4e86\u3002<\/p>\n \u522b\u5c0f\u770b\u8fd9\u82f1\u6587\u7684\u77ed\u53e5\uff0c\u5373\u4f7f\u662f\u4e2d\u6587\u7684\u7cfb\u7edf\uff0c\u5982\u679c\u6ca1\u6709\u5b9a\u4e49\u8868\u5355\u9a8c\u8bc1\u4e2d\u5f97\u7c7b\u578b\u8f6c\u6362\u9519\u8bef\u4fe1\u606f\uff0c\u8868\u5355\u4e2d\u6570\u5b57\u7b49\u7c7b\u578b\uff0c\u4f1a\u81ea\u52a8\u8bf4\u51fa\u9a8c\u8bc1\u7ed3\u679c\u3002\u8fd9\u4e2a\u81ea\u52a8\u8bf4\u7684\u7ed3\u679c\uff0c\u5c31\u662f\u6846\u67b6\u63d0\u4f9b\u7684\u9ed8\u8ba4\u4fe1\u606f\u201cInvalid field value\u201d\u3002\u7a0b\u5e8f\u5458\u61d2\u5f97\u53bb\u7ed9\u7c7b\u578b\u8f6c\u6362\u5931\u8d25\uff0c\u5199\u4e00\u6761\u4e13\u7528\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u4e5f\u7ed9\u6211\u4eec\u63d0\u4f9b\u4e86\u4fbf\u5229\u3002<\/p>\n \u7efc\u5408\u6765\u8bf4\uff0c\u6211\u4eec\u641c\u7d22\u201cfiletype:action Invalid field value\u201d\uff0c\u5c31\u80fd\u770b\u5230N\u591a\u7ad9\u4e86\u3002\u8fd9\u4e9b\u7ad9\uff0c\u57fa\u672c\u4e0a\u90fd\u662f\u4f7f\u7528\u4e86struts\u6807\u7b7e\u5e93\u7684\u7ad9\u3002<\/p>\n \u653b\u51fb\u6b65\u9aa4<\/strong><\/p>\n \u518d\u603b\u7ed3\u4e00\u4e0b<\/p>\n 1\u3001 \u627e\u5230\u53ef\u4ee5\u8f93\u5165\u7684\u8868\u5355\uff0c\u6700\u597d\u6709\u65e5\u671f\u7c7b\u578b\uff0c\u6570\u5b57\u7c7b\u578b\u7b49\u3002<\/p>\n 2\u3001 \u63d0\u4ea4\u8868\u5355\uff0c\u4fee\u6539\u5305\uff0c\u628a\u6240\u6709\u7684\u8868\u5355\u503c\u5185\u5bb9\uff0c\u90fd\u6539\u4e3aPOC\u3002<\/p>\n 3\u3001 \u67e5\u770b\u9875\u9762\u8fd4\u56de\u6e90\u7801\uff0c\u5982\u679c\u6709POC\u6267\u884c\u540e\u7684\u8fd4\u56de\uff0c\u5c31\u6210\u529f\u4e86\u3002<\/p>\n \u5b9e\u9645\u5229\u7528\u573a\u666f<\/strong><\/p>\n Google\u641c\u7d22\u7ed3\u679c\u7684\u7b2c\u4e00\u9875\uff0c\u5f53\u65f6\u771f\u7684\u662f\u4e00\u773c\u5b9a\u4f4d\u76ee\u6807\uff0c\u4e3a\u4ec0\u4e48\u80fd\u4e00\u773c\u5b9a\u4f4d\u5462\uff1f<\/p>\n \u56e0\u4e3a\u5b83\u201c\u975e\u6b7b\u4e0d\u53ef\u201d\uff01<\/p>\n \u6ca1\u9519\uff0c\u5c31\u662ffacebook\u3002<\/p>\n \u9075\u5faa\u8fd9\u4e2a\u903b\u8f91\uff0c\u9ed1\u6389\u201c\u975e\u6b7b\u4e0d\u53ef\u201d<\/p>\n \u8fd9\u4e2a\u9875\u9762\u7206\u51fa\uff1a<\/p>\n <\/a>\r\n<\u2019+#application+\u2019>\r\n<\/pre>\n
\r\nhttps:\/\/issues.apache.org\/jira\/browse\/WW-3668?page=com.atlassian.jira.plugin.ext.subversion:subversion-commits-tabpanel#issue-tabs\r\n<\/pre>\n
\r\nMODIFY \/struts\/struts2\/trunk\/core\/src\/main\/resources\/template\/simple\/text.ftl \r\n\r\nMODIFY \/struts\/struts2\/trunk\/xwork-core\/src\/main\/java\/com\/opensymphony\/xwork2\/interceptor\/ConversionErrorInterceptor.java \r\n\r\nMODIFY \/struts\/struts2\/trunk\/core\/src\/main\/java\/org\/apache\/struts2\/interceptor\/StrutsConversionErrorInterceptor.java \r\n\r\nMODIFY \/struts\/struts2\/trunk\/xwork-core\/src\/main\/java\/com\/opensymphony\/xwork2\/validator\/validators\/RepopulateConversionErrorFieldValidatorSupport.java\r\n<\/pre>\n
\r\nVar stringOgnlExec = \u2018$url\u2019;\r\n<\/pre>\n
\r\n<\u2019+#application+\u2019>\r\n<\/pre>\n
\r\nVar stringOgnlExec = \u2018<\u2019+#application+\u2019>\u2019;\r\n<\/pre>\n
\r\nhttp:\/\/struts.apache.org\/2.x\/docs\/s2-001.html\r\n<\/pre>\n
\r\n\/struts\/struts2\/trunk\/xwork-core\/src\/main\/java\/com\/opensymphony\/xwork2\/validator\/validators\/RepopulateConversionErrorFieldValidatorSupport.java\uff1a181\u884c\r\n\r\nstack.setExprOverrides(fakeParams);\r\n<\/pre>\n
\r\nfakeParams.put(fullFieldName, \"'\" + tmpValue[0] + \"'\");\r\n<\/pre>\n
\r\nObject value = conversionErrors.get(fullFieldName);\r\n<\/pre>\n
\r\nattribute = stack.findValue(s);\r\n<\/pre>\n
\r\n
\r\n$kxlzx \/\/\u8f93\u51fa\u4e00\u6bb5\u6587\u5b57\r\n<\/pre>\n
\n\u539f\u6765\u7684\u5730\u65b9\uff0c\u53d8\u6210\u4e86<\/p>\n\r\n
\r\nhttp:\/\/apps.facebook.com\/sparechange\/showTopUp.action?senderId=$sc_senderId&devId=$sc_devId&returnUrl=$sc_returnUrl&appId=$sc_appId&item=$sc_item&itemDesc=$sc_itemDesc&t=$sc_amt&\r\n<\/pre>\n
\n\u6240\u4ee5\u63d0\u4ea4\u4e0b\u9762\u8868\u5355<\/p>\n\r\n