Title: RE: html form widgets not appearing
The entire index.jsp file is included in this message so you can see the html source at the end. I havn't actually re-compiled the struts.jar file to see what was happening (because it wasn't easy to get working w/ orion server) but just by looking at MessageTag.java, I could see where in doStart() the message var came back as null and threw the exception when trying to read the key. I saw the file it was trying to read was correct by doing a println(getClass().getResource("my.properties")... in my jsp file.
 
I'll look at this loadLocale to see how and where to use it. Thnxs. 
----- Original Message -----
Sent: Friday, April 27, 2001 7:09 PM
Subject: RE: html form widgets not appearing

What does the html source look like?  You also might want to check the method loadLocale() and make sure the message strings are being loaded from the file.

-----Original Message-----
From: G.L. Grobe [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 5:11 PM
To: [EMAIL PROTECTED]
Subject: Re: html form widgets not appearing


Heh, I've been on this prob for almost two weeks and I'm loosing motivation
in this project because of this bug. My servlet config I believe is correct.
I made it as simple as possible by putting the cais.properties file in the
~/WEB-INF/classes dir (no package path) and saying:

<!-- Action Servlet Configuration -->
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>application</param-name>
      <param-value>cais</param-value>
    </init-param>

Other keys are not being found as well. I know the correct file is being
found as I println the ...getClass().getResources("cais.properties") and it
shows it's got the correct path and according to the struts code, it's
finding the file, but not the key.

I'm pretty sure I'm referencing the key correclty:

 <%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html:html>
<head>

<title>
   <bean:message key="main.title" />
</title>

----- Original Message -----
From: "Scott Cressler" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 27, 2001 6:58 PM
Subject: RE: html form widgets not appearing


> Well, at least now you know you're invoking the bean:message tag.  ;-)
> That's a problem I've found with debugging custom tags: if you forget the
> taglib directive or screw it up, you get no complaints.
>
> It seems to be saying it can't find your message by that key.  Can you
find
> any messages?  Do you have the correct reference to the properties file in
> your web.xml file, e.g.:
>
>   <!-- Action Servlet Configuration -->
>   <servlet>
>     <servlet-name>action</servlet-name>
>     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>     <init-param>
>       <param-name>application</param-name>
>       <param-value>com.propel.webapp.Resources</param-value>
>     </init-param>
>
> In my case, that means the file is at
> <webapproot>/classes/com/propel/webapp/Resources.properties .  I don't
think
> it necessarily has to be there (isn't there some search path for finding
> it?), but that has worked for me (using resin).
>
> Make sure you can find any message and then make sure your tag is
> referencing the message key correctly, e.g., I would expect given what
> you've said it would be:
>
> <bean:message key="main.title"/>
>
> Scott
>
> > -----Original Message-----
> > From: G.L. Grobe [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 27, 2001 4:51 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: html form widgets not appearing
> >
> >
> > I don't get it, if I match prefix="struts-bean" w/ a tag of
> > <bean:message
> > key ...
> > it can't find the keys in the properties file, which I'd say is to be
> > expected. But if I change the prefix="bean" w/ tags of
> > <bean:message ...
> > making the prefix and tag the same like it should be, then I get the
> > following error.
> >
> > 500 Internal Server Error
> > javax.servlet.jsp.JspException: Missing message for key main.title at
> > org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag
> > .java:242) at
> > /index.jsp._jspService(/index.jsp.java:136) (JSP page line 9) at
> > com.orionserver[Orion/1.4.8 (build
> > 10374)].http.OrionHttpJspPage.service(Unknown Source) at
> > com.evermind[Orion/1.4.8 (build 10374)]._aj._nxd(Unknown Source) ...
> >
> > I traced this file in the struts code and the file is being
> > found, the key
> > is in the file, there are no invisible characters, but it's
> > not find the
> > key.
> >
> > ----- Original Message -----
> > From: Scott Cressler
> > To: '[EMAIL PROTECTED]'
> > Sent: Friday, April 27, 2001 5:59 PM
> > Subject: RE: html form widgets not appearing
> >
> >
> > prefix="struts-html", but tag uses are <html:*> ?
> > -----Original Message-----
> > From: G.L. Grobe [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 27, 2001 3:30 PM
> > To: [EMAIL PROTECTED]
> > Subject: html form widgets not appearing
> >
> >
> > My pages are showing up fine and the form Actions are working, w/ one
> > exception, all of my pages are not displaying any of the form
> > widgets like
> > radio buttons or text entry boxes and even bean message keys,
> > yet no errors
> > are occurring. Is there anything wrong w/ the below page that
> > would prevent
> > forms from not showing?
> >
> > A problem I had before of not finding message keys was that
> > in the taglib
> > lines where the prefix was only - prefix="bean" - and I
> > actually needed -
> > prefix="struts-bean", though I've seen no examples of it
> > anywhere's, just
> > from somebody's post, so I tried it and it worked.
> >
> > TIA
> >
> > ------------------------ my
> > index.jsp -------------------------------------------
> >  <%@ page language="java" %>
> > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="struts-bean" %>
> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="struts-html" %>
> >
> > <html:html>
> > <head>
> >
> > <title>
> >    <bean:message key="main.title" />
> > </title>
> >
> > <%@ include file="menubar.js" %>
> > <%@ include file="main.css" %>
> >
> > </head>
> >
> > <body bgcolor="white">
> > <html:errors/>
> >
> > <%@ include file="header.jsp" %>
> > <%@ include file="mainMenu.jsp" %>
> >
> > <html:form action="view.do">
> >
> > <table border="0" cellspacing="2" cellpadding="0" align="left">
> >    <tr>
> >       <td>
> >          <html:radio property="view" value="Master View">
> >          <bean:message key="main.master" />&nbsp;
> >          </html:radio>
> >       </td>
> >       <td>
> >          <html:radio property="view" value="Details View">
> >          <bean:message key="main.detail" />
> >          </html:radio>
> >       </td>
> >       <td>
> >          <center>
> >          <html:submit value="View"/>
> >          </center>
> >       </td>
> >    </tr>
> > </table>
> > </html:form>
> >
> > <br> <br> <br> <br> <br>
> > <%@ include file="footer.jsp" %>
> >
> > </body>
> > </html:html>
> >
>

Reply via email to