Both the source for the "blank" [1] and the "showcase" [2] example applications show how to do this.
[1] - http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/blank/ [2] - http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/showcase/ Nils-H On Mon, Oct 27, 2008 at 9:26 AM, Julien HENRY <[EMAIL PROTECTED]> wrote: > Hi, > > Thanks for your help. > > What is the best way to do it? Can I add something like "/?action=index" in > my web.xml in welcome-file? > > Thanks > > Julien > > > > ----- Message d'origine ---- > De : Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> > À : Struts Users Mailing List <user@struts.apache.org> > Envoyé le : Lundi, 27 Octobre 2008, 6h10mn 34s > Objet : Re: Re : How to make I18N working on index.jsp > > If you are invoking the jsp directly, the struts2 dispatcher will not > be invoked and the struts2 tags will most likely not work. Try having > your index.jsp dispatch to an index action instead. > > Nils-H > > Den 26. okt.. 2008 kl. 23.15 skrev Julien HENRY <[EMAIL PROTECTED]>: > >> index.jsp : >> >> <%@ page contentType="text/html charset=UTF-8"%> >> <%@ taglib prefix="s" uri="/struts-tags"%> >> <html> >> <head> >> <s:head theme="ajax"/> >> <script type="text/javascript"> >> dojo.event.topic.subscribe("/save", function(data, type, >> request) { >> if(type == "load") { >> dojo.byId("id").value = ""; >> dojo.byId("firstName").value = ""; >> dojo.byId("lastName").value = ""; >> dojo.byId("dob").value=""; >> } >> }); >> >> dojo.event.topic.subscribe("/edit", function(data, type, >> request) { >> if(type == "before") { >> var id = data.split("_")[1]; >> >> var tr = dojo.byId("row_"+id); >> var tds = tr.getElementsByTagName("td"); >> >> dojo.byId("id").value = id; >> dojo.byId("firstName").value = >> dojo.string.trim(dojo.dom.textContent(tds[0])); >> dojo.byId("lastName").value = >> dojo.string.trim(dojo.dom.textContent(tds[1])); >> >> if ( dojo.dom.textContent(tds[2]).length > 0 ){ >> var dob = >> dojo.date.parse(dojo.dom.textContent(tds[2]).substring(0,8), >> {"datePattern":"MM/dd/yy"}); >> >> dojo.widget.byId("dob").datePicker.setDate(dob); >> }else{ >> dojo.widget.byId("dob").inputNode.value =""; >> } >> } >> }); >> </script> >> </head> >> <body> >> <s:url action="list" id="descrsUrl"/> >> <s:url id="en"> >> <s:param name="request_locale">en</s:param> >> </s:url> >> <s:url id="fr"> >> <s:param name="request_locale">fr</s:param> >> </s:url> >> <s:a href="%{en}">English</s:a> <s:a href="%{fr}">França >> is</s:a> >> >> <div style="width: 300px;border-style: solid"> >> <div style="text-align: right;"> >> <s:a theme="ajax" notifyTopics="/refresh"><s:text >> name="refresh"/></s:a> >> </div> >> <s:div id="persons" theme="ajax" href="%{descrsUrl}" >> loadingText="Loading..." listenTopics="/refresh"/> >> </div> >> >> <br/> >> >> <div style="width: 300px;border-style: solid"> >> <p>Person Data</p> >> <s:form action="save" validate="true" > >> <s:textfield id="id" name="person.id" >> cssStyle="display:none"/> >> <s:textfield id="firstName" label="% >> {getText('person.firstName')}" name="person.firstName"/> >> <s:textfield id="lastName" label="% >> {getText('person.lastName')}" name="person.lastName"/> >> <s:datetimepicker id="dob" label="Format (yyyy-MM- >> dd)" displayFormat="yyyy-MM-dd" name="person.dob"/> >> <s:submit theme="ajax" targets="persons" >> notifyTopics="/save"/> >> </s:form> >> </div> >> >> >> </body> >> </html> >> >> >> >> ----- Message d'origine ---- >> De : Martin Gainty <[EMAIL PROTECTED]> >> À : Struts Users Mailing List <user@struts.apache.org> >> Envoyé le : Dimanche, 26 Octobre 2008, 23h02mn 45s >> Objet : RE: How to make I18N working on index.jsp >> >> >> please display your jsp >> >> thanks >> Martin >> ______________________________________________ >> Disclaimer and confidentiality note >> Everything in this e-mail and any attachments relates to the >> official business of Sender. This transmission is of a confidential >> nature and Sender does not endorse distribution to any party other >> than intended recipient. Sender does not necessarily endorse content >> contained within this transmission. >> >> >>> Date: Sun, 26 Oct 2008 21:51:34 +0000 >>> From: [EMAIL PROTECTED] >>> Subject: How to make I18N working on index.jsp >>> To: user@struts.apache.org >>> >>> >>> Hi, >>> >>> I'm following the tutorial here: >>> http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html >>> >>> And now I would like to make I18N working. >>> >>> I added <constant name="struts.custom.i18n.resources" >>> value="messages"></constant> in struts.xml and I have >>> messages.properties and messages_en.properties in src/main/resources >>> >>> Then I added some <s:text name="key"/> in index.jsp and list.jsp. >>> >>> But only the one that are in list.jsp are translated when I switch >>> local. Do you know what is the problem? >>> >>> Thanks >>> >>> Julien >>> >>> P.S. : I was also bitten by >>> http://dojotoolkit.org/forum/dojo-0-4-x-legacy/dojo-0-4-x-support/firefox-3-and-struts-2-theme-ajax-render-issues >>> . Do you know if it will be solved in struts-2.1.x with dojo-plugin? >>> >>> >>> >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >> >> _________________________________________________________________ >> Stay organized with simple drag and drop from Windows Live Hotmail. >> http://windowslive.com/Explore/hotmail? >> ocid=TXT_TAGLM_WL_hotmail_102008 >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]