getNotice_Name()方法已经定义好了,是用的myeclipse自动生成的getset方法,如下:
public String getNotice_Name() {
return notice_Name;
} public void setNotice_Name(String noticeName) {
notice_Name = noticeName;
}但是还是报错未定义,很纳闷!!!!!!!!!!!!
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 183 in the jsp file: /main/MsgList.jsp
The method getNotice_Name() is undefined for the type Msg
180:                 
181:                 %>
182:                 <tr class="evenNum">
183:                     <td><a id="<%=msg.getId() %>" href="#" onclick="viewMsg(this)"><%=msg.getNotice_Name()%></a></td>
184:                     <td><%=msg.getLocation().toString()%></td>
185:                     <td><%=hm.get(msg.getStatus()).toString()%></td>
186:  <td><%=msg.getSenderName()%></td>求帮忙~~@@@@@!!!!MyEclipseJSP

解决方案 »

  1.   

    是不是你的JSP页面没有import你的Msg这个类
      

  2.   

    Msg实体类如下:
    package com.founder.newsedit.message.model;import java.io.Serializable;
    import java.sql.Timestamp;
    import java.util.ArrayList;
    import java.util.List;
    public class Msg implements Serializable {
    private static final long serialVersionUID = -4774585938316157848L;
    public Msg(){
    this.send_time = new Timestamp(System.currentTimeMillis());
    this.status = NewsEditHelper.MSG_STATUS_WAITFORREAD;
    }

    @Override
    public String toString()
    {
    String str = null;
    try {
    str = JsonUtil.toString(this);
    } catch (Exception e) {
    e.printStackTrace();
    str = "Error";
    }
    return str;
    }

    private long id;
    private int type;
    private int status;
    private String topic;
    private String content;
    private String location;
    public String getLocation() {
    return location;
    } public void setLocation(String location) {
    this.location = location;
    } public String getNotice_Name() {
    return notice_Name;
    } public void setNotice_Name(String noticeName) {
    notice_Name = noticeName;
    } private String notice_Name;
    private int senderID;
    private int ref_ID;
    private String senderName;
    private String ref_Name;
    private Timestamp send_time;
    private Timestamp end_time;
    private List<Integer> receiverNodes = new ArrayList<Integer>();
    private int transferMode;
    private int priority;
    private List<Integer> receivers = new ArrayList<Integer>();
    private List<Integer> allReceivers = new ArrayList<Integer>();


    public long getId() {
    return id;
    }
    public void setId(long id) {
    this.id = id;
    }
    public int getType() {
    return type;
    }
    public void setType(int type) {
    this.type = type;
    }
    public int getStatus() {
    return status;
    }
    public void setStatus(int status) {
    this.status = status;
    }
    public String getTopic() {
    return topic;
    }
    public void setTopic(String topic) {
    this.topic = topic;
    }
    public String getContent() {
    return content;
    }
    public void setContent(String content) {
    this.content = content;
    }

    public int getSenderID() {
    return senderID;
    }
    public void setSenderID(int from_userID) {
    this.senderID = from_userID;
    }
    public int getRef_ID() {
    return ref_ID;
    }
    public void setRef_ID(int ref_ID) {
    this.ref_ID = ref_ID;
    }
    public String getSenderName() {
    return senderName;
    }
    public void setSenderName(String from_userName) {
    this.senderName = from_userName;
    }
    public String getRef_Name() {
    return ref_Name;
    }
    public void setRef_Name(String ref_Name) {
    this.ref_Name = ref_Name;
    }
    public Timestamp getSend_time() {
    return send_time;
    }
    public void setSend_time(Timestamp send_time) {
    this.send_time = send_time;
    }
    public Timestamp getEnd_time() {
    return end_time;
    }
    public void setEnd_time(Timestamp end_time) {
    this.end_time = end_time;
    }
    public List<Integer> getReceiverNodes() {
    return receiverNodes;
    }
    public void setReceiverNodes(List<Integer> to_NodeID) {
    this.receiverNodes = to_NodeID;
    }
    public List<Integer> getReceivers() {
    return receivers;
    }
    public void setReceivers(List<Integer> to_userIdList) {
    this.receivers = to_userIdList;
    }
    public int getTransferMode() {
    return transferMode;
    }
    public void setTransferMode(int transferType) {
    this.transferMode = transferType;
    } public int getPriority() {
    return priority;
    } public void setPriority(int priority) {
    this.priority = priority;
    }
    public void addReceiver(int receiverID) {
    this.receivers.add(receiverID);
    }
    public void addReceiverNode(int nodeID) {
    this.receiverNodes.add(nodeID);
    }

    public List<Integer> getAllReceivers(){
    return allReceivers;
    }
    public void setAllReceivers(List<Integer> allReceivers) {
    this.allReceivers = allReceivers;
    }
    }