Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No getter method for property: "AcCode" of bean: in "com.myapp.struts.fmdBEForm"

 
Bala Ta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The getter and setter methods for AcCode are present in "com.myapp.struts.fmdBEForm".

Help me address this please.

Thanks in Advance

Bala T.A
Code for fmdBE.jsp is attached below:

<%--
Document : fmDBE
Created on : 14 Dec, 2009, 7:06:25 PM
Author : bala_ta
--%>

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!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>Double Book Entry</title>
</head>
<body>
<h1>Double Book Entry ha ha he heee!</h1>

<html:form action="/fmDBE">
Account Code: <html:text property="AcCode" /><br>
Description: <html:text property="Desc" /><br>
<html:submit value="ADD" property="ADD" />

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

Code for fmdBEForm.java is attached below:

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package com.myapp.struts;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
*
* @author bala_ta
*/
public class fmdBEForm extends org.apache.struts.action.ActionForm {

private String AcCode;
private String Desc;
private String ADD;

/**
* @return
*/
public String getAcCode() {
return AcCode;
}

/**
* @param string
*/
public void setAcCode(String string) {
AcCode = string;
}

/**
* @return
*/
public String getDesc() {
return Desc;
}

/**
* @param string
*/
public void setDesc(String Desc) {
this.Desc = Desc;
}
/**
* @return
*/
/**
* @return
*/
public String getADD() {
return ADD;
}

/**
* @param string
*/
public void setADD(String string) {
ADD = string;
}

/**
*
*/
public fmdBEForm() {
super();
// TODO Auto-generated constructor stub
}

/**
* This is the action called from the Struts framework.
* @param mapping The ActionMapping used to select this instance.
* @param request The HTTP Request we are processing.
* @return
*/
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (getAcCode() == null || getDesc() == null) {
errors.add("AcCode", new ActionMessage("error.AcCode.required"));
// TODO: add 'error.name.required' key to your resources
}
return errors;
}
}

 
Ankit Garg
Sheriff
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bala, welcome to javaranch.

Bala please Use Code Tags when you post a source code. That way your code looks formatted. Unformatted code is hard to read. You can add code tags by wrapping your code in [code] [/code] tags. You can edit your message using button and then add code tags to it.

Also try this code in your JSP
 
Bala Ta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ankit,

Thanks for your suggestion, it worked.

Can you suggest an url which list the variable conventions for struts 1.3.8?

Regards

Bala T.A
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic