In struts2 internationalization in Arabic how to automatically change cursor in textboxes to rtl?

我与影子孤独终老i 提交于 2019-12-04 01:43:04

问题


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.


回答1:


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>



回答2:


Try this one(not tested)

Well its simple. Lets assume that you are storing the current selected language in session with name currlang . Then on each text-box do

<s:textfield label="Some Test Box" name="nameit" cssStyle="<s:if test="#session['currlang'] == 'arbic'">direction: rtl;</s:if>"/>



来源:https://stackoverflow.com/questions/14973594/in-struts2-internationalization-in-arabic-how-to-automatically-change-cursor-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!