0

when i try to run the following code....---->

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<jsp:useBean id="accountBean" class="banking.pac.AccountForm" scope="session" />

<!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=ISO-8859-1">
<title>Insert title here</title>
<script language="javascript">
		
					
		</script>


</head>

<body>

<form name="ad_form" id="ad_form" action ="AccountAction.do">

<input type='hidden' name='dispatch' value="saveAccount">

Enter your Account Number&nbsp;&nbsp;
<html:text bean="accountBean" property="accountNumber" />
<br><br>
Enter Balance
<html:text bean="accountBean" property="balance" />

<html:submit NAME="Submit" VALUE="Save" title="Submit" />

</form>

</body>
</html>

it give this error---->

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /moneyTransfer.jsp(22,0) Attribute bean invalid for tag text according to TLD
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:238)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:975)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:696)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Validator.validate(Validator.java:1475)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:214)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.


i have made the taglib entry in web.xml as follows....>

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

n aslo pasted struts-html.tld n struts -bean.tld in web inf folder.....

PLEASE Help

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks).

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Kamalapriya
0

Following 2 lines should be causing the issue,

<html:text bean="accountBean" property="accountNumber" />
<html:text bean="accountBean" property="balance" />

Above 2 lines should be changed as below for it to work (as <html:text/> tag doesn't have a attribute named "bean"),

<html:text name="accountBean" property="accountNumber" />
<html:text name="accountBean" property="balance" />

Assumption:
accountBean is the form name.
accountNumber and balance are String attributes of accountBean form.

Struts Taglib documentation link: http://struts.apache.org/1.3.10/struts-taglib/tagreference.html#html:text

Hope this helps:-)

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.