새무침
40
2020-11-30 00:36:05
4
173

jsp mysql 서버연동 http 500 오류



<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="file.FILEDAO" %>
<%@ page import="java.io.PrintWriter"%>
<% request.setCharacterEncoding("UTF-8"); %>
<jsp:useBean id="File" class="file.FileDTO" scope="page"/>
<jsp:setProperty name="file" property="name"/>
<jsp:setProperty name="file" property="phonenumber"/>
<jsp:setProperty name="file" property="postnumber"/>
<jsp:setProperty name="file" property="roadaddress"/>
<jsp:setProperty name="file" property="storedate"/>
<jsp:setProperty name="file" property="storeshape"/>
<jsp:setProperty name="file" property="storearea"/>
<jsp:setProperty name="file" property="storeseat"/>
<jsp:setProperty name="file" property="storedeposit"/>
<jsp:setProperty name="file" property="storeemonthrent"/>
<jsp:setProperty name="file" property="storestarttime"/>
<jsp:setProperty name="file" property="storeendtime"/>
<jsp:setProperty name="file" property="storenearage"/>
<jsp:setProperty name="file" property="storeexplain"/>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%String userID = null;
		if(session.getAttribute("userID") != null){
			userID = (String) session.getAttribute("userID");
			PrintWriter script = response.getWriter();
			script.println("<script>");
			script.println("alert('로그인을하세요')");
			script.println("location.href = 'index.jsp'");
		   script.println("</script>");
		}else{		
		if(File.getName() == null || File.getPhonenumber() == null|| File.getPostnumber() == null || File.getRoadaddress() == null || File.getStoredate() == null || File.getStoreshape() == null || File.getStorearea()  == null 
				|| File.getStoreseat()== null || File.getStoredeposit()  == null || File.getStoremonthrent()  == null || File.getStorestarttime() == null || File.getStoreendtime()  == null || File.getStorenearage()  == null || File.getStoreexplain() == null
				|| File.getStoreexplain()  == null 	)
		{
			PrintWriter script = response.getWriter();
			script.println("<script>");
			script.println("alert('입력이안된부분이있습니다')");
			script.println("history.back()");
		   script.println("</script>");
		}
			 else{
				 PrintWriter script = response.getWriter();
					script.println("<script>");
					script.println("location.href = 'bbs.jsp'");
				   script.println("</script>");
			 }
			 
		}
		
	
	%>
</body>
</html>


package file;

