Gus,
I'm not sure what you changed on your JSP to get it fixed.

I found the solution on Google using
'org.apache.jasper.JasperException: Cannot find bean
org.apache.struts.taglib.html.BEAN in any scope'

I can't think of a use case of using a form with no content. You can, of
course, have an action without a form. The html:link tag handles the case
where you would navigate to a different page/action with a user click.

Rgds,

Richard

-----Original Message-----
From: Gus Heck [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 19, 2003 9:08 AM
To: Struts Users Mailing List
Subject: Re: problem with html:text bean throwing exception


Thanks, I found it... I had inadvertently typed:

<html:form action="prototypes/AddLocation.do" scope="session"/>

However all the archive and google hits talked about issues in the 
struts-config.

I really really wish that struts had a better way of indicating this 
error. Is there any valid use-case for a form with no content at all? 
perhaps this could be checked for in the form bean? maybe if there is a 
use case make the user set an atribute noContent="true" to make it work? 
This was a horrible typo gotcha for me, where every peice of information 
(until your mail) lead me in the wrong direction.

Thanks for the help,
Gus

Yee, Richard K,,DMDCWEST wrote:

>Gus,
>Why don't you include your jsp code and struts config? Usually it is 
>caused by having a struts form subelement tag outside of the struts 
>form tag. You've said that it's not the case. Are you specifying an 
>'input' attribute in your action mapping? How are you accessing the 
>page from the browser? Without your code and struts-config, everyone 
>just has to guess.
>
>Regards,
>
>Richard
> 
>
>-----Original Message-----
>From: Gus Heck [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, November 19, 2003 8:32 AM
>To: Struts Users Mailing List
>Subject: Re: problem with html:text bean throwing exception
>
>
>Anyone else got ideas about why I am getting this exception?
>
>org.apache.jasper.JasperException: Cannot find bean
>org.apache.struts.taglib.html.BEAN in any scope
>
>It appears that I answered Carl's concern. I'm now on day number 2 of
>being completely stuck :(. I would like to officially complain that this 
>is a really unclear error message. I don't get why it can't report what 
>bean it was looking for rather than sticking BEAN on the end...
>
>-Gus
>
>Gus Heck wrote:
>
>  
>
>>I believe so... Here is my config and some of the relevant directory 
>>tree... The action for NewLocation appears to successfully take me to 
>>the AddLocation page. (it only forwards right now).
>>
>> <form-beans>            <form-bean name="addLocationForm" 
>>type="org.cs101.fdb.struts.form.AddLocationForm" />
>>     <form-bean name="blankForm"       
>>type="org.cs101.fdb.struts.form.BlankForm" />
>> </form-beans>
>>
>> <!-- ========== Action Mapping Definitions 
>>============================== -->  <action-mappings>
>>   <action path="/prototypes/AddLocation"
>>           type="org.cs101.fdb.struts.action.AddLocationAction" 
>>           name="addLocationForm"
>>           scope="request"
>>           validate="true"
>>           input="/prototypes/enter-location.jsp">
>>       <forward name="error" path="/prototypes/enter-location.jsp" />
>>   </action>
>>   <action path="/prototypes/NewLocation"
>>           type="org.cs101.fdb.struts.action.NewLocationAction" 
>>           name="blankForm"
>>           scope="request"
>>           validate="true"
>>           input="/prototypes/index.jsp">
>>       <forward name="addLocation" 
>>path="/prototypes/enter-location.jsp" />
>>   </action>
>> </action-mappings>
>>
>>[EMAIL PROTECTED] build]$ find . -name *ocation*
>>./WEB-INF/classes/org/cs101/fdb/model/Location.class
>>./WEB-INF/classes/org/cs101/fdb/struts/form/AddLocationForm.class
>>./WEB-INF/classes/org/cs101/fdb/struts/action/AddLocationAction.class
>>./WEB-INF/classes/org/cs101/fdb/struts/action/NewLocationAction.class
>>./prototypes/enter-location.jsp
>>[EMAIL PROTECTED] build]$ find . -name *lank* 
>>./WEB-INF/classes/org/cs101/fdb/struts/form/BlankForm.class
>>[EMAIL PROTECTED] build]$
>>
>>
>>Carl wrote:
>>
>>    
>>
>>>Have you a vaild formBean define for this <html:form> in your struts 
>>>config file ? <form-bean name="myForm" type="org.myForm"/>
>>>
>>>Is this bean called in your action mapping ?
>>><action path="/htmlForm" type="org.myAction" name="myForm" 
>>>scope="request" validate="true" input="/page.jsp">
>>>
>>><forward name="success" path="/succes.do" redirect="true"/> </action>
>>>
>>>I've faced a similar issue for these reasons.
>>>
>>>Carl
>>>
>>>
>>>Gus Heck wrote:
>>>
>>>      
>>>
>>>>So I have been stuck for a day or so on this exception:
>>>>
>>>>org.apache.jasper.JasperException: Cannot find bean 
>>>>org.apache.struts.taglib.html.BEAN in any scope
>>>>    at
>>>>
>>>>        
>>>>
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j
>ava:2
>54) 
>  
>
>>>>    at
>>>>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
>>>>295)
>>>>        
>>>>
>
>  
>
>>>>    at
>>>>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>>>>etc...
>>>>
>>>>caused by:
>>>>
>>>>javax.servlet.ServletException: Cannot find bean 
>>>>org.apache.struts.taglib.html.BEAN in any scope
>>>>    at
>>>>
>>>>        
>>>>
>org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte
>xtImp
>l.java:533) 
>  
>
>>>>    at
>>>>
>>>>        
>>>>
>org.apache.jsp.enter_0002dlocation_jsp._jspService(enter_0002dlocation_
>jsp.j
>ava:132) 
>  
>
>>>>    at
>>>>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
>>>>
>>>>etc...
>>>>
>>>>
>>>>I think have determined that it happens when attempting to process 
>>>>this tag:
>>>>
>>>><% System.out.println ("got here");%>
>>>>           <td><html:text property="city" maxlength="50" size= 
>>>>"20"/></td> <% System.out.println ("got here2");%>
>>>>
>>>>(only the first print statement appears in catalina.out)
>>>>
>>>>I am definately able to find the struts-html taglib (as I am already 
>>>>inside an html:form tag by this point).
>>>>
>>>>I think I really have a situation where html:form can be found but 
>>>>not html:text for the following reasons:
>>>>
>>>>Here is the jasper generated code:
>>>>   67        out.write("<hr>\n\n");
>>>>   68        if (_jspx_meth_html_form_0(pageContext))
>>>>   69          return;
>>>>   70        out.write("\n    ");
>>>>   71        out.write("<table border=\"0\">\n        ");
>>>>   72        out.write("<tr>\n            ");
>>>>   73        out.write("<td>City:");
>>>>   74        out.write("</td>\n");
>>>>   75   System.out.println ("got here");
>>>>   76        out.write("\n            ");
>>>>   77        out.write("<td>");
>>>>   78        if (_jspx_meth_html_text_0(pageContext))
>>>>   79          return;
>>>>   80        out.write("</td>\n");
>>>>   81   System.out.println ("got here2");
>>>>.... snip .....
>>>>  127        out.write("</html>\n");
>>>>  128      } catch (Throwable t) {
>>>>  129        out = _jspx_out;
>>>>  130        if (out != null && out.getBufferSize() != 0)
>>>>  131          out.clearBuffer();
>>>>  132        if (pageContext != null) 
>>>>pageContext.handlePageException(t);
>>>>  133      } finally {
>>>>  134        if (_jspxFactory != null) 
>>>>_jspxFactory.releasePageContext(pageContext);
>>>>  135      }
>>>>.... snip .....
>>>>  154    private boolean 
>>>>_jspx_meth_html_text_0(javax.servlet.jsp.PageContext pageContext)
>>>>  155            throws Throwable {
>>>>  156      JspWriter out = pageContext.getOut();
>>>>  157      /* ----  html:text ---- */
>>>>  158      org.apache.struts.taglib.html.TextTag 
>>>>_jspx_th_html_text_0 = (org.apache.struts.taglib.html.TextTag)
>>>>
>>>>        
>>>>
>_jspx_tagPool_html_text_size_property_maxlength.get(org.apache.struts.t
>aglib
>.html.TextTag.class); 
>  
>
>>>>  159      _jspx_th_html_text_0.setPageContext(pageContext);
>>>>  160      _jspx_th_html_text_0.setParent(null);
>>>>  161      _jspx_th_html_text_0.setProperty("city");
>>>>  162      _jspx_th_html_text_0.setMaxlength("50");
>>>>  163      _jspx_th_html_text_0.setSize("20");
>>>>  164      int _jspx_eval_html_text_0 = 
>>>>_jspx_th_html_text_0.doStartTag();
>>>>  165      if (_jspx_th_html_text_0.doEndTag() == 
>>>>javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
>>>>  166        return true;
>>>>  167      
>>>>_jspx_tagPool_html_text_size_property_maxlength.reuse(_jspx_th_html_
>>>>text_0);
>>>>
>>>>  168      return false;
>>>>  169    }
>>>>
>>>>So I am willing to suppose that out.write() isn't throwing the 
>>>>exception, which leaves only _jspx_meth_html_text_0(pageContext).
>>>>Looking into that method, I see 3 candidtates:
>>>>
>>>>        
>>>>
>_jspx_tagPool_html_text_size_property_maxlength.get(org.apache.struts.t
>aglib
>.html.TextTag.class); 
>  
>
>>>>_jspx_th_html_text_0.doStartTag();
>>>>_jspx_th_html_text_0.doEndTag()
>>>>_jspx_tagPool_html_text_size_property_maxlength.reuse(_jspx_th_html_
>>>>text_0);
>>>>
>>>>
>>>>The question is why does one of these throw a Servlet exception when 
>>>>form doesnt? Though the form tag hasn't closed yet so it could still 
>>>>be the form tag, when I misname the taglibrary in the JSP I get a 
>>>>different error.
>>>>
>>>>I am using Struts 1.1 (downloaded a couple days ago) in Tomcat 
>>>>4.1.27 with Java(TM) 2 Runtime Environment, Standard Edition (build
>>>>1.4.2-b28) on a (redhat 9) linux platform. After spending hours
>>>>tweaking my settings nothing I do seems to effect it and I am 
>>>>begining to suspect a bug, but I find it extremely hard to beleive 
>>>>that there would be a bug relating to html:text since it is one of 
>>>>the most used tags. Can any1 help me out here?
>>>>
>>>>-Gus
>>>>
>>>>        
>>>>
>
>
>
>---------------------------------------------------------------------
>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]
>
>  
>



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