This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Exception in jsp :[ServletException in:/jsp/product/productMainPage.jsp] javax.servlet.jsp.JspExcept

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i m vidhya .
i m getting the following exception when i m clicking on jsp. here i m posting my jsp and xml files.
Can anyone help me .

my JSP

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

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

<html:html>
<head>
<title><h1>PRODUCT</h1></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!-- **** colour scheme stylesheet **** -->
<link rel="stylesheet" type="text/css" href="css/colour.css" />
<link rel="stylesheet" type="text/css" href="css/tabs.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/scrollable.css" />

<script src="js/product.js" language="javascript" type="text/javascript"></script>
<script src="js/common.js" language="javascript" type="text/javascript"></script>
<script src="js/ajaxFunctions.js" language="javascript" type="text/javascript"></script>
</head>
<body>
<form name="productForm">
<div id="main" style="height: 100%">
<div id="content" style="height: 600px">
<div id="column2" style="height: 200px">

<div id="searchDiv" align="center" style="height: 50px;">

<table cellpadding="0" cellspacing="0" width="90%" border="0"
id="searchTable" align="center">
<div class="subdataHeading" id="masterForm">
    PRODUCT ID  



<html:text property="productId"/>
<bean:write name="productForm" property="productId"/>
    

<html:button styleClass="bglobal" property="buttonSearch"
value="Search" onclick="fetchData()">Search</html:button>

   
<html:button styleClass="bglobal" property="buttonClear"
value="Clear" onclick="clearData()">Clear</html:button>
   
<html:button styleClass="bglobal" property="buttonAdd"
value="AddProduct" onclick="clearData()">AddProduct</html:button>

</div>
</table>
</div>
<!-- end of search Div -->

<div id="tableContainer" style="height: 300px;">
<table cellpadding="0" cellspacing="0" width="90%" border="0"
align="center">
<tr>
<td width="150px" class="subdataHeading" >PRODUCT CATEGORY :    </td>
<td>
</td>

</tr>
<tr height="10px"/>
<tr>
<td width="150px" class="subdataHeading" >PRODUCT ID :    </td>
<td><html:text property="productId" styleClass="dText"
style="width:15em" maxlength="15" />
</td>

</tr>
<tr height="10px"/>
<tr>
<td width="150px" class="subdataHeading">PRODUCT NAME :    </td>
<td><html:text property="productName" styleClass="dText"
style="width:15em" maxlength="15" />
</td>

</tr>
<tr height="10px"/>

<tr>
<td width="150px" class="subdataHeading">PRODUCT DESC :</td>
<td><html:text property="productName" styleClass="dText"
style="width:15em" maxlength="15" />
</td>

</tr>

<tr height="10px"/>
<tr>
<td width="150px" class="subdataHeading">PRODUCT PRICE :</td>
<td><html:text property="productPrice" styleClass="dText"
style="width:15em" maxlength="15" />
</td>

</tr>
<tr height="40px"/>
<tr>
<td> <html:button property="buttonLogin" styleClass="bglobal"
value="SAVE" onclick="saveProduct()">SAVE</html:button> </td>
<td> <html:button property="buttonClear" styleClass="bglobal"
value="CLEAR" onclick="clearData()">CLEAR</html:button></td>
</tr>

</table>




</div> <!-- end of dataDiv -->




</div>
</div>
</div>
</form>
</body>
</html:html>



Struts-config.xml


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

<struts-config>
<form-beans>
<form-bean name="productForm" type="com.form.product.ProductForm" />
<form-bean name="loginForm" type="com.form.login.LoginForm" />
<form-bean name="salesForm" type="com.form.sales.SalesForm" />
<form-bean name="stockForm" type="com.form.stock.StockForm" />

</form-beans>


<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
</plug-in>


<action-mappings>

<action input="/jsp/login.jsp" name="loginForm" path="/Login"
type="com.action.login.LoginAction" scope="request" parameter="requestTo" >
<forward name="success" path="/jsp/success.jsp" />
<forward name="failure" path="/jsp/failure.jsp" />
</action>

<action name="stockForm" path="/stock"
type="com.action.stock.StockAction" scope="request" parameter="requestTo" >
<forward name="success" path="stocks"/>
</action>

<action name="productForm" path="/product"
type="com.action.product.ProductAction" scope="request" parameter="requestTo" >
<forward name="success" path="products"/>
<forward name="failure" path="/jsp/ErrorPage.jsp" />
</action>

<action name="salesForm" path="/sales"
type="com.action.sales.SalesAction" scope="request" parameter="requestTo" >
<forward name="success" path="sales"/>
<forward name="office" path="office"/>
</action>




<action path="/errorPage" type = "com.action.login.ErrorAction" scope="request">
<forward name = "ErrorPage" path = "/jsp/ErrorPage.jsp" />
</action>

</action-mappings>

<message-resources parameter="com.common.resources.ApplicationResource" />
<!-- <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in> -->
</struts-config>



Web.xml


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>Online Accounting</display-name>


<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>2</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/jsp/login.jsp</welcome-file>
</welcome-file-list>

<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/tld/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
</taglib>
</jsp-config>

</web-app>


 
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Please post the whole stacktrace of your exception.
 
vidhya mergu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please have the stack trace::


PRODUCT ID [ServletException in:/jsp/product/productMainPage.jsp] javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope' javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916) at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845) at org.apache.jsp.jsp.product.productMainPage_jsp._jspService(productMainPage_jsp.java:105) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:604) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:543) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:656) at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137) at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177) at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473) at org.apache.jsp.jsp.home.baseLayout_jsp._jspx_meth_tiles_005finsert_005f2(baseLayout_jsp.java:220) at org.apache.jsp.jsp.home.baseLayout_jsp._jspService(baseLayout_jsp.java:113) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274) at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:254) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) at




Exception in Console
==============


2015-10-10 16:20:22 DEBUG InsertTag:945 - [ServletException in:/jsp/product/productMainPage.jsp] javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope'
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)
at org.apache.jsp.jsp.product.productMainPage_jsp._jspService(productMainPage_jsp.java:105)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:604)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:543)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:656)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
at org.apache.jsp.jsp.home.baseLayout_jsp._jspx_meth_tiles_005finsert_005f2(baseLayout_jsp.java:220)
at org.apache.jsp.jsp.home.baseLayout_jsp._jspService(baseLayout_jsp.java:113)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:254)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:938)
at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176)
at org.apache.jsp.jsp.product.productMainPage_jsp._jspx_meth_html_005ftext_005f0(productMainPage_jsp.java:286)
at org.apache.jsp.jsp.product.productMainPage_jsp._jspx_meth_html_005fhtml_005f0(productMainPage_jsp.java:155)
at org.apache.jsp.jsp.product.productMainPage_jsp._jspService(productMainPage_jsp.java:92)
... 58 more
log4j: rolling over count=13000
log4j: maxBackupIndex=5
log4j: Renaming file .\OnlineAccounting.log to .\OnlineAccounting.log.1
log4j: setFile called: ./OnlineAccounting.log, false
log4j: setFile ended
2015-10-10 16:20:22 DEBUG InsertTag:858 - insert page='/jsp/home/footer.jsp'.
10 Oct, 2015 4:20:22 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:938)
at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176)
at org.apache.jsp.jsp.product.productMainPage_jsp._jspx_meth_html_005ftext_005f0(productMainPage_jsp.java:286)
at org.apache.jsp.jsp.product.productMainPage_jsp._jspx_meth_html_005fhtml_005f0(productMainPage_jsp.java:155)
at org.apache.jsp.jsp.product.productMainPage_jsp._jspService(productMainPage_jsp.java:92)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:604)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:543)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:656)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
at org.apache.jsp.jsp.home.baseLayout_jsp._jspx_meth_tiles_005finsert_005f2(baseLayout_jsp.java:220)
at org.apache.jsp.jsp.home.baseLayout_jsp._jspService(baseLayout_jsp.java:113)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:254)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
2015-10-10 16:20:22 DEBUG TilesRequestProcessor:312 - 'products' - processed as definition
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using:

<html:form>
</html:form>

instead of:
<form name="productForm">
</form>

I believe html:button etc. tags should be used inside an html:form.

Let me know if this work:

https://coderanch.com/t/420722/Struts/find-bean-org-apache-struts

https://coderanch.com/t/508059/Struts/Struts-find-bean-org-apache

Also I found that answer by pasting your stack trace exception text into Google:
"Cannot find bean org.apache.struts.taglib.html.BEAN in any scope"


PRODUCT ID [ServletException in:/jsp/product/productMainPage.jsp] javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope' javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at


 
vidhya mergu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your prompt response. But it is not working . if i use <html:form > it is asking for action parameter. i m using tiles Is there any problem with tiles..?

Menu .jsp
===========
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic"%>


<html:html>
<html:base/>
<head>
<title>Menu Screen</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- **** layout stylesheet **** -->
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!-- **** colour scheme stylesheet **** -->
<link rel="stylesheet" type="text/css" href="css/colour.css" />
<link rel="stylesheet" href="css/tabs.css" type="text/css">
</head>
<body>
<a href="product.do?requestTo=init" >PRODUCT</a><br>
<a href="stock.do?requestTo=init" >STOCK</a><br>
<a href="sales.do" >SALES</a><br>
<a href="purchase.do" >PURCHASE</a><br>
<a href="payments.do" >PAYMENTS</a><br>
</body>
</html:html>


BaseLayout.jsp
==========



<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@taglib uri="/WEB-INF/tld/struts-tiles.tld" prefix="tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><tiles:getAsString name="title" ignore="true" /></title>
</head>
<body>
<table border="1" cellpadding="2" cellspacing="2" height="1000" width="1000" align="center">
<tr>
<td height="5%" colspan="2">
<tiles:insert attribute="header" ignore="true" />
</td>
</tr>
<tr>
<td width="5%" height="250">
<tiles:insert attribute="menu" />
</td>
<td>
<tiles:insert attribute="body" />
</td>
</tr>
<tr>
<td height="5%" colspan="2">
<tiles:insert attribute="footer" />
</td>
</tr>
</table>
</body>
</html>

Tiles-def.xml
=========

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

<tiles-definitions>


<definition name="${YOUR_DEFINITION_HERE}">
</definition>

<definition name="baseLayout" path="/jsp/home/baseLayout.jsp">
<put name="title" value="Tiles Example" />
<put name="header" value="/jsp/home/header.jsp" />
<put name="menu" value="/jsp/home/menu.jsp" />
<put name="body" value="/jsp/home/body.jsp" />
<put name="footer" value="/jsp/home/footer.jsp" />
</definition>

<definition name="products" extends="baseLayout">
<put name="title" value="product Page" />
<put name="body" value="/jsp/product/productMainPage.jsp" />
</definition>

<definition name="sales" extends="baseLayout">
<put name="title" value="Sales Page" />
<put name="body" value="/jsp/home/sales.jsp" />
</definition>

<definition name="stocks" extends="baseLayout">
<put name="title" value="Stock Page" />
<put name="body" value="/jsp/home/stock.jsp" />
</definition>

<definition name="office" extends="baseLayout">
<put name="title" value="Office page" />
<put name="body" value="/jsp/home/office.jsp" />
</definition>

</tiles-definitions>
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course you need an action parameter. Did you look at the example in my post? (e.g. the links I provided)



Anyway, just to make sure, can you confirm you are using struts 1?

In struts 2, we use the s: tag. You should probably upgrade to struts 2 anyway especially if you are just beginning to use struts. Struts 1 is not maintained anymore I think...

Struts 2 form (Struts 2 is pretty different than Struts 1):




 
vidhya mergu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Sir, i m using struts 1. Product page is the body of the tiles framework.i do not need any further action after product page. For getting data form database in product page i m using ajax call. what to do now..can you help me.
 
Rancher
Posts: 2161
15
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the html input related tags should be within
e.g.

<html:form>
<html:text property="productId" styleClass="dText"
style="width:15em" maxlength="15" />
</html:form>
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

vidhya mergu wrote:Yes Sir, i m using struts 1. Product page is the body of the tiles framework.i do not need any further action after product page. For getting data form database in product page i m using ajax call. what to do now..can you help me.



From your code:


is a text box designed to be submitted in a form and a form is submitted to an action...

Your action seems to be:


If your are using ajax and just displaying data without submitting it than simply use:



Although you do not need to use form elements to simply display data....


Example:
http://www.mkyong.com/struts/struts-htmltext-textbox-example/

Why can't you use struts 2? It is simpler I think and strut 1 is deprecated now, not maintained, not recommended to use unless you already have a big existing project that you don't have time/money to port to struts 2.





 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!