weixin_45222913
爱吃茄子的lcl
2020-04-26 15:15
采纳率: 100%
浏览 453
已采纳

jsp页面调用servlet数据问题,数据不显示,求大佬呀

dao层实现类测试过,可以输出数据

应该只是jsp和Servlet之间数据传输问题,jsp页面运行后也没有报错,考虑过是不是路径问题,但怎么修改,都没有显示

Servlet界面:

图片说明

jsp界面:

图片说明

请问哪里出错了,救救毕设的孩子

我的User类:

package project;

import java.util.Date;

public class User {
    private Long uid;//id
    private String usex;
    private String uname;//昵称
    private String upwd;//密码
    private String uphone;//电话
    private String uemail;//邮件
    private Date ubirth;//出身日期
    private String uaddress;//住址

    private String ucomment;//备注

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public String getUsex() {
        return usex;
    }

    public void setUsex(String usex) {
        this.usex = usex;
    }
    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getUpwd() {
        return upwd;
    }

    public void setUpwd(String upwd) {
        this.upwd = upwd;
    }

    public String getUphone() {
        return uphone;
    }

    public void setUphone(String uphone) {
        this.uphone = uphone;
    }

    public String getUemail() {
        return uemail;
    }

    public void setUemail(String uemail) {
        this.uemail = uemail;
    }


    public Date getUbirth() {
        return ubirth;
    }

    public void setUbirth(Date ubirth) {   
        this.ubirth = ubirth;
    }



    public User(Long uid, String uname, String upwd,String usex,String uaddress, String uphone, String uemail, Date ubirth,String ucomment) {
        this.uid = uid;
        this.uname = uname;
        this.upwd = upwd;
        this.ucomment = ucomment;
        this.usex = usex;
        this.uaddress=uaddress;
        this.uphone = uphone;
        this.uemail = uemail;
        this.ubirth = ubirth;
    }

    public User() {
    }

    @Override
    public String toString() {
        return "User{" +
                "uid=" + uid +
                ", uname='" + uname + '\'' +
                ", upwd='" + upwd + '\'' +
                ", usex='" + usex + '\'' +
                ", uaddress='" + uaddress + '\'' +

                ", uphone='" + uphone + '\'' +
                ", uemail='" + uemail + '\'' +
                ", ubirth=" + ubirth +
                ", ucomment=" + ucomment +
                '}';
    }

    public String getUaddress() {
        return uaddress;
    }

    public void setUaddress(String uaddress) {
        this.uaddress = uaddress;
    }

    public String getUcomment() {
        return ucomment;
    }

    public void setUcomment(String ucomment) {
        this.ucomment = ucomment;
    }

}

EL表达式

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

浏览器:
图片说明

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • wifiaaa
    wifiaaa 2020-04-26 16:08
    已采纳

    你好,可以看一下你的User类么,是不是EL表达式$中没有对应上?
    User类中要有相应的set,get方法,${con.uname}这种写法默认调用get方法。

    可以放一下浏览器的截图么?

    点赞 评论

相关推荐