GeeCON Prague 2014*
The moose likes Struts and the fly likes struts2 selectbox multi lingual options Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 selectbox multi lingual options" Watch "struts2 selectbox multi lingual options" New topic
Author

struts2 selectbox multi lingual options

suresh koppa
Greenhorn

Joined: May 09, 2012
Posts: 3
Hi All
I am using struts2 for my multi lingual web application.Here I am facing a problem with select box ,which contains options in different languages.
(I am using standard HTML code for representation of the characters in different languages).
Problem is selectbox not showing options in diff languages,rather it is showing html code as it is.
in s:property tag,s:textbox tag it can be solved using "escapeHtml=false" option,which is not working in selectbox.
Is there any provision to show those things in struts2 select box.

Regards
Suresh.K
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Provide more details how you doing it.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
suresh koppa
Greenhorn

Joined: May 09, 2012
Posts: 3
Hi Mohana Rao
Thanks for reply.The actual Problem is
List of values as HTML codes(for example प for Hindi letter 'pa') are coming from the DB to my application.That values I need to
display as options of drop-down.
Here The list of options are displayed as पर instead of Hindi letters 'pa' 'ra'.
(Problem is & is rendered as & instead of & so for 'pa' it is becoming '&#2346'. which browser is unable
to identify as HTML code ).


Regards
Suresh

arati jadhav
Greenhorn

Joined: Jun 07, 2012
Posts: 1
found this type of error please help me..........
log4j:WARN No appenders could be found for logger (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider).
log4j:WARN Please initialize the log4j system properly.
Jun 7, 2012 1:32:48 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - action - file:/D:/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/HelloWorld/WEB-INF/classes/struts.xml:12:79
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:428)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: Unable to load configuration. - action - file:/D:/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/HelloWorld/WEB-INF/classes/struts.xml:12:79
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)
... 20 more
Caused by: Action class [com.vns.struts.HelloworldAction] not found - action - file:/D:/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/HelloWorld/WEB-INF/classes/struts.xml:12:79
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:420)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:365)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:479)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
... 22 more
Jun 7, 2012 1:32:48 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Jun 7, 2012 1:32:48 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/HelloWorld] startup failed due to previous errors
Jun 7, 2012 1:32:48 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/HelloWorld] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1fe8ce8]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@d4d66b]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Jun 7, 2012 1:32:48 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/HelloWorld] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@149105b]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1d0d45b]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Jun 7, 2012 1:32:49 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jun 7, 2012 1:32:49 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jun 7, 2012 1:32:49 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
Jun 7, 2012 1:32:49 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1699 ms
suresh koppa
Greenhorn

Joined: May 09, 2012
Posts: 3

The actual Problem is
List of values as HTML codes(for example प for Hindi letter 'pa') are coming from the DB to my application.That values I need to
display as options of drop-down.
Here The list of options are displayed as पर instead of Hindi letters 'pa' 'ra'.


(Problem is & is rendered as &-amp; instead of & so for 'pa' it is becoming '&-amp;#2346'. which browser is unable
to identify as HTML code[ignore -]
).

Please reply back immediately

Regards
Suresh
 
GeeCON Prague 2014
 
subject: struts2 selectbox multi lingual options