****100分 求struts国际化例子!多谢了**** 要是用户选择, 那么就作个 处理的 action 读取不同的 .properity 文件就可以了! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 struts自己的例子就有就是判断session里面的属性而以你好好看看例子大部分问题都有答案 public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes we will need HttpSession session = request.getSession(); Locale locale = getLocale(request); String language = null; String country = null; String page = null; try { language = (String) PropertyUtils.getSimpleProperty(form, "language"); country = (String) PropertyUtils.getSimpleProperty(form, "country"); page = (String) PropertyUtils.getSimpleProperty(form, "page"); } catch (Exception e) { log.error(e.getMessage(), e); } if ((language != null && language.length() > 0) && (country != null && country.length() > 0)) { locale = new java.util.Locale(language, country); } else if (language != null && language.length() > 0) { locale = new java.util.Locale(language, ""); } session.setAttribute(Globals.LOCALE_KEY, locale); if (null==page) return mapping.findForward("success"); else return new ActionForward(page); } 我给你发个,网上高手写的http://blog.csdn.net/duoshanx/archive/2004/08/23/82529.aspx 嗯,你也可以继承struts的类,好像是requestProcess吧,然后在这个里写你对local的处理,这样,你以后的Action都只继承你自己的就行了 怎么我用了native2ascii 就提示native2ascii不是内部命令我该怎么设置? 自己解决了 结帖喽 我发现现在struts精通的太少了 定时器能否加入线程池进行线程管理呢? JTable中的setValueAt不能被调用 关于override的问题 dbswing中的JdbComboBox控件和表格JdbTable绑定问题 一个map问题 排序问题: 房地产项目中的一段代码, 室号按从高层到低层排列, 请问如何实现 设置java环境怎么不行啊? 很简单的关于输入的执行顺序问题,可是我不明白,麻烦理解的帮我看一下(在线等待) 学java swing awt用什么书 java表格JTABLE如何控制编辑与只读? 阿拉伯数字转中文数字的问题? ****请教struts 国际化问题,100分。请大家帮忙****
就是判断session里面的属性而以
你好好看看例子
大部分问题都有答案
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception { // Extract attributes we will need
HttpSession session = request.getSession();
Locale locale = getLocale(request); String language = null;
String country = null;
String page = null; try {
language = (String)
PropertyUtils.getSimpleProperty(form, "language");
country = (String)
PropertyUtils.getSimpleProperty(form, "country");
page = (String)
PropertyUtils.getSimpleProperty(form, "page");
} catch (Exception e) {
log.error(e.getMessage(), e);
} if ((language != null && language.length() > 0) &&
(country != null && country.length() > 0)) {
locale = new java.util.Locale(language, country);
} else if (language != null && language.length() > 0) {
locale = new java.util.Locale(language, "");
} session.setAttribute(Globals.LOCALE_KEY, locale); if (null==page) return mapping.findForward("success");
else return new ActionForward(page); }
http://blog.csdn.net/duoshanx/archive/2004/08/23/82529.aspx
好像是requestProcess吧,
然后在这个里写你对local的处理,
这样,你以后的Action都只继承你自己的就行了
我该怎么设置?