Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could try this:</p> <pre><code>&lt;spring:url var="langChangeUrl" value =""/&gt; &lt;form action="${langChangeUrl}" method="get"&gt; &lt;select name="lang" &gt; &lt;option value="de"&gt;Deutsch&lt;/option&gt; &lt;option value="en"&gt;English&lt;/option&gt; &lt;/select&gt; &lt;input type="submit" value="change"&gt; &lt;/form&gt; </code></pre> <p><em>I did not tested it, because I normaly used links to switch the language, so I have addepted the link based code to this form based. -- anyway even if it does not work 100% it should ilustrate the way you need to go.</em></p> <p><strong>Added</strong> For the (form viewpoint of usabilty critical) case that you want do display the Languages in a special languge, then you should use language files (one for each language), and <code>&lt;spring:message&gt;</code> to print them: </p> <pre><code>&lt;spring:url var="langChangeUrl" value =""/&gt; &lt;form action="${langChangeUrl}" method="get"&gt; &lt;select name="lang" &gt; &lt;option value="de"&gt;&lt;spring:message code="languageName.de"&gt;&lt;/option&gt; &lt;option value="en"&gt;&lt;spring:message code="languageName.en"&gt;&lt;/option&gt; &lt;/select&gt; &lt;input type="submit" value="change"&gt; &lt;/form&gt; </code></pre> <p>*messages_de.properties*</p> <pre><code>languageName.de=Deutsch languageName.en=Englisch </code></pre> <p>*messages_en.properties*</p> <pre><code>languageName.de=German languageName.en=English </code></pre> <p><em>messages.properties</em></p> <pre><code>languageName=German languageName=English </code></pre> <p>And you need to configure spring to load the language propertie files:</p> <pre><code>&lt;!-- Resolves localized messages*.properties files for internationalization. --&gt; &lt;bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource" p:basenames="WEB-INF/i18n/messages" p:fallbackToSystemLocale="false"/&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload