在struts2国际化阿拉伯语中,如何自动将文本框中的光标更改为rtl? [英] In struts2 internationalization in Arabic how to automatically change cursor in textboxes to rtl?

查看:129
本文介绍了在struts2国际化阿拉伯语中,如何自动将文本框中的光标更改为rtl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Struts2应用程序中实现了国际化,并且运行良好,但是当我选择阿拉伯语作为语言时,如何在所有jsp的所有文本框中将光标位置自动更改为RTL?

I have implemented internationalization in my Struts2 application and it is working fine, but how do I change the cursor position automatically in all the textboxes in all the jsp to RTL when I select Arabic as the language?

如果您能给我一个简单的例子,那将非常有帮助.

If you could give me a simple example it would be very helpful.

推荐答案

如何使用Struts2 <s:if>标记检查当前的语言环境,将dir属性添加到JSP-s中的<html>标记中:

How about adding dir attribute to the <html> tag in JSP-s, using Struts2 <s:if> tag to check current locale language:

<html <s:if test="locale.language == 'ar'">dir="rtl"</s:if> >
  ...
</html>

这篇关于在struts2国际化阿拉伯语中,如何自动将文本框中的光标更改为rtl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