public class FileDTO {
	 private int fileID;
	 private  String	name;
	 private String	phonenumber;
	 private String	postnumber;
	 private String	roadaddress;
	 private String title;
	 private String	storedate;
	 private String	storeshape;
	 private String	storearea;
	 private String	storeseat;
	 private String	storedeposit;
	 private String	storemonthrent;
	 private String	storestarttime;
	 private String	storeendtime;
	 private  int checkoption1;
	 private  int shareoption1;
	 private  int checkoption2;
	 private  int shareoption2;
	 private  int checkoption3;
	 private  int shareoption3;
	 private  int checkoption4;
	 private  int shareoption4;
	 private  String storenearschool;
	 private  String storenearstation;
	 private  String storenearage;
	 private  String fileName;
	 private  String fileRealName;
	 private  String storeexplain;
	 private  String fileDate;
	 private  int fileAvailable;
	public int getFileID() {
		return fileID;
	}
	public void setFileID(int fileID) {
		this.fileID = fileID;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPhonenumber() {
		return phonenumber;
	}
	public void setPhonenumber(String phonenumber) {
		this.phonenumber = phonenumber;
	}
	public String getPostnumber() {
		return postnumber;
	}
	public void setPostnumber(String postnumber) {
		this.postnumber = postnumber;
	}
	public String getRoadaddress() {
		return roadaddress;
	}
	public void setRoadaddress(String roadaddress) {
		this.roadaddress = roadaddress;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getStoredate() {
		return storedate;
	}
	public void setStoredate(String storedate) {
		this.storedate = storedate;
	}
	public String getStoreshape() {
		return storeshape;
	}
	public void setStoreshape(String storeshape) {
		this.storeshape = storeshape;
	}
	public String getStorearea() {
		return storearea;
	}
	public void setStorearea(String storearea) {
		this.storearea = storearea;
	}
	public String getStoreseat() {
		return storeseat;
	}
	public void setStoreseat(String storeseat) {
		this.storeseat = storeseat;
	}
	public String getStoredeposit() {
		return storedeposit;
	}
	public void setStoredeposit(String storedeposit) {
		this.storedeposit = storedeposit;
	}
	public String getStoremonthrent() {
		return storemonthrent;
	}
	public void setStoremonthrent(String storemonthrent) {
		this.storemonthrent = storemonthrent;
	}
	public String getStorestarttime() {
		return storestarttime;
	}
	public void setStorestarttime(String storestarttime) {
		this.storestarttime = storestarttime;
	}
	public String getStoreendtime() {
		return storeendtime;
	}
	public void setStoreendtime(String storeendtime) {
		this.storeendtime = storeendtime;
	}
	public int getCheckoption1() {
		return checkoption1;
	}
	public void setCheckoption1(int checkoption1) {
		this.checkoption1 = checkoption1;
	}
	public int getShareoption1() {
		return shareoption1;
	}
	public void setShareoption1(int shareoption1) {
		this.shareoption1 = shareoption1;
	}
	public int getCheckoption2() {
		return checkoption2;
	}
	public void setCheckoption2(int checkoption2) {
		this.checkoption2 = checkoption2;
	}
	public int getShareoption2() {
		return shareoption2;
	}
	public void setShareoption2(int shareoption2) {
		this.shareoption2 = shareoption2;
	}
	public int getCheckoption3() {
		return checkoption3;
	}
	public void setCheckoption3(int checkoption3) {
		this.checkoption3 = checkoption3;
	}
	public int getShareoption3() {
		return shareoption3;
	}
	public void setShareoption3(int shareoption3) {
		this.shareoption3 = shareoption3;
	}
	public int getCheckoption4() {
		return checkoption4;
	}
	public void setCheckoption4(int checkoption4) {
		this.checkoption4 = checkoption4;
	}
	public int getShareoption4() {
		return shareoption4;
	}
	public void setShareoption4(int shareoption4) {
		this.shareoption4 = shareoption4;
	}
	public String getStorenearschool() {
		return storenearschool;
	}
	public void setStorenearschool(String storenearschool) {
		this.storenearschool = storenearschool;
	}
	public String getStorenearstation() {
		return storenearstation;
	}
	public void setStorenearstation(String storenearstation) {
		this.storenearstation = storenearstation;
	}
	public String getStorenearage() {
		return storenearage;
	}
	public void setStorenearage(String storenearage) {
		this.storenearage = storenearage;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getFileRealName() {
		return fileRealName;
	}
	public void setFileRealName(String fileRealName) {
		this.fileRealName = fileRealName;
	}
	public String getStoreexplain() {
		return storeexplain;
	}
	public void setStoreexplain(String storeexplain) {
		this.storeexplain = storeexplain;
	}
	public String getFileDate() {
		return fileDate;
	}
	public void setFileDate(String fileDate) {
		this.fileDate = fileDate;
	}
	public int getFileAvailable() {
		return fileAvailable;
	}
	public void setFileAvailable(int fileAvailable) {
		this.fileAvailable = fileAvailable;
	}
	public FileDTO(int fileID, String name, String phonenumber, String postnumber, String roadaddress, String title,
			String storedate, String storeshape, String storearea, String storeseat, String storedeposit,
			String storemonthrent, String storestarttime, String storeendtime, int checkoption1, int shareoption1,
			int checkoption2, int shareoption2, int checkoption3, int shareoption3, int checkoption4, int shareoption4,
			String storenearschool, String storenearstation, String storenearage, String fileName, String fileRealName,
			String storeexplain, String fileDate, int fileAvailable) {
		super();
		this.fileID = fileID;
		this.name = name;
		this.phonenumber = phonenumber;
		this.postnumber = postnumber;
		this.roadaddress = roadaddress;
		this.title = title;
		this.storedate = storedate;
		this.storeshape = storeshape;
		this.storearea = storearea;
		this.storeseat = storeseat;
		this.storedeposit = storedeposit;
		this.storemonthrent = storemonthrent;
		this.storestarttime = storestarttime;
		this.storeendtime = storeendtime;
		this.checkoption1 = checkoption1;
		this.shareoption1 = shareoption1;
		this.checkoption2 = checkoption2;
		this.shareoption2 = shareoption2;
		this.checkoption3 = checkoption3;
		this.shareoption3 = shareoption3;
		this.checkoption4 = checkoption4;
		this.shareoption4 = shareoption4;
		this.storenearschool = storenearschool;
		this.storenearstation = storenearstation;
		this.storenearage = storenearage;
		this.fileName = fileName;
		this.fileRealName = fileRealName;
		this.storeexplain = storeexplain;
		this.fileDate = fileDate;
		this.fileAvailable = fileAvailable;
	}
}
	
	 
	

	
	
	
	
	

계속 내부서버 오류라는데  속성값이  유효하지않다는게 무슨소린지 모르겟습니다 ㅠㅠㅠ

0
  • 답변 4

  • 초보자1212
    1k
    2020-11-30 01:34:10

    오류 그대로 검색해도 결과가 좀 나오던데 혹시 검색해보셨을까요

  • 새무침
    40
    2020-11-30 01:52:36

    DTO 파일 문제인거같은데 검색해본걸 다해봐도 안바뀌더라구요 그냥 밀고 다시해볼생각입니다..

  • 초보자1212
    1k
    2020-11-30 01:56:07

    클래스 네임을 바꿔서 테스트 해보시는건 어떠신가요?

    . 이 아니라 - 나 _ 로?

  • sdfsdfefwefwefew
    9
    2020-11-30 06:36:15 작성 2020-11-30 06:36:36 수정됨
    1.<jsp:setProperty name="file" property="name"/> .. -> <jsp:setProperty name="file" property="*"/>
    2.<jsp:useBean id="File" class="file.FileDTO" scope="page"/> -> <jsp:useBean id="file" class="file.FileDTO" scope="page"/>
    <jsp:useBean id="File" class="file.FileDTO" scope="page"/> != <jsp:setProperty name="file" property="name"/>
  • 로그인을 하시면 답변을 등록할 수 있습니다.