aspose file tools*
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
Author

NO Getter method

Abebe Belew
Greenhorn

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
=====

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

<HTML>

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


Form
=====

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){
this.mrn=mrn;
}


}

Action
======
import org.apache.struts.action.*;
import javax.servlet.http.*;
import java.io.*;
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
Sheriff

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: http://aspose.com/file-tools
 
subject: NO Getter method