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 No getter method for property: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No getter method for property: "AcCode" of bean: in "com.myapp.struts.fmdBEForm"" Watch "No getter method for property: "AcCode" of bean: in "com.myapp.struts.fmdBEForm"" New topic
Author

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

Bala Ta
Greenhorn

Joined: Dec 15, 2009
Posts: 2
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

Joined: Aug 03, 2008
Posts: 9302
    
  17

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


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bala Ta
Greenhorn

Joined: Dec 15, 2009
Posts: 2
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No getter method for property: "AcCode" of bean: in "com.myapp.struts.fmdBEForm"