<script type="text/javascript">
function show(){
var f="#wer中文测试";
f = encodeURIComponent(encodeURIComponent(f));
test.value = f;
var url = "servlet/Test?f="+f;
var rtv = showModalDialog(url,"","dialogWidth:820px; dialogHeight:620px; status:0;help:0;scrolling:auto");
}
</script>
<body><input id="test" value=""> <input type="button" value="TEST" onclick="show()" />
</body>
package com.yourcompany.struts.action;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.yourcompany.struts.form.TestForm; public class TestAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException {
TestForm testForm = (TestForm) form; response.setCharacterEncoding("UTF-8"); String name=testForm.getName();
String pwd=testForm.getPwd(); response.setCharacterEncoding("UTF-8");
String myname=request.getParameter("myname");
myname=URLDecoder.decode(myname, "UTF-8");
String mypwd=request.getParameter("mypwd");
mypwd=URLDecoder.decode(mypwd, "UTF-8"); System.out.println(name);
System.out.println(pwd);
System.out.println(myname);
System.out.println(mypwd); request.setAttribute("name", name);
request.setAttribute("pwd", pwd);
request.setAttribute("myname", myname);
request.setAttribute("mypwd", mypwd); return mapping.findForward("go");
}
}

最新文章

  1. Android WebView加载本地html并实现Java与JS交互
  2. kendoUI grid 过滤时出错:TypeError toLowerCase is not a function
  3. MSSQL 判断一个时间段是否在另一个时间段内!
  4. Mac终端编译运行C++
  5. django中的Model模型一:
  6. python 函数/列表的应用
  7. Excel图表-&quot;DNA&quot;图
  8. BZOJ 1042: [HAOI2008]硬币购物 [容斥原理]
  9. Beta 第三天
  10. P1744 采购特价商品 最短路径
  11. 一 Struts框架(上)
  12. SpringCloud和Springboot
  13. elasticsearch-dump 迁移es数据 (elasticdump)
  14. EditPlus(4.0.0.395)中文免激活绿色版
  15. Swift语言精要 - Dictionary(字典)
  16. 【转】bit、byte、位、字节、汉字的关系
  17. maven 的聚合
  18. 【原】[UIImage imageWithContentsOfFile:]引发的图片无法显示的问题
  19. 课下实践——实现Mypwd
  20. MySQL同步状态双Yes的假象及seconds_behind_master的含义

热门文章

  1. Linux查看配置文件中未被注释的有效配置行
  2. Android-Intent and Intent Filters
  3. LeetCode(87) Gray Code
  4. UVA - 10410 Tree Reconstruction (根据dfs序和bfs序恢复一颗树)
  5. Android开发——程序锁的实现(可用于开发钓鱼登录界面)
  6. PS学习笔记(03)
  7. Leetcode 307.区域检索-数组可修改
  8. PTA 04-树4 是否同一棵二叉搜索树 (25分)
  9. _063_Android_Android内存泄露
  10. poj1091:跳蚤【容斥原理】