我是 Spring 框架和 java 的新手。我正在为我的网络应用程序创建注册模块。我创建了 DAO、DTO、Dispatcher Servlet、控制器等等。当我提交表单时,它会将我重定向到我想去的地方,但没有数据添加到数据库中。
我的用户DTO.java
package com.lagan.dto;
public class userDto{
public String userId;
public String firstName;
public String lastName;
public String birthDate;
public int gender;
public String email;
public String password;
public String getUserId() {
return userId;
}
public String getUserId(String userId) {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getBirthDate() {
return birthDate;
}
public void setBirthDate(String birthDate) {
this.birthDate = birthDate;
}
public int getGender() {
return gender;
}
public void setGender(int gender) {
this.gender = gender;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password){
this.password = password;
}
}
userDao.java
package com.lagan.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import com.lagan.dbconnector.dbconnect;
import com.lagan.dto.userDto;
湖上湖
小怪兽爱吃肉
相关分类