Somebody somewhere has to create the bean. If there's an html:form tag,
it will create the ActionForm bean indicated in the tag properties or by
its action-mapping. If the bean is being populated by an Action class,
you have to go to the Action first, and then to the JSP. In general,
it's best to never link to JSPs, and to always go through
action-mappings  (/do/* or *.do URIs). 

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


Jeff Haenn wrote:
> 
> Andrew,
> Thanks for answering so quickly.  I guess the real question is, how do you
> get into the framework using an HTTP GET when the framework tries to pass
> the bean to the JSP page and it = null so it barfs.  Here is the JSP code I
> left out before:
> 
> <form:radio property="eligType" value="individual"/>
> 
> I just realized that the exception comes from
> "org.apache.struts.taglib.html.*" directory.  I looked at the source code
> for org.apache.struts.taglib.html.RadioTag and it throws an exception when
> the bean is null.  Which brings me to the question above.  I'll explain in
> steps:
> 
> 1.  default page = Login
> 2.  successful login goes to main.jsp
> 3.  no form on the main.jsp page to submit, so I click on laft nav.
> 4.  Kaboom!  No bean, to pluck properties off of, in session.
> 
> How do you get around this?  Thanks.
> 
> -----Original Message-----
> From: Andrew van der Voort [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 18, 2002 9:27 PM
> To: Struts Users Mailing List
> Subject: RE: using url's under struts
> 
> The fact that you are getting JspException described below suggests to me
> that you are in struts-land.
> 
> The message "no getter method..." only happens to me when I have mistyped
> or not provided the appropriate methods in my bean or jsp page. In your
> case I would check:
> 
> 1) Class com.xxxxxxxx.xxxxxx.xxxxxx.TestEligibilityForm is available, and
> compiled.
> 2) There is an attribute called eligType in that class
> 3) There is a method called getEligType() in that class and that the value
> it returns is consistent with the type of struts html attribute you are
> trying to render it with.  The method e() isn't going to cut it.
> 4) You haven't shown it but you must have a struts or bean reference to
> eligType somewhere else in your jsp page, otherwise struts wouldn't be
> complaining about it. Look not only in the jsp page you have shown here but
> also success.jsp
> 5) Check your case as struts is case sensitive.
> 
> Hope that helps
> 
> Andrew
> >-----Original Message-----
> >From: Jeff Haenn [mailto:[EMAIL PROTECTED]]
> >Sent: Tuesday, 19 March 2002 2:12 p.m.
> >To: Struts User List
> >Subject: using url's under struts
> >
> >
> >USING:
> >Struts 1.0.2
> >Weblogic 6.1
> >
> >
> >PROBLEM & QUESTION:
> >I have a page that is only accessible from a hyperlink (i.e.
> >no form posting
> >done).  How do I get into the Struts framework from a hyperlink?
> >/testEligibility.do doesn't seem to work.  I get the following
> >exception.
> >Why is it referenceing "org.apache.struts.taglib.html.BEAN"?
> >Thanks for the
> >help.
> >
> >javax.servlet.jsp.JspException: No getter method available for property
> >eligType for bean under name org.apache.struts.taglib.html.BEAN
> >
> >CODE:
> >JSP
> >*********************
> ><a href="/testEligibility.do">Test Eligibility</a>
> >*********************
> >
> >
> >STRUTS-CONFIG.xml
> >*********************
> ><action path="/testEligibility"
> >          type="com.xxxxxxxx.xxxxxx.xxxxxx.TestEligibilityAction"
> >          name="testEligibilityForm"
> >          scope="request">
> >   <forward name="success" path="/success.jsp"/>
> ></action>
> >
> >
> ><form-bean name="testEligibilityForm"
> >type="com.xxxxxxxx.xxxxxx.xxxxxx.TestEligibilityForm"/>
> >*********************
> >
> >
> >TestEligibilityForm
> >*********************
> >public String
> >e(){
> >    return eligType;
> >}
> >
> >
> >--
> >To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to