You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2001/02/01 01:04:41 UTC

Re: Help Please: Resource not found

TMalvos@gcre.com wrote:

> When trying to call a JSP I receive the following message from Tomcat:
>
> javax.servlet.ServletException: Cannot find bean under name
> org.apache.struts.taglib.html.BEAN
>            at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
>
> I checked the STRUTS distribution and did not find it.  Has anyone
> encountered this before?  Thanks.

You would get this error if you tried to use one of the input field tags like <html:text>
outside of an <html:form> tag.

Craig



Re: Help Please: Resource not found

Posted by Incze Lajos <in...@mail.matav.hu>.
I have an error and it is not obvious to me that it's a fault of me
or a struts flaw. The error is as follows:

javax.servlet.ServletException: Cannot find bean org.apache.struts.taglib.html.BEAN in scope null
        at javax.servlet.ServletException.<init>(ServletException.java)
        at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:457)
...

etc.

In a former mail a similar error was raised and the solution
given by Craig was this one:

On Wed, Jan 31, 2001 at 04:04:41PM -0800, Craig R. McClanahan wrote:
> TMalvos@gcre.com wrote:
> 
> > When trying to call a JSP I receive the following message from Tomcat:
> >
> > javax.servlet.ServletException: Cannot find bean under name
> > org.apache.struts.taglib.html.BEAN
> >            at
> > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
> >
> > I checked the STRUTS distribution and did not find it.  Has anyone
> > encountered this before?  Thanks.
> 
> You would get this error if you tried to use one of the input field tags like <html:text>
> outside of an <html:form> tag.
> 
> Craig
> 

My situation differs altough the exception is raised when the an html:input
should be rendered but it _IS_ inside an html:form (here it is the error
page:)

---
<form name="upload" method="POST"
     action="/matademo/actions/upload.do" enctype="multipart/form-data">
<table width="100%">
<tr>
<td><strong>Közgyûlés bejelentése</strong></td>
<td><a href="/matademo/actions/submit.do?state=reset">Alapválaszték</a>
</td>
</tr>
<h1>Error: 500</h1>
<h2>Location: /matademo/WEB-INF/jsp/main.jsp</h2><b>Internal Servlet Error:</b><br>
<pre>javax.servlet.ServletException: Cannot find bean org.apache.struts.taglib.html.BEAN in scope null
        at javax.servlet.ServletException.<init>(ServletException.java
---

But. The html:form is defined in one jsp and the html:input in another one.
I have a dozen or so upload pages with the same basic functionality but with
different meta atributes, so I'm using template here, and the jsp's
containing the attribute inputs are included with template:get. I guess
that this is the source of the error but would be very sad, if struts
could not use the template inside a form. I hope I'm missing something,
please clarify what.

The jsp codes are something like this:

----------------------------------------------------- The form definition
<html:form action="/actions/upload.do"
          enctype="multipart/form-data">
<table width="100%">
<tr>
<td><strong><bean:message key="<%= doctype.getLabel( ) %>" /></strong></td>
<td><html:link
  href="/matademo/actions/submit.do?state=reset"><bean:message
  key="doc.submenu.reset" /></html:link>
</td>
</tr>
<template:get name="attrib" />   <!-- HERE IS THE ATTRIBUTE PANE INCLUDED -->
<tr>
<td colspan="2"><html:file property="theFile" /></td>
</tr>
<tr>
<td colspan="2"><html:submit /><html:reset /></td>
</tr>
</table>

-------------------------------------------------- The included "attrib" jsp

...
<tr>
<td colspan="2"><bean:message key="upload.ept_kozgy.th.kozgy1" /></td>
</tr>
<tr>
<td><bean:message key="upload.ept_kozgy.th.kozgyhelye" /></td>
<td><bean:message key="upload.ept_kozgy.th.kozgyideje" /></td>
</tr>
<tr>
<td><html:text property="kozgyulesIdeje1" />     <!-- THE BIG BANG IS HERE -->
    <html:errors property="kozgyulesHelye1" /></td>
<td><html:text property="kozgyulesHelye1" />
    <html:errors property="kozgyulesHelye1" /></td>
</tr>
...

Seems to me, that I can't use together the templates and the html:form tags.
Is this normal?
                                                                  incze