File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Cannot find bean org. apache.  struts.  taglib. html. BEAN in any scope Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "Cannot find bean org. apache.  struts.  taglib. html. BEAN in any scope" Watch "Cannot find bean org. apache.  struts.  taglib. html. BEAN in any scope" New topic
Author

Cannot find bean org. apache. struts. taglib. html. BEAN in any scope

kranthi
Greenhorn

Joined: Dec 17, 2008
Posts: 10
Hi frnds,

I got the following error while i am runnning my struts application.



ERROR::


/****************


org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


***********************/


web.xml file contains...


<?xml version="1.0" encoding="UTF-8"?>

<web-app>
<display-name>StrutsExample1</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>


</web-app>




Any one can solve my problem.

Thanking you


Regards<br />kranthi
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2860

Post you JSP page on which you are getting this exception along with part struts-config.xml.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
kranthi
Greenhorn

Joined: Dec 17, 2008
Posts: 10
Hi,

the following are struts-config.xml and index.jsp files.


struts-cofig.xml::

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">


<struts-config>
<form-beans>
<form-bean name="LoginForm" type="net.com.struts.form.LoginForm" />
</form-beans>
<global-exceptions>
</global-exceptions>
<global-forwards>
</global-forwards>
<action-mappings>
<action path="/login" name="LoginForm" validate="true" input="/index.jsp" type="net.com.struts.action.LoginAction">
<forward name="success" path="/welcome.jsp" />
<forward name="failure" path="/index.jsp" />
</action>
</action-mappings>
<message-resources parameter="MessageResources" />
</struts-config>




index.jsp::

<%@ page language="Java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<HTML>
<HEAD>
</HEAD>
<BODY>
<HTML:FORM action="login">
<bean:message key="label.username"/>
<html:text property="userName"></html:text>
<html:errors property="userName" />
<br>
<bean:message key="label.password" />
<html:text property="password"></html:text>
<html:errors property="password" />
<br>
<html:submit />
<html:reset />
</HTML:FORM>
</BODY>
</HTML>.


let me know what is wrong in my coding and solve it.
Thank you
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2860

The code looks fine, still I believe you modify the HTML:FORM to lowercase and then re run the apps

like

index.jsp::
kranthi
Greenhorn

Joined: Dec 17, 2008
Posts: 10
Hi,

now it is working fine.

Just I change that <HTML:FORM> to <html:form>


Thanking you
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2860

You are welcome

So, you know now that the Struts tags are case-sensitive!!
 
 
subject: Cannot find bean org. apache. struts. taglib. html. BEAN in any scope
 
Threads others viewed
Hot deploy
"/tags/struts-logic" not found
Configuring First Struts Application
Error in Struts Application(Cannot find message resources under key org.apache.strut)
help on taglib and properties file in struts?
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com