I'm using the collection attribute instead. The collection is an ArrayList
of individual beans with properties "key" and "label".

<html:select size="13" property="subject">
        <html:options
                collection="<%= CourseCatalogueJSPAttributes.JSPATTRIBUTE_SUBJECT %>"
                property="value" labelProperty="label">
        </html:options>
</html:select>

-----Ursprungligt meddelande-----
Fr�n: Engbers, ir. J.B.O.M. [mailto:[EMAIL PROTECTED]
Skickat: den 4 december 2003 11:45
Till: '[EMAIL PROTECTED]'
�mne: (bean-)property gets out of scope/session?


I'm fairly new to Struts, java and servlets so maybe it's a stupid question
but I have this problem:

Based on the pattern that is used by Steve Raeburn in his struts-examples, I
start my web-application with a prepareAction in which I declare
        ArrayList codering= new ArrayList();
        codering.add("NA");
        codering.add("NF");
        request.setAttribute("codering",codering);

I then forward to
        return mapping.findForward("success");

which redirects to Search.jsp

In Search.jsp I want to use this code:
      <html:select property="landCode" >
          <html:options name="codering" />
        </html:select><BR>

Tomcat however complains:
org.apache.jasper.JasperException: Cannot find bean under name codering

If I replace <html:options> with <html:option>-tags the Search page gives no
problem.

As far as I understand the Struts-architecture, request.setAttribute and
request.getAttribute are complimentory.
In his code-examples, I can't  find any directives that could serve to
include the bean (jsp:useBean?)

Maybe I'm overlooking something but who has any thoughts?

Ben Engbers




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