Error type field is defined inside a class
code
package cn.hakim.bean.project;
public enum Privacy {
NOTENCRYPTED {
public String getName () {
return " no encryption " ;
}
},
CONFIDENTIAL {
public String getName () {
return " Confidential" ;
}
},
TOPSECRET {
public String getName () {
return " top secret " ;
}
};
public abstract String getName ();
}
Here is the body of the table class
/ / level of confidentiality
private Privacy privacy = Privacy.NOTENCRYPTED; default give this to him.
@ Enumerated (EnumType.STRING)
@ Column (length = 13, nullable = false)
public Privacy getPrivacy () {
return privacy;
}
public void setPrivacy (Privacy privacy) {
this.privacy = privacy;
}
Form class
private Privacy privacy;
public Privacy getPrivacy () {
return this.privacy;
}
public void setPrivacy (Privacy privacy) {
this.privacy = privacy;
}
Here is a modified interface code , is to click submit when modifying packet error .
------ Solution ------------------------------------ --------
silently access points indicates the presence
------ Solution ------------------------ --------------------
private is this problem ?
------ Solution ---------------------------------------- ----
error message? Posted
------ Solution -------------------------------------- ------
visual enumeration problems
------ Solution ----------------------------- ---------------
I think there might be such a
privacy is an enumerated type
and your value is CONFIDENTIAL
CONFIDENTIAL is a string
in the value of the radio changed
privacy.NOTENCRYPTED
privacy.CONFIDENTIAL
privacy.TOPSECRET
------ For reference only ---------------------------------- -----
------ For reference only ---------------------------------------
impatient ah. Solving . . .
------ For reference only -------------------------------------- -
---- - For reference only ---------------------------------------
enumeration is when defining assignment
then only call the
------ For reference only --------------------------- ------------
java.lang.IllegalArgumentException: Cannot invoke cn.hakim.web.formbean.projectinfo.DocumentsForm.setPrivacy - argument type mismatch
------ For reference only ---------------------------------------
this error is not the parameter type is not match it? look at the types
------ For reference only --------------------------------- ------
Form class privacy should be of type String to receive it , struts1 this is not clear
------ For reference only ------------ ---------------------------
I just came to pick points ..
------ For reference only -------------------------- -------------
access points
------ For reference only ---------------------------------------
line and looked at 14 I think you will not use the enumeration
------ For reference only ------------------- --------------------
I really have not used
------ For reference only ---------------------------------------
I really did not used
I said floor living
没有评论:
发表评论