Title: RE: Struts forms and JSP components/templates
That just specifies the scope where the form bean is stored. If you look at the doStartTag method in the FormTag.java source, it contains a few lines that look something like this:
 
        pageContext.setAttribute(Constants.BEAN_KEY, bean);
Those types of calls are what causes the problem.
 
Specifically, when I try to include an html:textarea tag in my component, I get this error when I access the page:
 
[ServletException in:/contentForm.jsp] Cannot find bean under name org.apache.struts.taglib.html.BEAN'
 javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN
    at org.apache.struts.taglib.html.TextareaTag.doStartTag(TextareaTag.java:146)
    ...

--
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW/ 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863

-----Original Message-----
From: Shunhui Zhu [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 07, 2001 6:15 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts forms and JSP components/templates

I think the scope of the form is specified in struts-config.xml, you can put it in session scope.

Shunhui

-----Original Message-----
From: Tim Moore [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 07, 2001 2:40 PM
To: '[EMAIL PROTECTED]'
Subject: Struts forms and JSP components/templates


I'm working on a very complex webapp with hundreds of form pages. Frequently
there are "chunks" of a form that are shared across several pages. I was
hoping to use the components library to separate these common form chunks
into reusable pages, but I'm not having much luck with this.

The problem is that the struts html:form tag stores data in the PageContext
of the enclosing page, where individual input tags that appear in the the
included components are unable to access them. I don't know if there's
anything I can do about this from my application's end.

Does anyone have any suggestions...hopefully something other than "don't do
that!" ;-)

Would it make any sense to change html:form to use the request context
rather than the page context?

TIA,
--
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW/ 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863

Reply via email to