算了算了,放全部代码也太麻烦了叭

直接放项目文件好了

  1. 独立完成教材第96页实例4.1。
    实验4 Struts实验三



    show.jsp


package com.oohuo.action;

import com.oohuo.vo.UserInfo;
import com.opensymphony.xwork2.ActionSupport;

/**

  • @author : Han Zou

  • @distribution :

  • @date : Created in 2019/11/4 9:30
    */
    public class SimpleTypeConverter extends ActionSupport {
    public UserInfo user;

    public UserInfo getUser(){
    return user;
    }
    public void setUser(){
    this.user = user;
    }
    public String excute() throws Exception {
    return SUCCESS;
    }

}

package com.oohuo.vo;

import java.util.Date;

/**

  • @author : Han Zou

  • @distribution :

  • @date : Created in 2019/11/4 9:16

  • username

  • password

  • age

  • birthday

  • tel
    */
    public class UserInfo {
    public String getUsername() {
    return username;
    }

    public void setUsername(String username) {
    this.username = username;
    }

    public String getPassword() {
    return password;
    }

    public void setPassword(String password) {
    this.password = password;
    }

    public int getAge() {
    return age;
    }

    public void setAge(int age) {
    this.age = age;
    }
    public Date getBirthday() {
    return birthday;
    }

    public void setBirthday(Date birthday) {
    this.birthday = birthday;
    }

    public String getTel() {
    return tel;
    }

    public void setTel(String tel) {
    this.tel = tel;
    }

    private String username;
    private String password;
    private int age;
    private Date birthday;
    private String tel;

}

  1. 独立完成教材第99页实例4.2。

  2. 使用Struts2框架实现如下功能:
    在网页date.jsp中提供一个文本框和提交按钮,按照“年-月-日”的形式提交生日,例如:1999-11-10,自定义一个转换器,在网页show.jsp中分别输出年、月、日,并根据当前系统日期显示年龄(实岁),例如:如果当前日期为2019年11月1日,则显示19岁;如果当前日期为2019年11月11日,则显示20岁。

  3. 独立完成教材第104页实例4.3。

  4. 独立完成教材第108页实例4.4,使用三种不同的方法对数据进行校验。

  5. 使用Struts2校验框架实现如下功能:
    输入学生的基本信息:学号、姓名、性别、出生年月、专业、总学分等,要求输入满足以下条件:
    (1) 学号前两位大于“13”并且后面4位必须为数字;
    (2) 出生年月必须保证年龄大于等于18岁;
    (3) 专业不能为空;
    (4) 总学分在0-80之间。

  6. 使用Struts实现图片上传功能,要求对图片格式进行校验,即上传的文件必须是图片格式。

链接:https://pan.baidu.com/s/1asm2hxE7DuXnMhQuTR4xLQ
提取码:fzlo
复制这段内容后打开百度网盘手机App,操作更方便哦

相关文章:

  • 2021-12-16
  • 2021-11-18
  • 2021-12-23
  • 2021-07-18
猜你喜欢
  • 2021-06-01
相关资源
相似解决方案