File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Dynmic Getter and Setter Methods? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynmic Getter and Setter Methods?" Watch "Dynmic Getter and Setter Methods?" New topic

Dynmic Getter and Setter Methods?

Edward Durai
Ranch Hand

Joined: Oct 09, 2004
Posts: 223
Hi Struts Experts,

I have one Question,
My Aim is to create the Custom Fields using Struts.
My Question Is : Is it possible to create Run Time Getter and Setter

Please Send Your Suggestions.

A.Edward Durai

Thank You<br />Edward
Pawan Rao
Ranch Hand

Joined: Dec 29, 2005
Posts: 30
Yes, this can be done. You have to improve the proxy package, we can create the new class at runtime.

Stop not till the goal is reached...
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Just use org.apache.struts.validator.LazyValidatorForm as your ActionForm bean. This class automatically gets and sets whatever property you put in an <html:xxx> tag. Fields do not have to be predefined in any way.
[ July 22, 2006: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: Dynmic Getter and Setter Methods?
It's not a secret anymore!