facebook

Getting I18N context-param Entries into web.xml

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #265085 Reply

    Lance Drake
    Member

    As I understand it, in order to make use of I18N internationalization string substitution files for different locales, you have to identify the ‘prefix’ for the properties files via entries in web.xml – as in:

    
    <web-app>
        <context-param>
            <param-name>javax.servlet.jsp.jstl.fmt.locale</param-name>
            <param-value>en</param-value>
        </context-param>
        <context-param>
            <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
            <param-value>intl</param-value>
        </context-param>
    </web-app>
    
    

    Then the file for English strings file will be named “intl_en.properties” and, as far as as the Eclipse project goes, such files should be located in the src folder – whereupon they will later be copied into the WEB-INF/classes/web folder of the deployment. OK. This is all happening without a problem. However, the references to context-param are nowhere to be found.

    A note was found indicating that the context-param entries could be contained in a file named websettings.xml – and contained in the merge folder of the project – but this action has no effect. Creating a file named web.xml in the merge folder has no effect, either. BTW – the ‘merge’ dir item in the XDoclet deploymentdescriptor is both checked and named within the Project properties.

    Attempts to simply indicate the context-param entries in the Javadoc section are ignored:

    
    
     * @web.context-param
     *              param-name="javax.servlet.jsp.jstl.fmt.locale"
     *              param-value="en"
     *              
     * @web.context-param
     *              param-name="javax.servlet.jsp.jstl.fmt.localizationContext"
     *              param-value="intl"
    
    

    QUESTION: How does one cause context-param entries to appear in the web-xml file?

    Any assistance/suggestions would be greatly appreciated.

    Lance Drake

    #265091 Reply

    Riyad Kalla
    Member

    Lance,
    Is this an XDoclet generation question?

    #265107 Reply

    Lance Drake
    Member

    Hi support-rkalla

    Well – the line gets blurry sometimes – but I am looking for the mechanism to do what appears must be done in order to enable I18N translation. Ultimately the target is an XDoclet document – but, if you look upstream where the instructions to create the entries have to be located, it appears to be an Eclipse parameters or settings issue.

    Would you rather move this question to another area? Whatever works will be fine by me.

    Thanks!

    Lance

    #265140 Reply

    Riyad Kalla
    Member

    Lance,
    I’ve never seen this before, caught me off guard… I’ll ask around the office if anyone knows. If you find anything on the tubes, let us know.

    #265142 Reply

    Lance Drake
    Member

    Hi Eclipse Folks

    OK – investigating the I18N internationalization situation as relates Eclipse, it appears that the XDoclet merge point file name MUST be web-settings.xml and the file MUST be located in the specified merge directory. Fine. Done.

    However, Eclipse then includes 100% of the file into the web.xml file – including XML headers, root tag, etc., which then generates an error in the web.xml file for it being not well-formed xml. Removing everything from the web-settings.xml file except

    
     <context-param>
        <param-name>javax..servlet.jsp.jstl.fmt.locale</param-name>
        <param-value>en</param-value>
     </context-param>
    
     <context-param>
        <param-name>javax..servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>intl</param-value>
     </context-param>
    
    

    produces the correct entries in the now-error-free web.xml except the project identifies an error in the web-settings.xml file. This does not prevent the project from being compiled and deployed but it’s ugly.

    QUESTION: Any suggestions as to how to suppress the error indication on the not-well-formed-xml file, web-settings.xml?

    Also – I have still not been able to get the I18N translation to work – not a point of discussion for this forum – but I can report that Eclipse DOES deposit the locale translation properties files [located in the project’s ‘src’ folder] in the classes folder at the ‘root’ level – the default location which is supposedly searched by the FMT facilities.

    Thanks – I take the rest of my problems elsewhere – but wanted to clean up the initial question in this thread, “How to get I18N/fmt context-param entries into web-xml”

    Thanks!

    Lance Drake

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Getting I18N context-param Entries into web.xml

You must be logged in to post in the forum log in