OK, here is some more info. BTW, I really appreciated the help folks.  This
problem has cost me days of effort with nothing to show for it.  I'm new to
struts, and it's not been a pleasant experience so far.  

First the questions:

Q) Does the problem go away after you access and Action?  
A) It never gets that far.

Q) Please, Send the URL that you send to the server.
A) http://localhost:8080/orders/

Q) Try this. <action path="/index" forward="/index.jsp"/>
A) I'm not sure I did what you wanted but I added the above line to the
struts-config.xml file (see comment below).  I then tried to do this:
http://localhost:8080/orders/index
When I did that, I got an HTTP 404 - /orders/index error saying the
requested resource (/orders/index) is not available.

Here is some of what is under the  C:\Program Files\Apache Software
Foundation\Tomcat 5.0\webapps\orders directory:
Company_Logo.gif
confirmation.jsp
errorpage.jsp
footer.jsp
header.jsp
index.jsp
indexContent.jsp
...


Now the struts-config.xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.1//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>
<struts-config>
        <!-- ============ Data Source ===================================
-->
        <data-sources>
                <data-source>
                        <set-property property="description" value="Company
Orders sample datasource"/>
                        <set-property property="autoCommit" value="false"/>
                        <set-property property="driverClass"
value="org.gjt.mm.mysql.Driver"/>
                        <set-property property="maxCount" value="4"/>
                        <set-property property="password" value=""/>
                        <set-property property="url"
value="jdbc:mysql://localhost/orders"/>
                        <set-property property="user" value="darrin"/>
                </data-source>
        </data-sources>
        <!-- ========== Form Bean Definitions
=================================== -->
        <form-beans>
                <form-bean name="logonForm"
type="com.company.product.orders.forms.LogonForm"/>
                <form-bean name="searchForm"
type="com.company.product.orders.forms.SearchForm"/>
                <form-bean name="insertForm"
type="com.company.product.orders.forms.InsertForm"/>
        </form-beans>
        <global-exceptions>
                <exception key="error.required"
type="org.apache.struts.util.AppException" path="/appError.jsp"/>
        </global-exceptions>
        <!-- ========== Global Forward Definitions
============================== -->
        <global-forwards>
                <forward name="logoff" path="/logoff.do"/>
                <forward name="logon" path="/logon.jsp"/>
                <forward name="success" path="/mainMenu.jsp"/>
                <forward name="search" path="/search.jsp"/>
                <forward name="displayall" path="/displayall.do"/>
                <forward name="insert" path="/insert.jsp"/>
                <forward name="review" path="/wizard.jsp"/>
                <forward name="mainMenu" path="/mainMenu.jsp"/>
                <forward name="confirmation" path="/confirmation.jsp"/>
        </global-forwards>
        <!-- ========== Action Mapping Definitions
============================== -->
        <action-mappings>
                <action path="/search"
type="com.company.product.orders.actions.SearchAction" name="searchForm"
attribute="myForm" scope="request" input="/search.jsp">
                        <forward name="success" path="/display.jsp"/>
                </action>
                <action path="/insert" type="orders.actions.InsertAction"
name="insertForm" scope="request" input="/insert.jsp" validate="true">
                        <exception key="error.required"
type="com.company.product.orders.exceptions.MissingValueException"
path="/insertError.jsp"/>
                </action>
                <action path="/insertDyna"
type="com.company.product.orders.actions.InsertAction" name="insertDynaForm"
scope="request" input="/insertDyna.jsp" validate="true">
    </action>
                <action path="/forceError"
type="com.company.product.orders.actions.ForceErrorAction" scope="request">
    </action>
                <!-- Process a user logoff -->
                <action path="/logoff"
type="com.company.product.orders.actions.LogoffAction">
                        <forward name="success" path="/index.jsp"/>
                </action>
                <!-- Process a user logon -->
                <action path="/logon"
type="com.company.product.orders.actions.LogonAction" name="logonForm"
scope="request" input="/logon.jsp">
    </action>
 
<!--THIS LINE ADDED AT SUGGESTION OF E-MAIL GROUP -->   
    <action path="/index" forward="/index.jsp"/>        

                <!-- The standard administrative actions available with
Struts -->
                <!-- These need to be either omitted or protected by
security BEFORE final deployment-->
                <action path="/admin/addFormBean"
type="org.apache.struts.actions.AddFormBeanAction"/>
                <action path="/admin/addForward"
type="org.apache.struts.actions.AddForwardAction"/>
                <action path="/admin/addMapping"
type="org.apache.struts.actions.AddMappingAction"/>
                <action path="/admin/reload"
type="org.apache.struts.actions.ReloadAction"/>
                <action path="/admin/removeFormBean"
type="org.apache.struts.actions.RemoveFormBeanAction"/>
                <action path="/admin/removeForward"
type="org.apache.struts.actions.RemoveForwardAction"/>
                <action path="/admin/removeMapping"
type="org.apache.struts.actions.RemoveMappingAction"/>
        </action-mappings>
        <!-- ========== Message Resources Definitions
=========================== -->
          <message-resources
parameter="com.company.product.orders.ApplicationResources"/>
</struts-config>
 
-----Original Message-----
From: Richard Hightower [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 7:01 PM
To: Struts Users Mailing List
Subject: RE: Missing message for key problem.


Does the problem go away after you access and Action?

Please, Send the URL that you send to the server.

Try this.

<action path="/index" forward="/index.jsp"/>

The above ensures that the resource bundle is intialized before hitting the
page for the first time.

Rick Hightower
Developer

Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm

Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring

-----Original Message-----
From: Smith, Darrin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 1:45 PM
To: [EMAIL PROTECTED]
Subject: Missing message for key problem.


Every time I try to access my newly built application, I get:
Missing message for key "image.company" javax.servlet.jsp.JspException:
Missing message for key "image.company" at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:297) at
org.apache.jsp.header_jsp._jspx_meth_bean_message_0(header_jsp.java:86) at
org.apache.jsp.header_jsp._jspService...

I've researched this, posted to the web, and re-checked it a dozen times but
I can't figure out what I'm doing wrong.

Here is the path the properties file gets placed in after Tomcat expands the
war file:

C:\Program Files\Apache Software Foundation\Tomcat
5.0\webapps\orders\WEB-INF\classes\com\company\product\orders

There, you will find a file named: ApplicationResources.properties (note
that the ApplicationResources.properties name was cut/pasted from File
Explorer so there is no spelling mistake).

In that file you will find the following (again, cut/paste):
image.company=Company name

In the web.xml file you will find the following (again, cut and paste):


<servlet>

    <servlet-name>orders</servlet-name>


<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

            <init-param>

                <param-name>application</param-name>


<param-value>com.company.product.orders.ApplicationResources</param-value>

            </init-param>

        <init-param>

            <param-name>config</param-name>

            <param-value>/WEB-INF/struts-config.xml</param-value>

        </init-param>


And finally, in the header.jsp file that tries to use the key you find this:


img src="Company_Logo.gif" align="left" alt="<bean:message
key="image.company"/>


Note that the header.jsp file is in this directory after Tomcat expands the
war file:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\orders

I've tried removing the application param from the web.xml file and
replacing it in the struts-config.xml file like this:
<message-resources
parameter="com.company.product.orders.ApplicationResources"/>


That didn't help.

So what is it that I am doing wrong?

Thanks!

Darrin




---------------------------------------------------------------------
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]

Reply via email to