It's not a secret anymore!
The moose likes Struts and the fly likes NO Getter method 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" Watch "NO Getter method" New topic

NO Getter method

Abebe Belew

Joined: Jul 21, 2004
Posts: 19
I am running a simple Struts application and am getting this error message
No getter method for property mrn of bean org.apache.struts.taglib.html.BEAN
Here are my files. I have remoed the opening and closing tags. Please help!


<jsp:useBean id="result" class="app.RegisterForm" scope="request"/>


<html:form action="/register">
<p> Connection to DB2 </p>
Enter MRN Please: <html:text property="mrn"/>


package app;

import org.apache.struts.action.*;
import javax.servlet.http.HttpServletRequest;

public class RegisterForm extends ActionForm{

protected String mrn;

public String getMrn(){
return (this.mrn);

public void setMrn(String mrn){


import org.apache.struts.action.*;
import javax.servlet.http.*;
import java.lang.*;
import java.sql.*;

public class RegisterAction extends Action{

private String selectStr ;
protected String mrn;

public ActionForward execute (ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)

RegisterForm c = (RegisterForm) form;
mrn = c.getMrn();

// String mrn = ((RegisterForm) form).getMrn();

HttpSession session = request.getSession(true);
session.putValue("registerSess", c);

selectStr = c.queryExecute();

return mapping.findForward("success");

Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

What does your action-mapping look like in struts-config?

A good workman is known by his tools.
I agree. Here's the link:
subject: NO Getter method
It's not a secret anymore!