Yes I know, but when you create a value object you dont want setters.  What I want is a bean like structure that has no setters.  I want to be able to create it by passing values to a constructor.
----- Original Message -----
Sent: Tuesday, July 10, 2001 11:29 AM
Subject: RE: can Struts tags create a bean using constructor instead of setter

Beans need to have public. no-argument constructors, unless they are explicitly created and stored in the required scope.
 

Regards

<Meeraj/>

-----Original Message-----
From: Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 10, 2001 3:01 PM
To: [EMAIL PROTECTED]
Subject: can Struts tags create a bean using constructor instead of setter

Are struts tags currently designed to handle this for me?:
====================================================
package com.vnu.models;
 
public class JumpUrlsBean extends java.lang.Object{
 
    private String targetUrl = null;
 private String successUrl = null;
 private String failureUrl = null;
 
 public JumpUrlsBean(String targetUrl, String successUrl, String failureUrl){
     this.targetUrl = targetUrl;
     this.successUrl = successUrl;
     this.failureUrl = failureUrl;
 }
 public String getTargetUrl(){
  return this.targetUrl;
 }
 public String getSuccessUrl(){
  return this.successUrl;
 }
 public String getFailureUrl(){
  return this.failureUrl;
 }
}
====================================================
There is purposely no setter method because it shouldnt be modifyable.  However, I want Struts to populate it for me

Reply via email to