facebook

looking for ApplicationResources.properties

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #223091 Reply

    fermataintl
    Member

    Still in learning mode, I just created a new project and added Struts and JSTL capabilities.

    Added one line to the generated MyJsp.jsp file after the one line in the body:

    <fmt:message key=”button.change”/> and, of course the required reference to the tld at the top:

    <% taglib uri=”http://java.sun.com/jstl/fmt&#8221; prefix=”fmt” %>

    The source ApplicationResources.properties is in src/fi.jstltest. I added one definition to that file:

    button.change=Change This Batman!

    First thing I noticed is that I don’t see the classes folder, which was disturbing (at first). I’m used to seeing this in Websphere. Anyway, noticed that there really is a classes folder (using window explorer) and ApplicationResources.properties is getting copied into it.

    When I fire up tomcat, it looks like it never loads my ApplicationResources. Sure enough, when I hit it from the browser I get:

    This is my JSP page.
    ???button.change???

    I am running eclipse 3.0.1 build id 200409161125, myeclipse 3.8.3 build id 200412061200-3.8.3, on windows XP. Any help would be appreciated.

    Thanks.
    Dean

    #223100 Reply

    Riyad Kalla
    Member

    First thing I noticed is that I don’t see the classes folder, which was disturbing (at first)

    Eclipse hides output folders by default from package view, you should be able to see it in the navigator view.

    When I fire up tomcat, it looks like it never loads my ApplicationResources. Sure enough, when I hit it from the browser I get:

    You need to load the resource bundle using:

    
    <fmt:bundle basename = "fi.jstltest.ApplicationResources">
      // <fmt:message /> tags must be within this body
    </fmt:bundle>
    

    http://www.javapractices.com/Topic175.cjp

    #223105 Reply

    fermataintl
    Member

    Thanks, that worked. I don’t remember having to do that in the past when I built everything with vi and ant. What is the message-resources tag in struts-config.xml for then?

    Dean

    #223109 Reply

    Riyad Kalla
    Member

    Dean,
    The message resource tag is for Struts, you are using JSTL to print out the messages. If you want to use the Struts tags:
    <bean:message />

    then you don’t need to do the bundle stuff. You are mixing two technologies, Struts and JSTL. Which is fine and a lot of people do it, but that is why there is a discrepency. Unless you need EL or want to standardize on JSTL, Struts already has some of the best and most tested taglibs out there, so you may just want to use those.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: looking for ApplicationResources.properties

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