欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

struts2.x中因变量命名错误不被注入到值栈的问题

程序员文章站 2022-05-21 14:46:13
[java]  //I declare...   private String aBC="abc";  //I d...

[java] 
//I declare...  
private String aBC="abc"; 

//I declare...
private String aBC="abc";Then I Alt+Shift+R and S(Generate Getter/Setter) so smoothly...andEclipseGenerate like this


[java] 
public String getaBC() { 
    return aBC; 

 
public void setaBC(String aBC) { 
    this.aBC = aBC; 

 public String getaBC() {
  return aBC;
 }

 public void setaBC(String aBC) {
  this.aBC = aBC;
 }Check this out in jsp
[html]
++<s:property value="aBC"/> 

++<s:property value="aBC"/>
nothing...damn...


So I edit Getter/Setter like this...


[java] 
<SPAN style="WHITE-SPACE: pre"> </SPAN>public String getABC() { 
        return aBC; 
    } 
 
    public void setABC(String aBC) { 
        this.aBC = aBC; 
    } 

 public String getABC() {
  return aBC;
 }

 public void setABC(String aBC) {
  this.aBC = aBC;
 }
Well done!