• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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;
}
}

 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I don't always make ads but when I do they're tiny
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic