회원가입 기능
- 이메일 인증기능
- springframework에서 JavaMailSenderImpl bean을 활용한 메일 전송
- 회원 가입 정규식

로그인 기능
- 쿠키를 이용한 이메일 기억하기 기능
- aop: around를 이용한 로그인 확인, 프로젝트 소속 확인

할일 리스트 기능
- 'Lobi List' 플러그인의 css와 js함수 분석
- 할일리스트 조회, 삽입, 수정, 삭제 ajax 연동
- 할일항목 조회, 삽입, 수정, 삭제 ajax 연동
- 드래그앤드롭 방식으로 리스트와 카드 정렬 순서 변경 기능
- 리스트 스타일 변경 기능
- 입력폼 정규식 및 크기 제한
- 리스트가 없을시 '리스트추가버튼' 생성 & 도움말 출력 기능
- 주간 스케쥴러와 작업 진행률바 css 수정 (위치, 토글, 스크롤색상)

(ORACLE) DB table
- member
- Task_list
- Task_card

JSP
- member/email_injeung.jsp
- member/email.jsp
- member/join.jsp
- member/login.jsp
- Task/task.jsp
- Task/scheduler.jsp
- Task/modal.jsp

controller
- MemberController
- TaskController

DAO
- MemberDAO
- ListDAO

service
- MemberService
- ListService

mapper
- member-mapper.xml
- list-mapper.xml
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<link href='/resources/css/calendar/calendar.css?after' rel='stylesheet' />
<script src='/resources/js/calendar/calendar.js'></script>
<!--<jsp:include page="../header/cdn.jsp"></jsp:include>-->
<!-- Jquery -->
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<!-- 부트스트랩 -->
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script
   src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<!-- 아이콘 -->
<script src="https://kit.fontawesome.com/8f6ea3bf70.js"
	crossorigin="anonymous"></script>
 <!-- 구글 폰트 -->
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500&display=swap" rel="stylesheet">	





<!-- Lobi List Default installation-->
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/jquery/jquery-ui.min.css" />
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="/resources/lobilist-master/dist/lobilist.min.css">
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/lobibox/css/lobibox.min.css">
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/highlight/github.css">
<!--<link rel="stylesheet" href="resources/lobilist-master/demo/demo.css">-->

<style>
body {
	overflow-y: hidden;
	overflow-x: hidden;
}

#wrapper {
	width: 1100px;
	position: fixed;
	z-index: 10;
	bottom: 0px;
	left: 25%;
	background-color: rgba(255, 255, 255, 0.7);
}

#todoListBox {
	margin: 10px;
	overflow: hidden;
}

#box {
	margin: 10px 0px 0px 10px;
}

#calendar {
	max-width: 1100px;
	margin: 0 auto;
}

#todoListBox {
	width: 100%;
}

#calendarBox {
	margin-top: 100px;
	width: 1200px;
	margin: 0 auto;
}

#actions-by-ajax {
	height: 88%;
	overflow-y: hidden;
}
.modal {
  position: absolute;
  top: 50px;
  right: 100px;
  bottom: 0;
  left: 0;
  z-index: 100;
  overflow: auto;
  overflow-y: auto;
}
</style>


</head>


<body>

	<script>
	 document.addEventListener('DOMContentLoaded', function() {
			
		    var calendarEl = document.getElementById('calendar');
			
		    var calendar = new FullCalendar.Calendar(calendarEl, {
		    	height:200,
		    	displayEventTime:false,//제목에 시간 같이 display 안되게 설정하는
		    	locale: "ko", // 한국어로 설정 
		    	initialView:'dayGridWeek',
		      	headerToolbar: {
		        left: 'prev,next today',
		        center: 'title',
		        right: 'dayGridWeek,dayGridDay'
		      },
		      navLinks: true, // can click day/week names to navigate views
		      selectable: true,
		      selectMirror: true,
		      select: function(arg) {
		          function date_to_str(format)
		          {//날짜형식 내가 원하는 대로 바꾸는 함수 
		              var year = format.getFullYear();
		              var month = format.getMonth() + 1;
		              if(month<10) month = '0' + month;
		              var date = format.getDate();
		              if(date<10) date = '0' + date;
		              var hour = format.getHours();
		              if(hour<10) hour = '0' + hour;
		              var min = format.getMinutes();
		              if(min<10) min = '0' + min;
		             
				       return year + "-" + month + "-" + date + "T" + hour + ":" + min;
		          }
		          var arg_time = date_to_str(arg.start); //내가 클릭한 날짜
		    	//modal 띄우기 
		        $("#myModal").modal(); 
		        $("#modal_date_start").val(arg_time);
		    	//일정 끝나는 시간이 시작시간보다 빠르면 바꿔주는 이벤트 - 시작시간 선택 후 끝나는 시간 선택 했을 때
		    	$("#modal_date_end").focusout(function(){
		    		if(($("#modal_date_end").val()).replace(/[^0-9]/g,"")<($("#modal_date_start").val()).replace(/[^0-9]/g,"")){
		    		$("#modal_date_end").val($("#modal_date_start").val());
		    	}
		    	})
		    	
		    		//일정 끝나는 시간이 시작시간보다 빠르면 바꿔주는 이벤트 - 끝나는 시간 선택 후 시작 시간 선택 했을 때
		    	$("#modal_date_start").focusout(function(){
		    			if(($("#modal_date_start").val()).replace(/[^0-9]/g,"")>($("#modal_date_end").val()).replace(/[^0-9]/g,"")){
		    	    		if($("#modal_date_end").val()==''){
		    	    			
		    	    		} else{
		    	    			$("#modal_date_start").val($("#modal_date_end").val()); 
		    	    		}	
		    		} 	
		    	})
		    	
		       
		        
		        calendar.unselect();
		      },
		      eventClick: function(arg) {
		    	var seq = arg.event.id;
		    	$.ajax({
		    		url : "../calendar/selectEvent",
		    		type: "post",
		    		data:{seq:seq}
		    	}).done(function(resp){
		    		resp=JSON.parse(resp);
		    		var seq=resp.seq;
		  			var projcet_seq=resp.project_seq;
		  			var title = resp.title;
		  			var contents = resp.contents;
		  			var writer = resp.writer;
		  			var start_date=resp.start_date;
		  			var end_date=resp.end_date;
		  			var color=resp.color;
		  			
		  			$('.dialog__content h4').append('<div class='+'dynamic'+'>'+title+'</div>'); 
		  			$('.dialog__content>div:nth-child(2)').append('<div class="dynamic" style="width:270px;">'+contents+'</div>');
		  			$('.dialog__content>div:nth-child(4)').append('<div class='+'dynamic'+'>'+start_date+'</div>');
		  			$('.dialog__content>div:nth-child(4)').after('<div class='+'dynamic'+' style="margin-left:80px">'+end_date+'</div>');
		  			$('.dialog__content>div:nth-child(6)').append('<div class="dynamic" style="float:left">'+writer+'</div>');
		  			
		  			$('#title-color').css('background-color',color);
		  			
		    		const modal = document.querySelector('dialog');
		        	const btnClose = document.querySelectorAll('.button-close');
		        	modal.showModal();
		        	btnClose.forEach((elm) => elm.addEventListener('click', () => closeModal()));
		        	modal.addEventListener('click', (e) => detectBackdropClick(e));
		      
		        	closeModal = () => {
		        	    modal.classList.add("dialog__animate-out");
		        	    modal.addEventListener('animationend', handleClose, false);
		        	   
		        	}

		        	handleClose = () => {
		        	    modal.classList.remove("dialog__animate-out");
		        	    modal.removeEventListener('animationend', handleClose, false);
		        	    modal.close();
		        	    $('.dynamic').remove(); 
		        	}

		        	detectBackdropClick = (event) => {
		        	    if(event.target === modal) {
		        	        closeModal();
		        	    }
		        	}
		        	
		        	 $('#eventEdit').on('click',function(){    		 
		        		 closeModal();	
		        		 //수정하기 modal에  값 채워넣기 
		        		 $('#Editrecipient-name').val(title);
		        		 $("#Editmessage-text").val(contents)
		        		 $('#Editmodal_date_start').val(start_date);
		        		 $('#Editmodal_date_end').val(end_date);
		        		 /* $('.Editcustom-radios input[type=radio][name=Editcolor][background-color:'+color+']:checked'); */
		        		 //색깔 선택 수정하기 !!!!!!
		        		 sessionStorage.setItem("seq",seq);
		            	 $("#EditmyModal").modal();
		        		 
		            }) 
		            
		            $('#eventDelete').on("click",function(){//일정 삭제하기
		            	sessionStorage.setItem("seq",seq);
		            	closeModal();
		            	$('#deleteModal').modal();
		            })
		            
		            
		    	})	
		    
		      },
		     /*  editable: true, */
		      dayMaxEvents: true, // allow "more" link when too many events
		      events: [
		    	   <c:forEach var="i" items="${list}">
		         	{
		         		id:'${i.seq}',
		         		title:'${i.title}',
		         		start:'${i.start_date}',
		         		end:'${i.end_date}',
		         		color:'${i.color}'
		         	},
		         </c:forEach>	 
		      ]
		    });
		   
		    //일정 생성하기 버튼 눌렀을 때 : 이벤트 안에 이벤트를 넣으면 버그가 일어난다!  
			   $("#save").on("click",function(){
		        var title = $("#recipient-name").val();
		        var start = $('#modal_date_start').val();
		        var end =$('#modal_date_end').val(); 
		        var color = $('input[type=radio][name=color]:checked').val();
		 	
		        if(title==''){
		        	alert("제목은 필수 입력값 입니다!");
		        	
		        }else{
		        	$.ajax({
		            	url:"../calendar/addEvent",
		            	type:"post",
		            	data:{
		            		title : title,
		            		start_date : start,
		            		end_date: end,
		            		contents : $("#message-text").val(),
		            		writer : '${loginInfo.name}',
		            		color : color,
		            		poject_seq:0
		            	}
		            }).done(function(resp){
		           		resp=JSON.parse(resp);
		           		var seq = resp.seq
		           		if(title){
		                    calendar.addEvent({
		                    	id:seq,
		                        title:title,
		                        start:start,
		                        end:end,
		                        color:color
		                    })
		                }
		           		
		            })
		            /*   modal clean 하기 */
		            $("#recipient-name").val("");
		            $('#modal_date_start').val("");
		            $('#modal_date_end').val("");
		            $("#message-text").val("");
		            $("#modal_select").val('red');
		    			
		            
		            /* modal hide  */
		            $("#myModal").modal('hide');
		        }
		        
		        
		        
		        
		    
		    })
		    
		 //ㅡㅡㅡㅡㅡㅡㅡㅡ일정 수정하기 ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
		  $('#Editsave').on("click",function(){//수정완료 버튼 
			       			
		        	var seq = sessionStorage.getItem("seq");          
		       		var Edittitle = $('#Editrecipient-name').val();
		       		var Editstart = $('#Editmodal_date_start').val();
		       		var Editend = $('#Editmodal_date_end').val();
		       		var Editcolor = $('input[type=radio][name=Editcolor]:checked').val();
		       		
		       	 if(Edittitle==''){
		         	alert("제목은 필수 입력값 입니다!");
		         	
		         }else{
		        	 $.ajax({
		        			url:'../calendar/EditEvent',
		        			type:'post',
		        			data:{ 
		        			seq:seq, //수정하려면 seq 필요 . 맨 첫번째 줄에서 seq 선언. 
		        			title:Edittitle,
		        			start_date:Editstart,
		          			end_date:Editend,
		          			contents: $("#Editmessage-text").val(),
		          			writer:'${loginInfo.name}',
		          			color: Editcolor,
		          			project_seq:0
		        			}		
		        		}).done(function(resp){	
		        	       
		        		   //일단 삭제 하고 
		        		   var eventObj = calendar.getEventById(seq);
		        			eventObj.remove(); 
		 	
		        		  if(Edittitle){//다시 만든다 똑같은 id(seq) 써주기
		        			 	 calendar.addEvent({
		        					id:seq,
		        					title:Edittitle,
		        					start:Editstart,
		        					end:Editend,
		        					color:Editcolor
		        				})
		        			}    
		        			
		        		
		        			
		        			    //modal clean 하기 
		                 $("#Editrecipient-name").val("");
		                 $('#Editmodal_date_start').val("");
		                 $('#Editmodal_date_end').val("");
		                 $("#Editmessage-text").val("");
		                 $("#Editmodal_select").val('red');
		        				
		                  
		                 /* modal hide  */
		                   $("#EditmyModal").modal('hide'); 
		                   sessionStorage.removeItem('seq');
		                 
		        		 })
		         }
		       		
		       		
		       		  
		       	}) 
		             //ㅡㅡㅡㅡㅡㅡㅡㅡ일정 삭제하기ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ	         
		                   $("#deletebtn").on("click",function(){                  
		                	   var seq = sessionStorage.getItem("seq"); 
		                      $.ajax({
		                         url:'../calendar/DeleteEvent',
		                         type:'post',
		                         data:{seq:seq}
		                      }).done(function(resp){
		                    	  sessionStorage.removeItem('seq');
		                      })
		                  	var eventObj = calendar.getEventById(seq);
		             			eventObj.remove();
		                   }) 
		                  
		   calendar.render(); 
		  });

</script>

	<!-- Header -->
	<jsp:include page="../header/header.jsp"></jsp:include>
	<!-- 왼쪽 사이드바 -->
	<jsp:include page="../header/sidebar-left.jsp"></jsp:include>


	<section id="box">






		<div id="wrapper">


			<!--테스트-->
			<div class="accordion" id="accordionExample">
				<div class="card">
					<div class="card-header" id="headingOne">
						<h2 class="mb-0">
							<button class="btn btn-link btn-block text-left" type="button"
								data-toggle="collapse" data-target="#collapseOne"
								aria-expanded="true" aria-controls="collapseOne">주간
								스케쥴러</button>
						</h2>
					</div>

					<div id="collapseOne" class="collapse show"
						aria-labelledby="headingOne" data-parent="#accordionExample">
						<div class="card-body">
									

<!-- -----------------------------------------------------------------------------------------------------------------------------------------------------------		-->
					<div id="calendarBox">
						<div id='calendar'></div>
						
						
						<!-- ㅡㅡㅡㅡㅡㅡㅡ일정 조회하기ㅡㅡㅡㅡㅡㅡㅡ -->
						<div class="row">
							<div class="col-3">
								<dialog>
								<div class="dialog__inner">
									<div>
										<i class="far fa-edit" id="eventEdit"></i> <i
											class="far fa-trash-alt" id="eventDelete"></i>
										<button class="button button-close">╳</button>
									</div>

									<div class="dialog__content">
										<div>
											<div id="title-color"></div>
											<h4></h4>
										</div>
										<div>
											<i class="fas fa-bars"></i>

										</div>
										<br>
										<div>
											<i class="far fa-clock"></i>
										</div>

										<div>
											<i class="fas fa-user-edit"></i>
										</div>
										<footer class="dialog__footer">
											<button class="button button-close">확인</button>
										</footer>
									</div>
								</div>
								</dialog>
							</div>
						</div>
						<!-- ㅡㅡㅡㅡㅡㅡㅡ/일정 조회하기ㅡㅡㅡㅡㅡㅡㅡ -->



					</div>
	<!-- -----------------------------------------------------------------------------------------------------------------------------------------------------------		-->
	
	
	
						</div>
					</div>
				</div>


			</div>

			<!--테스트 end-->
			<!--진행률 바-->
			<div class="progress" id="progress">
				<div id="selector" class="progress-bar progress-bar-striped active"
					role="progressbar" aria-valuenow="60" aria-valuemin="0"
					aria-valuemax="100" style="width:${bar}%">
					<span class="sr-only">45% Complete</span>
				</div>
			</div>

		</div>
		<div id="todoListBox">

			<!--Actions by ajax		-->
			<div id="actions-by-ajax"></div>


			<!--불러올 데이터 없을 때 생성 버튼	-->
			<div id="create_list" style="display: none;">
				<button id="create_btn" type="button" class="btn btn-default btn-xs">
					<i class="glyphicon glyphicon-plus"></i>
				</button>
			</div>

		</div>

		</div>



	</section>





	<!-- Lobi List Default installation-->
	<script src="/resources/lobilist-master/lib/jquery/jquery.min.js"></script>
	<script src="/resources/lobilist-master/lib/jquery/jquery-ui.min.js"></script>

	<script
		src="/resources/lobilist-master/lib/jquery/jquery.ui.touch-punch-improved.js"></script>
	<script
		src="/resources/lobilist-master/lib/bootstrap/js/bootstrap.min.js"></script>

	<script
		src="/resources/lobilist-master/dist/lobilist.js?v=<%=System.currentTimeMillis()%>"></script>

	<script src="/resources/lobilist-master/lib/lobibox/js/lobibox.min.js"></script>
	<script
		src="/resources/lobilist-master/lib/highlight/highlight.pack.js"></script>
	<!-- <script src="resources/lobilist-master/demo/demo.js"></script>-->

	<!--Error: Bootstrap dropdown require Popper.js -->
	<!--<script
		src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script> -->
	<!--<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" ></script> -->

	<script
		src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>

	<script>
	

	 
	 
		$(function() {
			
			$('#collapseOne').collapse('hide');
			// 처음부터 show 를 빼버리면 캘린더 첫화면이 깨짐 (아무 캘린더 버튼을 누르면 정상화)
			// 클래스에 show를 줘서 정상로딩 시키고 별도로 hide 시키기
			
			function isEmpty(param) {
				  return Object.keys(param).length === 0;
			}

			// 할일 리스트들 양식대로 불러오기 전에 데이터 존재 여부 체크
			$.ajax({
				type : 'get',
				url : '/Task/TaskAjax',
				datatype : 'json',
				success : function(data) {			
					if(isEmpty(data.lists)){
						console.log('lists가 데이터베이스에 없음!');

				          $('#actions-by-ajax').lobiList({
				                actions: {
				                    load: "/resources/lobilist-master/demo/load.json?v=<%=System.currentTimeMillis()%>",
				                    insert: 'insert',
				    				delete: 'delete',
				    				update: 'update'
				                },
				                
				                afterListRemove: function(){
				            		console.log("afterListRemove 변화 감지!");
				    				if ($("#actions-by-ajax").find('.lobilist').text() == "") {
				    				console.log("버튼 보여라!!!");
				    				$("#create_list").css('display', 'inline-block');
				    				} else {
				    					console.log("버튼 숨겨라!!!");
				    					$("#create_list").css('display', 'none');
				    				}	
				    			}
				            });
					
					}else{
						console.log('lists가 데이터베이스에 존재!');					
						 $('#actions-by-ajax').lobiList({   
				                afterListRemove: function(){
				            		console.log("afterListRemove 변화 감지!");

				    				if ($("#actions-by-ajax").find('.lobilist').text() == "") {
				    				console.log("버튼 보여라!!!");
				    				$("#create_list").css('display', 'inline-block');
				    				} else {
				    				console.log("버튼 숨겨라!!!");
				    				$("#create_list").css('display', 'none');
				    				}
				    			},
				    			afterItemDelete: function(){
				    				//ajax 코드 추가 작업진행바 (아이템 삭제시)
				    				$.ajax({
				    					type : 'get',
				    					url : '/Task/selectCount',
				    					datatype : 'json',
				    					success : function(data) {
				    						//console.log('작업진행률 : '+ data.to);
				    						$('#selector').css('width', data.to + '%');

				    					},
				    					error : function(error) {
				    						console.error('selectCount (아이템 삭제)');
				    					}
				    				});
				    				
				    			},
				                afterItemAdd: function(){
				                	//ajax 코드 추가 작업진행바 (아이템 추가시)
				    				$.ajax({
				    					type : 'get',
				    					url : '/Task/selectCount',
				    					datatype : 'json',
				    					success : function(data) {
				    						console.log('작업진행률 : '+ data.to);
				    						$('#selector').css('width', data.to + '%');

				    					},
				    					error : function(error) {
				    						console.error('selectCount (아이템 추가)');
				    					}
				    				});
				                }
				    			
				    			
				    			
						    });	          
					}

				},
				error : function(error) {
					alert('프로젝트가 없습니다.');
				}
			});
			
	
			//ajax 코드 추가 작업진행바 (처음 불러올때)
			$.ajax({
				type : 'get',
				url : '/Task/selectCount',
				datatype : 'json',
				success : function(data) {
					console.log('초기 작업진행률 : '+ data.to);
					$('#selector').css('width', data.to + '%');

				},
				error : function(error) {
					console.error('selectCount (첫 load)');
				}
			});
			
			


			
			$('#create_btn').click(function (){
				console.log("버튼 클릭!");
				 //location.reload(); // 버튼 누르면 새로고침 ... 개선필요...
				 history.go(0);
		
				});

	            
			});
	</script>
	
<!--ㅡㅡㅡㅡㅡ 일정 생성하기 modal ㅡㅡㅡㅡㅡㅡㅡ-->
						<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
							aria-labelledby="exampleModalLabel" aria-hidden="true">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<h5 class="modal-title" id="exampleModalLabel">일정 생성하기</h5>
										<button type="button" class="close" data-dismiss="modal"
											aria-label="Close">
											<span aria-hidden="true">&times;</span>
										</button>
									</div>
									<form id="modal_form" action="">
										<div class="modal-body">

											<div class="form-group">
												<label for="recipient-name" class="col-form-label">일정
													제목 </label> <input type="text" class="form-control"
													id="recipient-name" name="title">
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label">일정
													내용 </label>
												<textarea class="form-control" id="message-text"></textarea>
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label"> 일정
													기간 </label> <br>
												<div>

													<!--  ㅡㅡㅡㅡㅡㅡㅡ	bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<svg class="bi bi-alarm" width="1.5em" height="1.5em"
														viewBox="0 0 16 16" fill="currentColor"
														xmlns="http://www.w3.org/2000/svg">
                                    <path fill-rule="evenodd"
															d="M8 15A6 6 0 1 0 8 3a6 6 0 0 0 0 12zm0 1A7 7 0 1 0 8 2a7 7 0 0 0 0 14z" />
                                    <path fill-rule="evenodd"
															d="M8 4.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.053.224l-1.5 3a.5.5 0 1 1-.894-.448L7.5 8.882V5a.5.5 0 0 1 .5-.5z" />
                                    <path
															d="M.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z" />
                                    <path fill-rule="evenodd"
															d="M11.646 14.146a.5.5 0 0 1 .708 0l1 1a.5.5 0 0 1-.708.708l-1-1a.5.5 0 0 1 0-.708zm-7.292 0a.5.5 0 0 0-.708 0l-1 1a.5.5 0 0 0 .708.708l1-1a.5.5 0 0 0 0-.708zM5.5.5A.5.5 0 0 1 6 0h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z" />
                                    <path d="M7 1h2v2H7V1z" />
                                </svg>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	/bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<input type="datetime-local" id="modal_date_start"
														name="start_date">
													<!-- 	<input type="time" id="start_time">  -->
													부터 <br>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<svg class="bi bi-alarm" width="1.5em" height="1.5em"
														viewBox="0 0 16 16" fill="currentColor"
														xmlns="http://www.w3.org/2000/svg">
                                <path fill-rule="evenodd"
															d="M8 15A6 6 0 1 0 8 3a6 6 0 0 0 0 12zm0 1A7 7 0 1 0 8 2a7 7 0 0 0 0 14z" />
                                <path fill-rule="evenodd"
															d="M8 4.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.053.224l-1.5 3a.5.5 0 1 1-.894-.448L7.5 8.882V5a.5.5 0 0 1 .5-.5z" />
                                <path
															d="M.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z" />
                                <path fill-rule="evenodd"
															d="M11.646 14.146a.5.5 0 0 1 .708 0l1 1a.5.5 0 0 1-.708.708l-1-1a.5.5 0 0 1 0-.708zm-7.292 0a.5.5 0 0 0-.708 0l-1 1a.5.5 0 0 0 .708.708l1-1a.5.5 0 0 0 0-.708zM5.5.5A.5.5 0 0 1 6 0h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z" />
                                <path d="M7 1h2v2H7V1z" />
                                </svg>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	/bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<input type="datetime-local" id="modal_date_end"
														id="end_date">
													<!-- <input type="time" name="end_time"> -->
													까지
												</div>
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label">색깔
													지정</label> <br>

												<!-- ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ color radio -->
												<div class="custom-radios">
													<div>
														<input type="radio" id="color-1" name="color"
															value="#2ecc71" checked> <label for="color-1">
															<span> <img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="color-2" name="color"
															value="#3498db"> <label for="color-2"> <span>
																<img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="color-3" name="color"
															value="#f5ce42"> <label for="color-3"> <span>
																<img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="color-4" name="color"
															value="#e74c3c"> <label for="color-4"> <span>
																<img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>
												</div>
												<!-- ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ -->

											</div>
										</div>
										<div class="modal-footer">
											<button type="button" class="btn btn-light"
												data-dismiss="modal">취소</button>
											<button type="button" class="btn btn-info" id="save">완료</button>
										</div>
									</form>
								</div>
							</div>
						</div>



						<!--ㅡㅡㅡㅡㅡ 일정 수정하기 modal ㅡㅡㅡㅡㅡㅡㅡ-->
						<div class="modal fade" id="EditmyModal" tabindex="-1"
							role="dialog" aria-labelledby="exampleModalLabel"
							aria-hidden="true">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<h5 class="modal-title" id="EditexampleModalLabel">일정
											수정하기</h5>
										<button type="button" class="close" data-dismiss="modal"
											aria-label="Close">
											<span aria-hidden="true">&times;</span>
										</button>
									</div>
									<form id="Editmodal_form" action="">
										<div class="modal-body">

											<div class="form-group">
												<label for="recipient-name" class="col-form-label">일정
													제목 </label> <input type="text" class="form-control"
													id="Editrecipient-name" name="title">
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label">일정
													내용 </label>
												<textarea class="form-control" id="Editmessage-text"></textarea>
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label"> 일정
													기간 </label> <br>
												<div>

													<!--  ㅡㅡㅡㅡㅡㅡㅡ	bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<svg class="bi bi-alarm" width="1.5em" height="1.5em"
														viewBox="0 0 16 16" fill="currentColor"
														xmlns="http://www.w3.org/2000/svg">
                                    <path fill-rule="evenodd"
															d="M8 15A6 6 0 1 0 8 3a6 6 0 0 0 0 12zm0 1A7 7 0 1 0 8 2a7 7 0 0 0 0 14z" />
                                    <path fill-rule="evenodd"
															d="M8 4.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.053.224l-1.5 3a.5.5 0 1 1-.894-.448L7.5 8.882V5a.5.5 0 0 1 .5-.5z" />
                                    <path
															d="M.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z" />
                                    <path fill-rule="evenodd"
															d="M11.646 14.146a.5.5 0 0 1 .708 0l1 1a.5.5 0 0 1-.708.708l-1-1a.5.5 0 0 1 0-.708zm-7.292 0a.5.5 0 0 0-.708 0l-1 1a.5.5 0 0 0 .708.708l1-1a.5.5 0 0 0 0-.708zM5.5.5A.5.5 0 0 1 6 0h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z" />
                                    <path d="M7 1h2v2H7V1z" />
                                </svg>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	/bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<input type="datetime-local" id="Editmodal_date_start"
														name="Editstart_date">
													<!-- 	<input type="time" id="start_time">  -->
													부터 <br>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<svg class="bi bi-alarm" width="1.5em" height="1.5em"
														viewBox="0 0 16 16" fill="currentColor"
														xmlns="http://www.w3.org/2000/svg">
                                <path fill-rule="evenodd"
															d="M8 15A6 6 0 1 0 8 3a6 6 0 0 0 0 12zm0 1A7 7 0 1 0 8 2a7 7 0 0 0 0 14z" />
                                <path fill-rule="evenodd"
															d="M8 4.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.053.224l-1.5 3a.5.5 0 1 1-.894-.448L7.5 8.882V5a.5.5 0 0 1 .5-.5z" />
                                <path
															d="M.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z" />
                                <path fill-rule="evenodd"
															d="M11.646 14.146a.5.5 0 0 1 .708 0l1 1a.5.5 0 0 1-.708.708l-1-1a.5.5 0 0 1 0-.708zm-7.292 0a.5.5 0 0 0-.708 0l-1 1a.5.5 0 0 0 .708.708l1-1a.5.5 0 0 0 0-.708zM5.5.5A.5.5 0 0 1 6 0h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z" />
                                <path d="M7 1h2v2H7V1z" />
                                </svg>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	/bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<input type="datetime-local" id="Editmodal_date_end"
														id="Editend_date">
													<!-- <input type="time" name="end_time"> -->
													까지
												</div>
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label">색깔
													지정</label> <br>

												<!-- ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ color radio -->
												<div class="Editcustom-radios">
													<div>
														<input type="radio" id="Editcolor-1" name="Editcolor"
															value="#2ecc71" checked> <label for="Editcolor-1">
															<span> <img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="Editcolor-2" name="Editcolor"
															value="#3498db"> <label for="Editcolor-2">
															<span> <img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="Editcolor-3" name="Editcolor"
															value="#f5ce42"> <label for="Editcolor-3">
															<span> <img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="Editcolor-4" name="Editcolor"
															value="#e74c3c"> <label for="Editcolor-4">
															<span> <img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>
												</div>
												<!-- ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ -->

											</div>
										</div>
										<div class="modal-footer">
											<button type="button" class="btn btn-light"
												data-dismiss="modal">취소</button>
											<button type="button" class="btn btn-info" id="Editsave">완료</button>
										</div>
									</form>
								</div>
							</div>
						</div>

						<!--ㅡㅡㅡㅡㅡ /일정 수정하기 modal ㅡㅡㅡㅡㅡㅡㅡ-->

						<!--ㅡㅡㅡㅡㅡ 삭제 확인 modal ㅡㅡㅡㅡㅡㅡㅡ-->

						<!-- Modal -->
						<div class="modal fade" id="deleteModal" tabindex="-1"
							role="dialog" aria-labelledby="exampleModalLabel"
							aria-hidden="true">
							<div class="modal-dialog" role="document">
								<div class="modal-content">
									<div class="modal-header">
										<h5 class="modal-title" id="exampleModalLabel">일정 삭제</h5>
										<button type="button" class="close" data-dismiss="modal"
											aria-label="Close">
											<span aria-hidden="true">&times;</span>
										</button>
									</div>
									<div class="modal-body">일정을 삭제하시겠습니까?</div>
									<div class="modal-footer">
										<button type="button" class="btn btn-light"
											data-dismiss="modal">취소</button>
										<button type="button" class="btn btn-info" id="deletebtn"
											data-dismiss="modal">삭제</button>
									</div>
								</div>
							</div>
						</div>

						<!--ㅡㅡㅡㅡㅡ /삭제 확인 modal ㅡㅡㅡㅡㅡㅡㅡ-->
</body>
</html>

모달창 투명? 컬럽스 닫기 안됨

 


에러수정 cdn 혹은 모달 위치 변경

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<link href='/resources/css/calendar/calendar.css?after' rel='stylesheet' />
<script src='/resources/js/calendar/calendar.js'></script>
<!-- Jquery -->
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<!-- 부트스트랩 -->
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script
   src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
<!-- 아이콘 -->
<script src="https://kit.fontawesome.com/8f6ea3bf70.js"
	crossorigin="anonymous"></script>
 <!-- 구글 폰트 -->
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500&display=swap" rel="stylesheet">	





<!-- Lobi List Default installation-->
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/jquery/jquery-ui.min.css" />
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="/resources/lobilist-master/dist/lobilist.min.css">
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/lobibox/css/lobibox.min.css">
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/highlight/github.css">
<!--<link rel="stylesheet" href="resources/lobilist-master/demo/demo.css">-->

<style>
body {
	overflow-y: hidden;
	overflow-x: hidden;
}

#wrapper {
	width: 1100px;
	position: fixed;
	z-index: 10;
	bottom: 0px;
	left: 25%;
	background-color: rgba(255, 255, 255, 0.7);
	
}

#todoListBox {
	margin: 10px;
	overflow: hidden;
}

#box {
	margin: 10px 0px 0px 10px;
}

#calendar {
	max-width: 1100px;
	margin: 0 auto;
}

#todoListBox {
	width: 100%;
}

#calendarBox {
	margin-top: 100px;
	width: 1100px;
	margin: 0 auto;
}

#actions-by-ajax {
	height: 80%;
	overflow-y: hidden;
}
#progress{
	width: 1100px;

	margin: auto;
}


</style>


</head>


<body>

	<script>
	 document.addEventListener('DOMContentLoaded', function() {
			
		    var calendarEl = document.getElementById('calendar');
			
		    var calendar = new FullCalendar.Calendar(calendarEl, {
		    	height:200,
		    	displayEventTime:false,//제목에 시간 같이 display 안되게 설정하는
		    	locale: "ko", // 한국어로 설정 
		    	initialView:'dayGridWeek',
		      	headerToolbar: {
		        left: 'prev,next today',
		        center: 'title',
		        right: 'dayGridWeek,dayGridDay'
		      },
		      navLinks: true, // can click day/week names to navigate views
		      selectable: true,
		      selectMirror: true,
		      select: function(arg) {
		          function date_to_str(format)
		          {//날짜형식 내가 원하는 대로 바꾸는 함수 
		              var year = format.getFullYear();
		              var month = format.getMonth() + 1;
		              if(month<10) month = '0' + month;
		              var date = format.getDate();
		              if(date<10) date = '0' + date;
		              var hour = format.getHours();
		              if(hour<10) hour = '0' + hour;
		              var min = format.getMinutes();
		              if(min<10) min = '0' + min;
		             
				       return year + "-" + month + "-" + date + "T" + hour + ":" + min;
		          }
		          var arg_time = date_to_str(arg.start); //내가 클릭한 날짜
		    	//modal 띄우기 
		        $("#myModal").modal(); 
		        $("#modal_date_start").val(arg_time);
		    	//일정 끝나는 시간이 시작시간보다 빠르면 바꿔주는 이벤트 - 시작시간 선택 후 끝나는 시간 선택 했을 때
		    	$("#modal_date_end").focusout(function(){
		    		if(($("#modal_date_end").val()).replace(/[^0-9]/g,"")<($("#modal_date_start").val()).replace(/[^0-9]/g,"")){
		    		$("#modal_date_end").val($("#modal_date_start").val());
		    	}
		    	})
		    	
		    		//일정 끝나는 시간이 시작시간보다 빠르면 바꿔주는 이벤트 - 끝나는 시간 선택 후 시작 시간 선택 했을 때
		    	$("#modal_date_start").focusout(function(){
		    			if(($("#modal_date_start").val()).replace(/[^0-9]/g,"")>($("#modal_date_end").val()).replace(/[^0-9]/g,"")){
		    	    		if($("#modal_date_end").val()==''){
		    	    			
		    	    		} else{
		    	    			$("#modal_date_start").val($("#modal_date_end").val()); 
		    	    		}	
		    		} 	
		    	})
		    	
		       
		        
		        calendar.unselect();
		      },
		      eventClick: function(arg) {
		    	var seq = arg.event.id;
		    	$.ajax({
		    		url : "../calendar/selectEvent",
		    		type: "post",
		    		data:{seq:seq}
		    	}).done(function(resp){
		    		resp=JSON.parse(resp);
		    		var seq=resp.seq;
		  			var projcet_seq=resp.project_seq;
		  			var title = resp.title;
		  			var contents = resp.contents;
		  			var writer = resp.writer;
		  			var start_date=resp.start_date;
		  			var end_date=resp.end_date;
		  			var color=resp.color;
		  			
		  			$('.dialog__content h4').append('<div class='+'dynamic'+'>'+title+'</div>'); 
		  			$('.dialog__content>div:nth-child(2)').append('<div class="dynamic" style="width:270px;">'+contents+'</div>');
		  			$('.dialog__content>div:nth-child(4)').append('<div class='+'dynamic'+'>'+start_date+'</div>');
		  			$('.dialog__content>div:nth-child(4)').after('<div class='+'dynamic'+' style="margin-left:80px">'+end_date+'</div>');
		  			$('.dialog__content>div:nth-child(6)').append('<div class="dynamic" style="float:left">'+writer+'</div>');
		  			
		  			$('#title-color').css('background-color',color);
		  			
		    		const modal = document.querySelector('dialog');
		        	const btnClose = document.querySelectorAll('.button-close');
		        	modal.showModal();
		        	btnClose.forEach((elm) => elm.addEventListener('click', () => closeModal()));
		        	modal.addEventListener('click', (e) => detectBackdropClick(e));
		      
		        	closeModal = () => {
		        	    modal.classList.add("dialog__animate-out");
		        	    modal.addEventListener('animationend', handleClose, false);
		        	   
		        	}

		        	handleClose = () => {
		        	    modal.classList.remove("dialog__animate-out");
		        	    modal.removeEventListener('animationend', handleClose, false);
		        	    modal.close();
		        	    $('.dynamic').remove(); 
		        	}

		        	detectBackdropClick = (event) => {
		        	    if(event.target === modal) {
		        	        closeModal();
		        	    }
		        	}
		        	
		        	 $('#eventEdit').on('click',function(){    		 
		        		 closeModal();	
		        		 //수정하기 modal에  값 채워넣기 
		        		 $('#Editrecipient-name').val(title);
		        		 $("#Editmessage-text").val(contents)
		        		 $('#Editmodal_date_start').val(start_date);
		        		 $('#Editmodal_date_end').val(end_date);
		        		 /* $('.Editcustom-radios input[type=radio][name=Editcolor][background-color:'+color+']:checked'); */
		        		 //색깔 선택 수정하기 !!!!!!
		        		 sessionStorage.setItem("seq",seq);
		            	 $("#EditmyModal").modal();
		        		 
		            }) 
		            
		            $('#eventDelete').on("click",function(){//일정 삭제하기
		            	sessionStorage.setItem("seq",seq);
		            	closeModal();
		            	$('#deleteModal').modal();
		            })
		            
		            
		    	})	
		    
		      },
		     /*  editable: true, */
		      dayMaxEvents: true, // allow "more" link when too many events
		      events: [
		    	   <c:forEach var="i" items="${list}">
		         	{
		         		id:'${i.seq}',
		         		title:'${i.title}',
		         		start:'${i.start_date}',
		         		end:'${i.end_date}',
		         		color:'${i.color}'
		         	},
		         </c:forEach>	 
		      ]
		    });
		   
		    //일정 생성하기 버튼 눌렀을 때 : 이벤트 안에 이벤트를 넣으면 버그가 일어난다!  
			   $("#save").on("click",function(){
		        var title = $("#recipient-name").val();
		        var start = $('#modal_date_start').val();
		        var end =$('#modal_date_end').val(); 
		        var color = $('input[type=radio][name=color]:checked').val();
		 	
		        if(title==''){
		        	alert("제목은 필수 입력값 입니다!");
		        	
		        }else{
		        	$.ajax({
		            	url:"../calendar/addEvent",
		            	type:"post",
		            	data:{
		            		title : title,
		            		start_date : start,
		            		end_date: end,
		            		contents : $("#message-text").val(),
		            		writer : '${loginInfo.name}',
		            		color : color,
		            		poject_seq:0
		            	}
		            }).done(function(resp){
		           		resp=JSON.parse(resp);
		           		var seq = resp.seq
		           		if(title){
		                    calendar.addEvent({
		                    	id:seq,
		                        title:title,
		                        start:start,
		                        end:end,
		                        color:color
		                    })
		                }
		           		
		            })
		            /*   modal clean 하기 */
		            $("#recipient-name").val("");
		            $('#modal_date_start').val("");
		            $('#modal_date_end').val("");
		            $("#message-text").val("");
		            $("#modal_select").val('red');
		    			
		            
		            /* modal hide  */
		            $("#myModal").modal('hide');
		        }
		        
		        
		        
		        
		    
		    })
		    
		 //ㅡㅡㅡㅡㅡㅡㅡㅡ일정 수정하기 ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
		  $('#Editsave').on("click",function(){//수정완료 버튼 
			       			
		        	var seq = sessionStorage.getItem("seq");          
		       		var Edittitle = $('#Editrecipient-name').val();
		       		var Editstart = $('#Editmodal_date_start').val();
		       		var Editend = $('#Editmodal_date_end').val();
		       		var Editcolor = $('input[type=radio][name=Editcolor]:checked').val();
		       		
		       	 if(Edittitle==''){
		         	alert("제목은 필수 입력값 입니다!");
		         	
		         }else{
		        	 $.ajax({
		        			url:'../calendar/EditEvent',
		        			type:'post',
		        			data:{ 
		        			seq:seq, //수정하려면 seq 필요 . 맨 첫번째 줄에서 seq 선언. 
		        			title:Edittitle,
		        			start_date:Editstart,
		          			end_date:Editend,
		          			contents: $("#Editmessage-text").val(),
		          			writer:'${loginInfo.name}',
		          			color: Editcolor,
		          			project_seq:0
		        			}		
		        		}).done(function(resp){	
		        	       
		        		   //일단 삭제 하고 
		        		   var eventObj = calendar.getEventById(seq);
		        			eventObj.remove(); 
		 	
		        		  if(Edittitle){//다시 만든다 똑같은 id(seq) 써주기
		        			 	 calendar.addEvent({
		        					id:seq,
		        					title:Edittitle,
		        					start:Editstart,
		        					end:Editend,
		        					color:Editcolor
		        				})
		        			}    
		        			
		        		
		        			
		        			    //modal clean 하기 
		                 $("#Editrecipient-name").val("");
		                 $('#Editmodal_date_start').val("");
		                 $('#Editmodal_date_end').val("");
		                 $("#Editmessage-text").val("");
		                 $("#Editmodal_select").val('red');
		        				
		                  
		                 /* modal hide  */
		                   $("#EditmyModal").modal('hide'); 
		                   sessionStorage.removeItem('seq');
		                 
		        		 })
		         }
		       		
		       		
		       		  
		       	}) 
		             //ㅡㅡㅡㅡㅡㅡㅡㅡ일정 삭제하기ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ	         
		                   $("#deletebtn").on("click",function(){                  
		                	   var seq = sessionStorage.getItem("seq"); 
		                      $.ajax({
		                         url:'../calendar/DeleteEvent',
		                         type:'post',
		                         data:{seq:seq}
		                      }).done(function(resp){
		                    	  sessionStorage.removeItem('seq');
		                      })
		                  	var eventObj = calendar.getEventById(seq);
		             			eventObj.remove();
		                   }) 
		                  
		   calendar.render(); 
		  });

</script>

	<!-- Header -->
	<jsp:include page="../header/header.jsp"></jsp:include>
	<!-- 왼쪽 사이드바 -->
	<jsp:include page="../header/sidebar-left.jsp"></jsp:include>


	<section id="box">






		<div id="wrapper">


		

<!-- -----------------------------------------------------------------------------------------------------------------------------------------------------------		-->
					<div id="calendarBox">
						<div id='calendar'></div>
						
						
						<!-- ㅡㅡㅡㅡㅡㅡㅡ일정 조회하기ㅡㅡㅡㅡㅡㅡㅡ -->
						<div class="row">
							<div class="col-3">
								<dialog>
								<div class="dialog__inner">
									<div>
										<i class="far fa-edit" id="eventEdit"></i> <i
											class="far fa-trash-alt" id="eventDelete"></i>
										<button class="button button-close">╳</button>
									</div>

									<div class="dialog__content">
										<div>
											<div id="title-color"></div>
											<h4></h4>
										</div>
										<div>
											<i class="fas fa-bars"></i>

										</div>
										<br>
										<div>
											<i class="far fa-clock"></i>
										</div>

										<div>
											<i class="fas fa-user-edit"></i>
										</div>
										<footer class="dialog__footer">
											<button class="button button-close">확인</button>
										</footer>
									</div>
								</div>
								</dialog>
							</div>
						</div>
						<!-- ㅡㅡㅡㅡㅡㅡㅡ/일정 조회하기ㅡㅡㅡㅡㅡㅡㅡ -->



					</div>
	<!-- -----------------------------------------------------------------------------------------------------------------------------------------------------------		-->
	

			<!--진행률 바-->
			<div class="progress" id="progress">
				<div id="selector" class="progress-bar progress-bar-striped active"
					role="progressbar" aria-valuenow="60" aria-valuemin="0"
					aria-valuemax="100" style="width:${bar}%">
					<span class="sr-only">45% Complete</span>
				</div>
			</div>

		</div>
		<div id="todoListBox">

			<!--Actions by ajax		-->
			<div id="actions-by-ajax"></div>


			<!--불러올 데이터 없을 때 생성 버튼	-->
			<div id="create_list" style="display: none;">
				<button id="create_btn" type="button" class="btn btn-default btn-xs">
					<i class="glyphicon glyphicon-plus"></i>
				</button>
			</div>

		</div>

		</div>



	</section>





	<!-- Lobi List Default installation-->
	<script src="/resources/lobilist-master/lib/jquery/jquery.min.js"></script>
	<script src="/resources/lobilist-master/lib/jquery/jquery-ui.min.js"></script>

	<script
		src="/resources/lobilist-master/lib/jquery/jquery.ui.touch-punch-improved.js"></script>
	<script
		src="/resources/lobilist-master/lib/bootstrap/js/bootstrap.min.js"></script>

	<script
		src="/resources/lobilist-master/dist/lobilist.js?v=<%=System.currentTimeMillis()%>"></script>

	<script src="/resources/lobilist-master/lib/lobibox/js/lobibox.min.js"></script>
	<script
		src="/resources/lobilist-master/lib/highlight/highlight.pack.js"></script>
	<!-- <script src="resources/lobilist-master/demo/demo.js"></script>-->

	<!--Error: Bootstrap dropdown require Popper.js -->
	<!--<script
		src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script> -->
	<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" ></script>

	
<!--ㅡㅡㅡㅡㅡ 일정 생성하기 modal ㅡㅡㅡㅡㅡㅡㅡ-->
						<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
							aria-labelledby="exampleModalLabel" aria-hidden="true">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<h5 class="modal-title" id="exampleModalLabel">일정 생성하기</h5>
										<button type="button" class="close" data-dismiss="modal"
											aria-label="Close">
											<span aria-hidden="true">&times;</span>
										</button>
									</div>
									<form id="modal_form" action="">
										<div class="modal-body">

											<div class="form-group">
												<label for="recipient-name" class="col-form-label">일정
													제목 </label> <input type="text" class="form-control"
													id="recipient-name" name="title">
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label">일정
													내용 </label>
												<textarea class="form-control" id="message-text"></textarea>
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label"> 일정
													기간 </label> <br>
												<div>

													<!--  ㅡㅡㅡㅡㅡㅡㅡ	bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<svg class="bi bi-alarm" width="1.5em" height="1.5em"
														viewBox="0 0 16 16" fill="currentColor"
														xmlns="http://www.w3.org/2000/svg">
                                    <path fill-rule="evenodd"
															d="M8 15A6 6 0 1 0 8 3a6 6 0 0 0 0 12zm0 1A7 7 0 1 0 8 2a7 7 0 0 0 0 14z" />
                                    <path fill-rule="evenodd"
															d="M8 4.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.053.224l-1.5 3a.5.5 0 1 1-.894-.448L7.5 8.882V5a.5.5 0 0 1 .5-.5z" />
                                    <path
															d="M.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z" />
                                    <path fill-rule="evenodd"
															d="M11.646 14.146a.5.5 0 0 1 .708 0l1 1a.5.5 0 0 1-.708.708l-1-1a.5.5 0 0 1 0-.708zm-7.292 0a.5.5 0 0 0-.708 0l-1 1a.5.5 0 0 0 .708.708l1-1a.5.5 0 0 0 0-.708zM5.5.5A.5.5 0 0 1 6 0h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z" />
                                    <path d="M7 1h2v2H7V1z" />
                                </svg>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	/bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<input type="datetime-local" id="modal_date_start"
														name="start_date">
													<!-- 	<input type="time" id="start_time">  -->
													부터 <br>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<svg class="bi bi-alarm" width="1.5em" height="1.5em"
														viewBox="0 0 16 16" fill="currentColor"
														xmlns="http://www.w3.org/2000/svg">
                                <path fill-rule="evenodd"
															d="M8 15A6 6 0 1 0 8 3a6 6 0 0 0 0 12zm0 1A7 7 0 1 0 8 2a7 7 0 0 0 0 14z" />
                                <path fill-rule="evenodd"
															d="M8 4.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.053.224l-1.5 3a.5.5 0 1 1-.894-.448L7.5 8.882V5a.5.5 0 0 1 .5-.5z" />
                                <path
															d="M.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z" />
                                <path fill-rule="evenodd"
															d="M11.646 14.146a.5.5 0 0 1 .708 0l1 1a.5.5 0 0 1-.708.708l-1-1a.5.5 0 0 1 0-.708zm-7.292 0a.5.5 0 0 0-.708 0l-1 1a.5.5 0 0 0 .708.708l1-1a.5.5 0 0 0 0-.708zM5.5.5A.5.5 0 0 1 6 0h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z" />
                                <path d="M7 1h2v2H7V1z" />
                                </svg>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	/bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<input type="datetime-local" id="modal_date_end"
														id="end_date">
													<!-- <input type="time" name="end_time"> -->
													까지
												</div>
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label">색깔
													지정</label> <br>

												<!-- ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ color radio -->
												<div class="custom-radios">
													<div>
														<input type="radio" id="color-1" name="color"
															value="#2ecc71" checked> <label for="color-1">
															<span> <img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="color-2" name="color"
															value="#3498db"> <label for="color-2"> <span>
																<img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="color-3" name="color"
															value="#f5ce42"> <label for="color-3"> <span>
																<img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="color-4" name="color"
															value="#e74c3c"> <label for="color-4"> <span>
																<img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>
												</div>
												<!-- ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ -->

											</div>
										</div>
										<div class="modal-footer">
											<button type="button" class="btn btn-light"
												data-dismiss="modal">취소</button>
											<button type="button" class="btn btn-info" id="save">완료</button>
										</div>
									</form>
								</div>
							</div>
						</div>



						<!--ㅡㅡㅡㅡㅡ 일정 수정하기 modal ㅡㅡㅡㅡㅡㅡㅡ-->
						<div class="modal fade" id="EditmyModal" tabindex="-1"
							role="dialog" aria-labelledby="exampleModalLabel"
							aria-hidden="true">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<h5 class="modal-title" id="EditexampleModalLabel">일정
											수정하기</h5>
										<button type="button" class="close" data-dismiss="modal"
											aria-label="Close">
											<span aria-hidden="true">&times;</span>
										</button>
									</div>
									<form id="Editmodal_form" action="">
										<div class="modal-body">

											<div class="form-group">
												<label for="recipient-name" class="col-form-label">일정
													제목 </label> <input type="text" class="form-control"
													id="Editrecipient-name" name="title">
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label">일정
													내용 </label>
												<textarea class="form-control" id="Editmessage-text"></textarea>
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label"> 일정
													기간 </label> <br>
												<div>

													<!--  ㅡㅡㅡㅡㅡㅡㅡ	bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<svg class="bi bi-alarm" width="1.5em" height="1.5em"
														viewBox="0 0 16 16" fill="currentColor"
														xmlns="http://www.w3.org/2000/svg">
                                    <path fill-rule="evenodd"
															d="M8 15A6 6 0 1 0 8 3a6 6 0 0 0 0 12zm0 1A7 7 0 1 0 8 2a7 7 0 0 0 0 14z" />
                                    <path fill-rule="evenodd"
															d="M8 4.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.053.224l-1.5 3a.5.5 0 1 1-.894-.448L7.5 8.882V5a.5.5 0 0 1 .5-.5z" />
                                    <path
															d="M.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z" />
                                    <path fill-rule="evenodd"
															d="M11.646 14.146a.5.5 0 0 1 .708 0l1 1a.5.5 0 0 1-.708.708l-1-1a.5.5 0 0 1 0-.708zm-7.292 0a.5.5 0 0 0-.708 0l-1 1a.5.5 0 0 0 .708.708l1-1a.5.5 0 0 0 0-.708zM5.5.5A.5.5 0 0 1 6 0h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z" />
                                    <path d="M7 1h2v2H7V1z" />
                                </svg>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	/bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<input type="datetime-local" id="Editmodal_date_start"
														name="Editstart_date">
													<!-- 	<input type="time" id="start_time">  -->
													부터 <br>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<svg class="bi bi-alarm" width="1.5em" height="1.5em"
														viewBox="0 0 16 16" fill="currentColor"
														xmlns="http://www.w3.org/2000/svg">
                                <path fill-rule="evenodd"
															d="M8 15A6 6 0 1 0 8 3a6 6 0 0 0 0 12zm0 1A7 7 0 1 0 8 2a7 7 0 0 0 0 14z" />
                                <path fill-rule="evenodd"
															d="M8 4.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.053.224l-1.5 3a.5.5 0 1 1-.894-.448L7.5 8.882V5a.5.5 0 0 1 .5-.5z" />
                                <path
															d="M.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z" />
                                <path fill-rule="evenodd"
															d="M11.646 14.146a.5.5 0 0 1 .708 0l1 1a.5.5 0 0 1-.708.708l-1-1a.5.5 0 0 1 0-.708zm-7.292 0a.5.5 0 0 0-.708 0l-1 1a.5.5 0 0 0 .708.708l1-1a.5.5 0 0 0 0-.708zM5.5.5A.5.5 0 0 1 6 0h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z" />
                                <path d="M7 1h2v2H7V1z" />
                                </svg>
													<!--  ㅡㅡㅡㅡㅡㅡㅡ	/bootstrap -icon ㅡㅡㅡㅡㅡ -->
													<input type="datetime-local" id="Editmodal_date_end"
														id="Editend_date">
													<!-- <input type="time" name="end_time"> -->
													까지
												</div>
											</div>
											<div class="form-group">
												<label for="message-text" class="col-form-label">색깔
													지정</label> <br>

												<!-- ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ color radio -->
												<div class="Editcustom-radios">
													<div>
														<input type="radio" id="Editcolor-1" name="Editcolor"
															value="#2ecc71" checked> <label for="Editcolor-1">
															<span> <img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="Editcolor-2" name="Editcolor"
															value="#3498db"> <label for="Editcolor-2">
															<span> <img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="Editcolor-3" name="Editcolor"
															value="#f5ce42"> <label for="Editcolor-3">
															<span> <img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>

													<div>
														<input type="radio" id="Editcolor-4" name="Editcolor"
															value="#e74c3c"> <label for="Editcolor-4">
															<span> <img
																src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/242518/check-icn.svg"
																alt="Checked Icon" />
														</span>
														</label>
													</div>
												</div>
												<!-- ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ -->

											</div>
										</div>
										<div class="modal-footer">
											<button type="button" class="btn btn-light"
												data-dismiss="modal">취소</button>
											<button type="button" class="btn btn-info" id="Editsave">완료</button>
										</div>
									</form>
								</div>
							</div>
						</div>

						<!--ㅡㅡㅡㅡㅡ /일정 수정하기 modal ㅡㅡㅡㅡㅡㅡㅡ-->

						<!--ㅡㅡㅡㅡㅡ 삭제 확인 modal ㅡㅡㅡㅡㅡㅡㅡ-->

						<!-- Modal -->
						<div class="modal fade" id="deleteModal" tabindex="-1"
							role="dialog" aria-labelledby="exampleModalLabel"
							aria-hidden="true">
							<div class="modal-dialog" role="document">
								<div class="modal-content">
									<div class="modal-header">
										<h5 class="modal-title" id="exampleModalLabel">일정 삭제</h5>
										<button type="button" class="close" data-dismiss="modal"
											aria-label="Close">
											<span aria-hidden="true">&times;</span>
										</button>
									</div>
									<div class="modal-body">일정을 삭제하시겠습니까?</div>
									<div class="modal-footer">
										<button type="button" class="btn btn-light"
											data-dismiss="modal">취소</button>
										<button type="button" class="btn btn-info" id="deletebtn"
											data-dismiss="modal">삭제</button>
									</div>
								</div>
							</div>
						</div>

						<!--ㅡㅡㅡㅡㅡ /삭제 확인 modal ㅡㅡㅡㅡㅡㅡㅡ-->

	<script>
	

	 
	 
		$(function() {
			
			$('#collapseOne').collapse('hide');
			// 처음부터 show 를 빼버리면 캘린더 첫화면이 깨짐 (아무 캘린더 버튼을 누르면 정상화)
			// 클래스에 show를 줘서 정상로딩 시키고 별도로 hide 시키기
			
			function isEmpty(param) {
				  return Object.keys(param).length === 0;
			}

			// 할일 리스트들 양식대로 불러오기 전에 데이터 존재 여부 체크
			$.ajax({
				type : 'get',
				url : '/Task/TaskAjax',
				datatype : 'json',
				success : function(data) {			
					if(isEmpty(data.lists)){
						console.log('lists가 데이터베이스에 없음!');

				          $('#actions-by-ajax').lobiList({
				                actions: {
				                    load: "/resources/lobilist-master/demo/load.json?v=<%=System.currentTimeMillis()%>",
				                    insert: 'insert',
				    				delete: 'delete',
				    				update: 'update'
				                },
				                
				                afterListRemove: function(){
				            		console.log("afterListRemove 변화 감지!");
				    				if ($("#actions-by-ajax").find('.lobilist').text() == "") {
				    				console.log("버튼 보여라!!!");
				    				$("#create_list").css('display', 'inline-block');
				    				} else {
				    					console.log("버튼 숨겨라!!!");
				    					$("#create_list").css('display', 'none');
				    				}	
				    			}
				            });
					
					}else{
						console.log('lists가 데이터베이스에 존재!');					
						 $('#actions-by-ajax').lobiList({   
				                afterListRemove: function(){
				            		console.log("afterListRemove 변화 감지!");

				    				if ($("#actions-by-ajax").find('.lobilist').text() == "") {
				    				console.log("버튼 보여라!!!");
				    				$("#create_list").css('display', 'inline-block');
				    				} else {
				    				console.log("버튼 숨겨라!!!");
				    				$("#create_list").css('display', 'none');
				    				}
				    			},
				    			afterItemDelete: function(){
				    				//ajax 코드 추가 작업진행바 (아이템 삭제시)
				    				$.ajax({
				    					type : 'get',
				    					url : '/Task/selectCount',
				    					datatype : 'json',
				    					success : function(data) {
				    						//console.log('작업진행률 : '+ data.to);
				    						$('#selector').css('width', data.to + '%');

				    					},
				    					error : function(error) {
				    						console.error('selectCount (아이템 삭제)');
				    					}
				    				});
				    				
				    			},
				                afterItemAdd: function(){
				                	//ajax 코드 추가 작업진행바 (아이템 추가시)
				    				$.ajax({
				    					type : 'get',
				    					url : '/Task/selectCount',
				    					datatype : 'json',
				    					success : function(data) {
				    						console.log('작업진행률 : '+ data.to);
				    						$('#selector').css('width', data.to + '%');

				    					},
				    					error : function(error) {
				    						console.error('selectCount (아이템 추가)');
				    					}
				    				});
				                }
				    			
				    			
				    			
						    });	          
					}

				},
				error : function(error) {
					alert('프로젝트가 없습니다.');
				}
			});
			
	
			//ajax 코드 추가 작업진행바 (처음 불러올때)
			$.ajax({
				type : 'get',
				url : '/Task/selectCount',
				datatype : 'json',
				success : function(data) {
					console.log('초기 작업진행률 : '+ data.to);
					$('#selector').css('width', data.to + '%');

				},
				error : function(error) {
					console.error('selectCount (첫 load)');
				}
			});
			
			


			
			$('#create_btn').click(function (){
				console.log("버튼 클릭!");
				 //location.reload(); // 버튼 누르면 새로고침 ... 개선필요...
				 history.go(0);
		
				});

	            
			});
	</script>

</body>
</html>

load 방식으로 변경 

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<!-- Jquery -->
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>

<!-- Lobi List Default installation-->
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/jquery/jquery-ui.min.css" />
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="/resources/lobilist-master/dist/lobilist.min.css">
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/lobibox/css/lobibox.min.css">
<link rel="stylesheet"
	href="/resources/lobilist-master/lib/highlight/github.css">
	
	
<link href='/resources/css/task/task.css' rel='stylesheet' />
   	<!--Error: Bootstrap dropdown require Popper.js -- 상단부에 있어야 리스트 색 변경시 에러가 안남 -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
	<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" ></script>
	

<!-- 부트스트랩 -->
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script
   src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>


<style>


</style>


</head>


<body>

	


	<section id="box">






		<div id="wrapper">

		<!-- 주간 스케쥴러 관련 스크랩트, calendarBox, 관련 모달 -->
<jsp:include page="scheduler.jsp"/>





			<!--진행률 바-->
			<div class="progress" id="progress">
				<div id="selector" class="progress-bar progress-bar-striped active"
					role="progressbar" aria-valuenow="60" aria-valuemin="0"
					aria-valuemax="100" style="width:${bar}%">
					<span class="sr-only">45% Complete</span>
				</div>
			</div>

		</div>
		<div id="todoListBox">

			<!--Actions by ajax		-->
			<div id="actions-by-ajax"></div>


			<!--불러올 데이터 없을 때 생성 버튼	-->
			<div id="create_list" style="display: none;">
				<button id="create_btn" type="button" class="btn btn-default btn-xs">
					<i class="glyphicon glyphicon-plus"></i>
				</button>
			</div>

		</div>

		</div>



	</section>








	<!-- Lobi List Default installation-->
	<script src="/resources/lobilist-master/lib/jquery/jquery.min.js"></script>
	<script src="/resources/lobilist-master/lib/jquery/jquery-ui.min.js"></script>
	<script
		src="/resources/lobilist-master/lib/jquery/jquery.ui.touch-punch-improved.js"></script>
	<script
		src="/resources/lobilist-master/lib/bootstrap/js/bootstrap.min.js"></script>
	<script
		src="/resources/lobilist-master/dist/lobilist.js?v=<%=System.currentTimeMillis()%>"></script>
	<script src="/resources/lobilist-master/lib/lobibox/js/lobibox.min.js"></script>
	<script
		src="/resources/lobilist-master/lib/highlight/highlight.pack.js"></script>


		<!--task.js는 로비리스트 기본 설치 태그 밑에 위치해야 동작! -->
<script src='/resources/js/task/task.js'></script>

		<!-- 주간 스케쥴러 관련 스크랩트, calendarBox, 관련 모달 -->
<jsp:include page="modal.jsp"/>


</body>
</html>

'디지털 컨버전스 > Project' 카테고리의 다른 글

파이널 프로젝트  (0) 2020.07.15
부트스트랩 에러  (0) 2020.07.10
[Project] 데이터베이스에 배열 저장  (0) 2020.05.20
[project] 파일 업로드  (0) 2020.05.20
[Project] 원형 썸네일  (0) 2020.05.19

 

 

ProfileDTO : specialty 자료형 변경

package lv.backend.dto;


public class ProfileDTO {

	private int seq;
	private String name; 
	private String title;
	private String phone;
	private String[] specialty;
	private String office_name;
	private String office_phone;
	private String test;
	private String education;
	private String id;
	private String img;
	
	public ProfileDTO() {
		super();
	}
	
	
	public ProfileDTO(String name, String title, String phone, String[] specialty, String office_name,
			String office_phone, String test, String education, String id, String img) {
		super();
		this.name = name;
		this.title = title;
		this.phone = phone;
		this.specialty = specialty;
		this.office_name = office_name;
		this.office_phone = office_phone;
		this.test = test;
		this.education = education;
		this.id = id;
		this.img = img;
	}


	public ProfileDTO(int seq, String name, String title, String phone, String[] specialty, String office_name,
			String office_phone, String test, String education, String id) {
		super();
		this.seq = seq;
		this.name = name;
		this.title = title;
		this.phone = phone;
		this.specialty = specialty;
		this.office_name = office_name;
		this.office_phone = office_phone;
		this.test = test;
		this.education = education;
		this.id = id;
	}
	
	public ProfileDTO(String name, String title, String phone, String[] specialty, String office_name,
			String office_phone, String test, String education, String id) {
		super();
		this.name = name;
		this.title = title;
		this.phone = phone;
		this.specialty = specialty;
		this.office_name = office_name;
		this.office_phone = office_phone;
		this.test = test;
		this.education = education;
		this.id = id;
	}
	
	public ProfileDTO(int seq, String name, String title, String phone, String[] specialty, String office_name,
			String office_phone, String test, String education, String id, String img) {
		super();
		this.seq = seq;
		this.name = name;
		this.title = title;
		this.phone = phone;
		this.specialty = specialty;
		this.office_name = office_name;
		this.office_phone = office_phone;
		this.test = test;
		this.education = education;
		this.id = id;
		this.img = img;
	}

	public String getImg() {
		return img;
	}

	public void setImg_location(String img) {
		this.img = img;
	}


	public int getSeq() {
		return seq;
	}
	public void setSeq(int seq) {
		this.seq = seq;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}

	
	public String[] getSpecialty() {
		return specialty;
	}


	public void setSpecialty(String[] specialty) {
		this.specialty = specialty;
	}


	public String getOffice_name() {
		return office_name;
	}
	public void setOffice_name(String office_name) {
		this.office_name = office_name;
	}
	public String getOffice_phone() {
		return office_phone;
	}
	public void setOffice_phone(String office_phone) {
		this.office_phone = office_phone;
	}
	public String getTest() {
		return test;
	}
	public void setTest(String test) {
		this.test = test;
	}
	public String getEducation() {
		return education;
	}
	public void setEducation(String education) {
		this.education = education;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	
	
}

 

 

ProfileController : getParameterValues로 배열값 저장

package lv.backend.controller;

import java.io.File;
import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.gson.Gson;
import com.oreilly.servlet.MultipartRequest;
import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;

import lv.backend.dao.LawyerDAO;
import lv.backend.dao.ProfileDAO;
import lv.backend.dto.LawyerDTO;
import lv.backend.dto.ProfileDTO;


@WebServlet("*.profile")
public class ProfileController extends HttpServlet {


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

	    request.setCharacterEncoding("utf8");
	    response.setCharacterEncoding("utf8");
	    
	    
		String contextPath = request.getContextPath();
		String requestURI = request.getRequestURI();
		String cmd = requestURI.substring(contextPath.length());
		ProfileDAO pdao = new ProfileDAO();
		LawyerDTO ldto = new LawyerDTO();
		LawyerDAO ldao = new LawyerDAO();
//		--ProfileDAO--
//		seq 변호사 프로필 게시판 글번호;
//		name : 변호사 이름; 
//		title : 프로필타이틀(홍보문구);
//		phone : 변호사 번호;
//		specialty : 전문분야 String (썸머노트?);
//		office_name : 사무소이름;
//		office_phone : 사무소번호;
//		test : 출신시험;
//		education : 교육사항 String (썸머노트?);
//		id : 변호사 회원 아이디;
//		img : 저장된 사진 이름 <img src='${pageContext.request.contextPath}/upload/"+resp[i].img+"''> 경로로 출력;
		
		//프로필 사진 저장 파일 생성
		String uploadPath = request.getServletContext().getRealPath("upload");
		File uploadPathF = new File(uploadPath);
		if(!uploadPathF.exists()) { //경로가 없다면
			uploadPathF.mkdir();    //만들어라
		}
		
		System.out.println("저장 경로 : "+ uploadPath );
		
		try {
			
			if(cmd.contentEquals("/write.profile")) {
			
				MultipartRequest multi = new MultipartRequest(
						request,
						uploadPath,
						1024*1024*10, //사이즈
						"utf8", //인코딩
						new DefaultFileRenamePolicy() // 이름 겹치면 덮어씌워짐 -> 중복 방지 필요 : 처리코드를 직접 쓸수도 있지만, 디폴트값으로
						);
				String sysName = multi.getFilesystemName("file");
				String oriName = multi.getOriginalFileName("file");
				System.out.println("저장된 사진 이름 : "+ sysName);
				System.out.println("원래 사진 이름 : "+ oriName);
				
				// 변호사 로그인시 세션 확인!
				String lawyerid = (String)request.getSession().getAttribute("lawyerInfo");
				ldto = ldao.lSelect(lawyerid);
				
//				String name = "이름"; 
				String name = ldto.getName();
				String title = multi.getParameter("title");
//				String phone = "번호";
				String phone = ldto.getPhone();
//				String specialty = multi.getParameter("specialty"); // 전문분야 한개만
				String[] specialty = multi.getParameterValues("specialty");
//				String office_name = "사무소명";
//				String office_phone = "사무소번호";
//				String test = "출신시험";
				String office_name = ldto.getOffice_name();
				String office_phone = ldto.getOffice_phone();
				String test = ldto.getTest();
				String education = multi.getParameter("education");
//				String id = "아이디";
				String id = ldto.getId();
				String img = sysName; 
						
				
				System.out.println("title : " + title);
				System.out.println("specialty : " + specialty);
				System.out.println("education : " + education);
				System.out.println("img(저장된 이름) : " + img);
				
				int result = pdao.insertProfile(new ProfileDTO(name,title,phone,specialty,office_name,office_phone,test,education,id,img));

				if(result>0) {
					response.sendRedirect("profileList.jsp");
				}else {
					response.sendRedirect("error.jsp");
				}
				
						

		
			}else if(cmd.contentEquals("/toProfileList.profile")) {
	

				
				response.sendRedirect("profileList.jsp");

				
			}else if(cmd.contentEquals("/profileListAjax.profile")){
				
				int cpage = Integer.parseInt(request.getParameter("cpage"));
				try {
					List<ProfileDTO> list = pdao.selectByPageNo(cpage);
					//클라이언트는 JSON으로 받는게 좋음 : List<BoardDTO>를 JSON으로
					String respArr = new Gson().toJson(list);
					response.getWriter().append(respArr);
				
					//프로필 수정 / 삭제 기능 미구현
				} catch (Exception e) {
					e.printStackTrace(); //에러나면 어쩌피 fail로 가기 때문에 여기서 따로 에러페이지 보낼 필요없음
					response.sendError(500); //에러메세지를 응답으로 보내겠
				}
				
			}else if(cmd.contentEquals("/toProfile.profile")) {
//				System.out.println("toProfile.profile 컨트롤러 실행 : "+request.getQueryString().substring(4) );
//				System.out.println(request.getParameter("seq"));
				
				int seq = Integer.parseInt(request.getParameter("seq"));
				System.out.println("받아온 시퀀스 확인용 : "+seq); // 받아온 시퀀스 확인용
				ProfileDTO pdto = pdao.selectBySeq(seq);

				request.setAttribute("pdto", pdto);

//				List<FileDTO> fileList = dao.selectFileBySeq(seq);
//				request.setAttribute("fileList", fileList);
				
				RequestDispatcher rd = request.getRequestDispatcher("profile.jsp");
				rd.forward(request, response);
				
			}else if(cmd.contentEquals("/delete.profile")) {
				
				int seq = Integer.parseInt(request.getParameter("seq"));
				pdao.deleteBySeq(seq);
				response.sendRedirect("toProfileList.profile");
				
			}else if(cmd.contentEquals("/toProfileModify.profile")) {
				// 프로필에서 수정하기 버튼을 누르면 
				// 해당 글seq로 프로필dto를 새로 찾아서
				// 수정하기 페이지로 이동
				int seq = Integer.parseInt(request.getParameter("seq"));
				System.out.println("modify할 seq : "+seq); // 받아온 시퀀스 확인용

				ProfileDTO dto = pdao.selectBySeq(seq);
				request.setAttribute("dto", dto);
				RequestDispatcher rd = request.getRequestDispatcher("profileModify.jsp");
				rd.forward(request, response);
				
			}else if(cmd.contentEquals("/modify.profile")) {
				
				int seq = Integer.parseInt(request.getParameter("seq"));
				// 변호사 테이블에서 불러오기?
				// 아니면 여기서도 수정? 외래키는?
				MultipartRequest multi = new MultipartRequest(
						request,
						uploadPath,
						1024*1024*10, //사이즈
						"utf8", //인코딩
						new DefaultFileRenamePolicy() // 이름 겹치면 덮어씌워짐 -> 중복 방지 필요 : 처리코드를 직접 쓸수도 있지만, 디폴트값으로
						);
				String sysName = multi.getFilesystemName("file");
				String oriName = multi.getOriginalFileName("file");
				System.out.println("저장된 사진 이름 : "+ sysName);
				System.out.println("원래 사진 이름 : "+ oriName);
				
				// 변호사 로그인시 세션 확인!
				String lawyerid = (String)request.getSession().getAttribute("lawyerInfo");
				ldto = ldao.lSelect(lawyerid);
				
//				String name = "이름"; 
				String name = ldto.getName();
				String title = multi.getParameter("title");
//				String phone = "번호";
				String phone = ldto.getPhone();
				String[] specialty = multi.getParameterValues("specialty");
//				String office_name = "사무소명";
//				String office_phone = "사무소번호";
//				String test = "출신시험";
				String office_name = ldto.getOffice_name();
				String office_phone = ldto.getOffice_phone();
				String test = ldto.getTest();
				String education = multi.getParameter("education");
//				String id = "아이디";
				String id = ldto.getId();
				String img = sysName; 
				
				
				int result = pdao.updateBySeq(new ProfileDTO(seq,name,title,phone,specialty,office_name,office_phone,test,education,id,img));
				response.sendRedirect("toProfile.profile?seq="+seq);
				
			}else if(cmd.contentEquals("/toReservation.profile")) {
				//예약페이지 'reservation.jsp'로 해당 시퀀스의 profileDTO 넘기기 
				int seq = Integer.parseInt(request.getParameter("seq"));
				ProfileDTO pdto = pdao.selectBySeq(seq);
				request.setAttribute("pdto", pdto);
				RequestDispatcher rd = request.getRequestDispatcher("reservation.jsp");
				rd.forward(request, response);	
				
			}
			
			
			
		}catch(Exception e) {
			
		}
		
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}

 

ProfileDAO

pstat.setString(4, Arrays.toString(dto.getSpecialty()));// 배열을 스트링으로

String[] specialty = rs.getString("specialty").replace("[", "").replace("]", "").split(","); // 문자열을 배열로

package lv.backend.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;

import lv.backend.dto.ProfileDTO;
import lv.backend.statics.Configuration;


public class ProfileDAO {

	private Connection getConnection() throws Exception{
		Context ctx = new InitialContext();
		DataSource ds = (DataSource)ctx.lookup("java:comp/env/dbcp"); //경로
		return ds.getConnection();
	}

	public int insertProfile(ProfileDTO dto) throws Exception{

		String sql = "insert into profile_board values(profile_board_seq.nextval,?,?,?,?,?,?,?,?,?,?)";
		try(Connection con = this.getConnection();	
				PreparedStatement pstat = con.prepareStatement(sql)){
			pstat.setString(1, dto.getName());
			pstat.setString(2, dto.getTitle());
			pstat.setString(3, dto.getPhone());
			
	
			pstat.setString(4, Arrays.toString(dto.getSpecialty()));// 배열을 스트링으로
			pstat.setString(5, dto.getOffice_name());
			pstat.setString(6, dto.getOffice_phone());
			pstat.setString(7, dto.getTest());
			pstat.setString(8, dto.getEducation());
			pstat.setString(9, dto.getId());
			pstat.setString(10, dto.getImg());

			int result = pstat.executeUpdate();
			System.out.println("insertProfile 결과 : "+result);
			con.commit();
			return result;
		}
	}

	//전체 프로필 리스트 불러오기
	public List<ProfileDTO> selectAll() throws Exception{
		String sql = "select * from profile_board order by 1";
		List<ProfileDTO> result = new ArrayList<>();
		try(Connection con = this.getConnection();
				PreparedStatement pstat = con.prepareStatement(sql);
				ResultSet rs = pstat.executeQuery(); ){
			while(rs.next()) {
				int seq = rs.getInt("seq");
				String name = rs.getString("name");
				String title = rs.getString("title");
				String phone = rs.getString("phone");
				String[] specialty = rs.getString("specialty").replace("[", "").replace("]", "").split(","); // 문자열을 배열로
				String office_name = rs.getString("office_name");
				String office_phone = rs.getString("office_phone");
				String test = rs.getString("test");
				String education = rs.getString("education");
				String id = rs.getString("id");

				ProfileDTO dto = new ProfileDTO(seq,name,title,phone,specialty,office_name,office_phone,test,education,id);
				result.add(dto);
			}
			return result;
		}
	}

	// 전체를 불러오지 말고 일부만 불러오는 경우
	public List<ProfileDTO> selectByPageNo(int cpage) throws Exception{

		int start = cpage * Configuration.recordCountPerPage - (Configuration.naviCountPerPage-1);
		int end = start + (Configuration.recordCountPerPage-1);

		String sql = "select * from (select profile_board.*, row_number() over(order by seq desc) rnum from profile_board) where rnum between ? and ?";
		List<ProfileDTO> list = new ArrayList<>();	
		try(Connection con = this.getConnection();
				PreparedStatement pstat = con.prepareStatement(sql);
				){
			pstat.setInt(1, start);
			pstat.setInt(2, end);

			try(ResultSet rs = pstat.executeQuery();){
				while(rs.next()) {

					int seq = rs.getInt("seq");
					String name = rs.getString("name");
					String title = rs.getString("title");
					String phone = rs.getString("phone");
					String[] specialty = rs.getString("specialty").replace("[", "").replace("]", "").split(","); // 문자열을 배열로
					String office_name = rs.getString("office_name");
					String office_phone = rs.getString("office_phone");
					String test = rs.getString("test");
					String education = rs.getString("education");
					String id = rs.getString("id");
					String img = rs.getString("img");

					ProfileDTO dto = new ProfileDTO(seq,name,title,phone,specialty,office_name,office_phone,test,education,id,img);
					list.add(dto);
				}
				return list;
			}
		}
	}

	public String getpageNavi(int currentPage) throws Exception {
		//총 몇개의 글이 있는가? 한페이지에 몇개의 글을 보여줄 것인가?
		int recordTotalCount = this.getArticleCount(); // 총 게시물의 개수
		int recordCountPerPage = 10;// 한 페이지에 게시글 몇개를 보여줄 것인가?
		int naviCountPerPage = 10; //한 페이지에 네비게이터 몇개를 보여줄 것인가?
		int pageTotalCount = 0; // 전체 페이지의 개수
		if(recordTotalCount % recordCountPerPage > 0) {
			pageTotalCount = recordTotalCount / recordCountPerPage + 1;
			// 게시글 개수를 페이지당 게시글로 나누어 나머지 값이 있으면 한페이지를 더한다.
			// ex) 147개의 글이 있다면 10글 짜리 14페이지 + 7글짜리 1페이지 -> 총 15페이지 필요
		}else {
			pageTotalCount = recordTotalCount / recordCountPerPage;
			// 게시글 개수를 페이지당 게시글로 나누어 나머지 값이 없으면 더할 필요없다.
			// ex) 140개의 글이 있다면 10글 짜리 14페이지로 끝.
		}
		//현재 내가 위치한 페이지 번호, 1~pageTotalCount까지의 범위를 가진다.
		if(currentPage < 1) {
			currentPage = 1;
		}else if(currentPage > pageTotalCount) {
			currentPage = pageTotalCount;
		} // 공격자가 currentPage 값을 변조할 경우에 대한 보안 코드
		int startNavi = (currentPage - 1) / Configuration.naviCountPerPage * Configuration.naviCountPerPage + 1 ;
		int endNavi = startNavi + naviCountPerPage - 1 ;
		if(endNavi > pageTotalCount) {
			endNavi = pageTotalCount;
		}
		boolean needPrev = true;
		boolean needNext = true;
		if(startNavi == 1) {needPrev = false;}
		if(endNavi == pageTotalCount) {needNext = false;}

		StringBuilder sb = new StringBuilder(); // 리턴할 스트링 조합
		if(needPrev) {
			sb.append("<li><a href='toProfileListView.profile?cpage="+(startNavi-1)+"'><</a></li>");
		}
		for (int i = startNavi;i <= endNavi;i++) {
			sb.append("<li><a href='toProfileListView.profile?cpage="+i+"'>"+i+"</a></li>");
		}
		if(needNext) {
			sb.append("<li><a href='toProfileListView.profile?cpage="+(endNavi+1)+"'>></a></li>");
		}
		return sb.toString();
	}

	public int getArticleCount() throws Exception{
		String sql = "select count(*) from profile_board";
		try(Connection con = this.getConnection();	
				PreparedStatement pstat = con.prepareStatement(sql);
				ResultSet rs = pstat.executeQuery();){
			rs.next(); // 안쓰면 헤더를 가르키는 상태
			return rs.getInt(1);
		}
	}

	public ProfileDTO selectBySeq(int seq) throws Exception{
		String sql = "select * from profile_board where seq=?";
		try(
				Connection con = this.getConnection();
				PreparedStatement pstat = con.prepareStatement(sql);
				){
			pstat.setInt(1, seq);
			try(
					ResultSet rs = pstat.executeQuery();					
					){
				ProfileDTO dto = null;
				if(rs.next()) {
					String name = rs.getString("name");
					String title = rs.getString("title");
					String phone = rs.getString("phone");
					String[] specialty = rs.getString("specialty").replace("[", "").replace("]", "").split(","); // 문자열을 배열로
					String office_name = rs.getString("office_name");
					String office_phone = rs.getString("office_phone");
					String test = rs.getString("test");
					String education = rs.getString("education");
					String id = rs.getString("id");
					String img = rs.getString("img");
					dto = new ProfileDTO(seq,name,title,phone,specialty,office_name,office_phone,test,education,id,img);
				}
				return dto;	
			}
		}
	}

	public int deleteBySeq(int seq) throws Exception{
		String sql = "delete from profile_board where seq=?";
		try(
				Connection con = this.getConnection();
				PreparedStatement pstat = con.prepareStatement(sql);
				){
			pstat.setInt(1, seq);
			int result = pstat.executeUpdate();
			con.commit();
			return result;
		}
	}

	public int updateBySeq(ProfileDTO dto) throws Exception{


		if(dto.getImg() !=null) {
			String sql = "update profile_board set title=?, specialty=?, education=?, img=? where seq =?";
			try(
					Connection con = this.getConnection();
					PreparedStatement pstat = con.prepareStatement(sql);
					){
				pstat.setString(1, dto.getTitle());
		

				pstat.setString(2, Arrays.toString(dto.getSpecialty()));// 배열을 스트링 한개로
				pstat.setString(3, dto.getEducation());
				pstat.setString(4, dto.getImg());
				pstat.setInt(5, dto.getSeq());
				int result = pstat.executeUpdate();
				con.commit();
				return result;
			}

		}else { //이미지를 새로 업로드 하지 않은 경우 기존 이미지 유지
			String sql = "update profile_board set title=?, specialty=?, education=? where seq =?";
			try(
					Connection con = this.getConnection();
					PreparedStatement pstat = con.prepareStatement(sql);
					){
				pstat.setString(1, dto.getTitle());
				pstat.setString(2, Arrays.toString(dto.getSpecialty()));
				pstat.setString(3, dto.getEducation());
				pstat.setInt(4, dto.getSeq());
				int result = pstat.executeUpdate();
				con.commit();
				return result;
			}


		}

	}
}

 

 

배열 El 표현으로 꺼내기

profileList.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
	integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
	crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script
	src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
	integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
	crossorigin="anonymous"></script>
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet"
	href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css">
<style>
* {
	box-sizing: border-box;
	text-align: center;
}

/* 전체 틀 설정 (header, contents, footer영역) */
.container {
	width: 100%;
	margin: auto;
}

.header {
	/*맨위 고정메뉴*/
	position: fixed;
	width: 100%;
	z-index: 5;
	background-color: white;
	margin: 0px;
	width: 100%;
}

.contents {
	text-align: center;
	position: relative;
	top: 100px;
	margin: auto;
}

.footer {
	position: relative;
	top: 170px;
	width: 100%;
	margin: auto;
}

/* header 영역 설정 */
.q_menu_btn {
	text-align: left;
	padding-top: 10px;
}

/*퀵메뉴 버튼*/
.quickBtn {
	border: 0px solid white;
	background-color: white;
	width: 50px;
	height: 50px;
}

.quickLine {
	border-bottom: 3px solid #f56a6a;
	padding: 3px;
}

.logo {
	width: 200px;
	padding-top: 10px;
}

.navi {
	padding: 0px;
}

.nav {
	height: 100%;
}

.nav-item {
	line-height: 60px;
}

.nav-link {
	font-size: 18px;
	font-weight: 600;
	color: #f56a6a;
}

.nav-link:hover {
	color: #f9a5a5;
}

/* footer 영역 */
.footer {
	padding: 0;
}

.sponser {
	border: 1px solid lightgray;
}

.info1, .info3 {
	text-align: left;
}

.info2, .info4 {
	text-align: right;
}

.doosancompany {
	width: 100px;
}

.linklogo {
	width: 30px;
}

.infotext {
	font-size: 13px;
	color: gray;
}

.info2>a {
	color: black;
}

/* 퀵메뉴 사이드바 설정 */
.quickmenu {
	width: 230px;
	height: 100%;
	background-color: #f5f5f5;
	text-align: center;
	position: fixed;
	z-index: 10;
	top: 0px;
	left: -230px;
	/*퀵메뉴 위치*/
	transition-duration: 0.5s;
}

.quick_title {
	/*사이드바 Menu title 부분*/
	color: black;
	font-size: 20px;
	font-weight: 600;
	text-align: left;
	padding-top: 70px;
	padding-left: 30px;
}

.q_line {
	/* Menu 밑에 빨간줄 */
	border-bottom: 3px solid #f56a6a;
	width: 60px;
}

.quick_menu {
	padding-top: 10px;
}

.quick_menu>li {
	position: relative;
	width: 100%;
	height: 50px;
	list-style-type: none;
	padding-left: 30px;
}

.q_m_line {
	/*사이드메뉴 나누는 회색줄*/
	border: 0.5px solid lightgray;
	width: 150px;
}

.q_b_line {
	/*메뉴,로그인 나누는 굵은 회색줄*/
	border: 1px solid lightgray;
	width: 200px;
	position: relative;
	left: 20px;
	top: 30px;
	display: none;
}

.quick_menu>li>a {
	/* 사이드바 메뉴 글씨 */
	position: relative;
	text-decoration: none;
	color: dimgray;
	display: block;
	width: 100%;
	height: 100%;
	line-height: 50px;
	text-align: left;
}

.quick_menu>li>a:hover {
	color: darkgray;
}

#q_back:hover {
	cursor: pointer;
}

/* 사이드바 닫는 화살표 */
#q_back {
	margin-left: 170px;
	margin-top: 10px;
	font-size: 30px;
	font-weight: 600;
	width: 50px;
	height: 50px;
	position: fixed;
}

#back_arrow {
	width: 30px;
	height: 30px;
	z-index: 20;
}

/*화살표 이미지설정*/

/* 여기서부터 담당 페이지 스타일 추가하시면 됩니다. */
#p_board {
	width: 720px;
	height: 700px;
	margin: auto;
	border: 1px solid gray;
	overflow-y: auto;
	-ms-overflow-style: none; /*스크롤바 숨기기 - IE and Edge */
	scrollbar-width: none; /* 스크롤바 숨기기 - Firefox */
}

#p_board::-webkit-scrollbar {
	display: none; /* 스크롤바 숨기기 - Chrome, Safari, Opera*/
}

.article {
	float: left;
	height: 100px;
	width: 100%;
	text-align: center;
	background-color: #f5f5f5;
	margin-bottom :10px;

}

.title {
	float: left;
	width: 80%;
	height: 50%;
	text-align: left;
	line-height: 50px;
	margin-left : 10px;
}

.name {
	float: left;
	width: 80%;
	height: 25%;
	text-align: left;
	line-height: 25px;
	text-size: 25px;
	margin-left : 10px;
}

.phone {
	color: #f56a6a;
	float: left;
	width: 80%;
	height: 25%;
	text-align: left;
	line-height: 25px;
	margin-left : 10px;
}

.profileImg {
	float: right;
	width: 100px;
	height: 100%;
}

.thumbnail {
	
	border-radius: 70%;
	
	position: relative;
	right: 20px;
	padding-top: 100%;
	overflow: hidden;
}

.thumbnail .centered {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	transform: translate(50%, 50%);
}

.thumbnail .centered img {
	max-width: 100%;
	height: 100%;
	object-fit: cover;
	transform: translate(-50%, -50%);
}

input[type=button], input[type=submit] {
	border: 1px;
	border-radius: 4px;
	background-color: #f56a6a;
	color: #f4f5f9;
	height: 25px;
	margin-top: 20px;
}
 a:link { color: red; text-decoration: none;}
 a:visited { color: black; text-decoration: none;}

</style>

<script>


		var pageNo = 1;
		$(function() {
			$.ajax({
						url : "profileListAjax.profile",
						data : {
							cpage : pageNo++
						},
						dataType : "json"
					})
					.done(
							function(resp) {
								console.log(resp);
								for (var i = 0; i < resp.length; i++) {

									console.log(resp[i].seq);

		var line = $("<div>");
									line.addClass("article")

									var title = $("<div>");
									title.addClass("title");
									title.append(resp[i].title);

									var name = $("<div>");
									name.addClass("name");
									name.append("<a href='toProfile.profile?seq="
													+ resp[i].seq
													+ "'>"
													+ resp[i].name + "</a>");

									var phone = $("<div>");
									phone.addClass("phone");
									phone.append("☎ " + resp[i].office_phone);

									var profileImg = $("<div>");
									profileImg.addClass("profileImg");
									
							<%-- 회원정보에 이미지가 null일 경우 기본 사진(lawyer.png) 출력 --%>
									if(resp[i].img == null){
										profileImg.append("<div class=thumbnail><div class=centered><a href='toProfile.profile?seq="+resp[i].seq+"'><img src='${pageContext.request.contextPath}/upload/lawyer.png'></a></div></div>")

									}else{
										profileImg.append("<div class=thumbnail><div class=centered><a href='toProfile.profile?seq="+resp[i].seq+"'><img src='${pageContext.request.contextPath}/upload/"+resp[i].img+"''></a></div></div>")

									}
					
									line.append(name);
									line.append(profileImg);
									line.append(title);
									line.append(phone);
									
									$("#p_board").append(line);
								}
							});
		
		
					                $("#q_menu_btn").on("click", function(){
					                    $("#quickmenu").css("transform", "translate(100%, 0px)");
					                })
					                $("#q_back").on("click", function(){
					                    $(this).parent().css("transform", "translate(-100%, 0px)");
					                    $(this).parent().css("transition-duration", "1s");
					                })
					                
					                
					                $("#p_board").on("scroll", function() {
			var board = document.getElementById("p_board");
			if (board.offsetHeight + board.scrollTop > board.scrollHeight) {
				loadData();
			}
		})
		function loadData() {
			$.ajax({
				url : "profileListAjax.profile",
				data : {
					cpage : pageNo++
				},
				dataType : "json"
			}).done(
					function(resp) {
						console.log(resp);
						for (var i = 0; i < resp.length; i++) {

							var line = $("<div >");
							line.addClass("article")

							var title = $("<div>");
							title.addClass("title");
							title.append(resp[i].title);

							var name = $("<div>");
							name.addClass("name");
							name.append("<a href='toProfile.profile?seq="
									+ resp[i].seq + "'>" + resp[i].name
									+ "</a>");

							var phone = $("<div>");
							phone.addClass("phone");
							phone.append("☎ " + resp[i].office_phone);
							
							
							var profileImg = $("<div>");
							profileImg.addClass("profileImg");
							if(resp[i].img == null){
								profileImg.append("<div class=thumbnail><div class=centered><a href='toProfile.profile?seq="+resp[i].seq+"'><img src='${pageContext.request.contextPath}/upload/lawyer.png'></a></div></div>")

							}else{
								profileImg.append("<div class=thumbnail><div class=centered><a href='toProfile.profile?seq="+resp[i].seq+"'><img src='${pageContext.request.contextPath}/upload/"+resp[i].img+"''></a></div></div>")

							}

							line.append(name);
							line.append(profileImg);
							line.append(title);
							line.append(phone);

							$("#p_board").append(line);
						}
					});

		}

			$("#writeProfile").on("click", function() {
				location.href = "profileWrite.jsp";
			})
					                
		})

		
	</script>

</head>
<body>

            <!-- header 영역 (맨위에 메뉴바) -->
            <div class="row header">

                <!-- quick menu 버튼 -->
                <div class="q_menu_btn col-2 col-sm-1 col-md-0 d-md-none d-block" id=q_menu_btn>
                    <!--   quickmenu 넣기-->
                    <button class=quickBtn>
                        <div class=quickLine></div>
                        <div class=quickLine></div>
                        <div class=quickLine></div>
                    </button>

                </div>

                <!-- quick menu -->           
                <div class="quickmenu" id="quickmenu">
                    <div id=q_back><img src="resources/image/back.png" id=back_arrow></div>

                    <div class=quick_title>
                        Menu
                        <div class=q_line></div>
                    </div>
                    <div class=quick_menu>
                        <li><a href=search.jsp>법률검색</a><div class=q_m_line></div></li>
                        <li><a href=board.req>의뢰하기</a><div class=q_m_line></div></li>
                        <li><a href=toProfileList.profile>변호사</a><div class=q_m_line></div></li>
                        <li><a href=faqlist.question>Q&A</a></li>
                    </div>
                    <div class=q_b_line></div>
                    <div class=quick_title>
                        Login
                        <div class=q_line></div>
                    </div>
                    <div class=quick_menu>
                    	<c:choose>
                    		<c:when test="${empty sessionScope.clientInfo && empty sessionScope.lawyerInfo}">
                    			<li><a href=login.jsp>로그인</a><div class=q_m_line></div></li>
                    		</c:when>
                    		<c:otherwise>
                    			<li><a href="logout.login">로그아웃</a><div class=q_m_line></div></li>
                    			<li><a href="go.mypage">마이페이지</a></li>
                    		</c:otherwise>
                    	</c:choose>                        
                    </div>
                </div>

                <div class="logo col-2 col-md-3 col-lg-2">
                    <a href=main.jsp><img src="resources/image/lawview.jpg" class="logo"></a>
                </div>

                <div class="navi col-9 col-lg-10 d-md-block d-none">
                    <ul class="nav justify-content-end">
                        <li class="nav-item">
                            <a class="nav-link active" href=search.jsp>법률 검색</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href=board.req>의뢰하기</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href=toProfileList.profile>변호사</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="faqlist.question">Q&A</a>
                        </li>
                        <li class="nav-item">
	                        <c:choose>
	                    		<c:when test="${empty sessionScope.clientInfo && empty sessionScope.lawyerInfo}">
	                    			<a class="nav-link" href=login.jsp>Login</a>
	                    		</c:when>
	                    		<c:otherwise>
	                    			<a class="nav-link" href=logout.login>Logout</a>
	                    		</c:otherwise>
	                    	</c:choose>
                        </li>
                    </ul>
                </div>

            </div>


	<!--      전체 컨테이너 (헤더,푸터 제외)    -->
	<div class=container>

		<!-- contents 영역 (여기에 각자 컨텐츠들 넣으시면 돼요) -->
		<div class=contents>


			<div id="p_board"></div>

			<c:choose>
				<c:when test="${not empty sessionScope.lawyerInfo}">
			<div class="col-12" align=right>
				<input type=button id=writeProfile value="프로필 작성">
			</div>
			</c:when>
			</c:choose>


		</div>
		<!-- contents 영역 끝 -->

	</div>
	<!--container 끝-->



	<!--     footer 영역      -->
	<div class="row footer">
		<div class="col-12 sponser" style="padding: 0"></div>
		<div class="col-12 col-md-5 info1 infotext">
			<br>Copyrightⓒ 2020 Law View Inc. All Rights Reserved.
		</div>
		<div class="col-12 col-md-7 info2 infotext">
			<br> <a href=#>이용약관 </a>| <a href=#> 개인정보처리방침 </a>| <a href=#>
				이메일주소 무단수집 거부 </a>| <a href=#> 정도경영 사이버신문고 </a>| <a href=#> 영상정보처리기기
				운영관리 방침 </a>|
		</div>
		<div class="col-12 col-md-6 info3 infotext">
			<br> <a href=main.jsp><img src="resources/image/lawview.jpg"
				class="doosancompany"></a> Law View is operated by LAW VIEW Inc.<br>
			<br> <a href=#><img src="resources/image/facebook.jpg"
				class="linklogo"></a> <a href=#><img
				src="resources/image/twitter.jpg" class="linklogo"></a> <a href=#><img
				src="resources/image/instagram.png" class="linklogo"></a> <a
				href=#><img src="resources/image/youtube.png" class="linklogo"></a>
		</div>
		<div class="col-12 col-md-6 info4 infotext">
			<br>사업자 등록번호 : 851-87-00622 대표자 성명 : 박정수<br> 사업자주소 : 서울특별시
			중구 남대문로 120 대일빌딩 2F, 3F<br> 연락처 : 02-722-0858 개인정보관리책임자 : 김영재
		</div>
	</div>


</body>
</html>

profileWrite.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script
	src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script
	src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<style>
* {
	box-sizing: border-box;
	text-align: center;
}

/* 전체 틀 설정 (header, contents, footer영역) */
.container {
	width: 100%;
	margin: auto;
}

.header { /*맨위 고정메뉴*/
	position: fixed;
	width: 100%;
	z-index: 5;
	background-color: white;
	margin: 0px;
	width: 100%;
}

.contents {
	text-align: center;
	position: relative;
	top: 100px;
	margin: auto;
}

.footer {
	position: relative;
	top: 170px;
	width: 100%;
	margin: auto;
}

/* header 영역 설정 */
.q_menu_btn {
	text-align: left;
	padding-top: 10px;
} /*퀵메뉴 버튼*/
.quickBtn {
	border: 0px solid white;
	background-color: white;
	width: 50px;
	height: 50px;
}

.quickLine {
	border-bottom: 3px solid #f56a6a;
	padding: 3px;
}

.logo {
	width: 200px;
	padding-top: 10px;
}

.navi {
	padding: 0px;
}

.nav {
	height: 100%;
}

.nav-item {
	line-height: 60px;
}

.nav-link {
	font-size: 18px;
	font-weight: 600;
	color: #f56a6a;
}

.nav-link:hover {
	color: #f9a5a5;
}

/* footer 영역 */
.footer {
	padding: 0;
}

.sponser {
	border: 1px solid lightgray;
}

.info1, .info3 {
	text-align: left;
}

.info2, .info4 {
	text-align: right;
}

.doosancompany {
	width: 100px;
}

.linklogo {
	width: 30px;
}

.infotext {
	font-size: 13px;
	color: gray;
}

.info2>a {
	color: black;
}

/* 퀵메뉴 사이드바 설정 */
.quickmenu {
	width: 230px;
	height: 100%;
	background-color: #f5f5f5;
	text-align: center;
	position: fixed;
	z-index: 10;
	top: 0px;
	left: -230px; /*퀵메뉴 위치*/
	transition-duration: 0.5s;
}

.quick_title { /*사이드바 Menu title 부분*/
	color: black;
	font-size: 20px;
	font-weight: 600;
	text-align: left;
	padding-top: 70px;
	padding-left: 30px;
}

.q_line { /* Menu 밑에 빨간줄 */
	border-bottom: 3px solid #f56a6a;
	width: 60px;
}

.quick_menu {
	padding-top: 10px;
}

.quick_menu>li {
	position: relative;
	width: 100%;
	height: 50px;
	list-style-type: none;
	padding-left: 30px;
}

.q_m_line { /*사이드메뉴 나누는 회색줄*/
	border: 0.5px solid lightgray;
	width: 150px;
}

.q_b_line { /*메뉴,로그인 나누는 굵은 회색줄*/
	border: 1px solid lightgray;
	width: 200px;
	position: relative;
	left: 20px;
	top: 30px;
	display: none;
}

.quick_menu>li>a { /* 사이드바 메뉴 글씨 */
	position: relative;
	text-decoration: none;
	color: dimgray;
	display: block;
	width: 100%;
	height: 100%;
	line-height: 50px;
	text-align: left;
}

.quick_menu>li>a:hover {
	color: darkgray;
}

#q_back:hover {
	cursor: pointer;
} /* 사이드바 닫는 화살표 */
#q_back {
	margin-left: 170px;
	margin-top: 10px;
	font-size: 30px;
	font-weight: 600;
	width: 50px;
	height: 50px;
	position: fixed;
}

#back_arrow {
	width: 30px;
	height: 30px;
	z-index: 20;
} /*화살표 이미지설정*/

/* 여기서부터 담당 페이지 스타일 추가하시면 됩니다. */
input[type=button], input[type=submit] {
	border: 1px;
	border-radius: 4px;
	background-color: #f56a6a;
	color: #f4f5f9;
	height: 25px;
	margin-top: 20px;
}
</style>

<script>
$(function(){
    $("#q_menu_btn").on("click", function(){
        $("#quickmenu").css("transform", "translate(100%, 0px)");
    })
    $("#q_back").on("click", function(){
        $(this).parent().css("transform", "translate(-100%, 0px)");
        $(this).parent().css("transition-duration", "1s");
    })
    
    
    //여기서부터 담당 페이지 스크립트 새로 추가하시면 됩니다!
	$("#back").on("click", function() {
		location.href = 'toProfileList.profile'
	});
    
    

})
</script>
</head>

<body>

	<!-- header 영역 (맨위에 메뉴바) -->
	<div class="row header">

		<!-- quick menu 버튼 -->
		<div class="q_menu_btn col-2 col-sm-1 col-md-0 d-md-none d-block"
			id=q_menu_btn>
			<!--   quickmenu 넣기-->
			<button class=quickBtn>
				<div class=quickLine></div>
				<div class=quickLine></div>
				<div class=quickLine></div>
			</button>

		</div>

		<!-- quick menu -->
		<div class="quickmenu" id="quickmenu">
			<div id=q_back>
				<img src="resources/image/back.png" id=back_arrow>
			</div>

			<div class=quick_title>
				Menu
				<div class=q_line></div>
			</div>
			<div class=quick_menu>
				<li><a href=search.jsp>법률검색</a>
				<div class=q_m_line></div></li>
				<li><a href=board.req>의뢰하기</a>
				<div class=q_m_line></div></li>
				<li><a href=toProfileList.profile>변호사</a>
				<div class=q_m_line></div></li>
				<li><a href=faqlist.question>Q&A</a></li>
			</div>
			<div class=q_b_line></div>
			<div class=quick_title>
				Login
				<div class=q_line></div>
			</div>
			<div class=quick_menu>
				<c:choose>
					<c:when
						test="${empty sessionScope.clientInfo && empty sessionScope.lawyerInfo}">
						<li><a href=login.jsp>로그인</a>
						<div class=q_m_line></div></li>
					</c:when>
					<c:otherwise>
						<li><a href="logout.login">로그아웃</a>
						<div class=q_m_line></div></li>
						<li><a href="go.mypage">마이페이지</a></li>
					</c:otherwise>
				</c:choose>
			</div>
		</div>

		<div class="logo col-2 col-md-3 col-lg-2">
			<a href=main.jsp><img src="resources/image/lawview.jpg"
				class="logo"></a>
		</div>

		<div class="navi col-9 col-lg-10 d-md-block d-none">
			<ul class="nav justify-content-end">
				<li class="nav-item"><a class="nav-link active" href=search.jsp>법률
						검색</a></li>
				<li class="nav-item"><a class="nav-link" href=board.req>의뢰하기</a>
				</li>
				<li class="nav-item"><a class="nav-link"
					href=toProfileList.profile>변호사</a></li>
				<li class="nav-item"><a class="nav-link"
					href="faqlist.question">Q&A</a></li>
				<li class="nav-item"><c:choose>
						<c:when
							test="${empty sessionScope.clientInfo && empty sessionScope.lawyerInfo}">
							<a class="nav-link" href=login.jsp>Login</a>
						</c:when>
						<c:otherwise>
							<a class="nav-link" href=logout.login>Logout</a>
						</c:otherwise>
					</c:choose></li>
			</ul>
		</div>

	</div>
	<!--      전체 컨테이너 (헤더,푸터 제외)    -->
	<div class=container>

		<!-- contents 영역 (여기에 각자 컨텐츠들 넣으시면 돼요) -->
		<div class=contents>



			<form action=write.profile method="post"
				enctype="multipart/form-data">
				<div class="container">



					<div class="form-group row">
						<div class="col-sm">
							<input id="title" name="title" class="form-control-plaintext"
								type="text" placeholder="제목을 입력하세요.">
						</div>
					</div>

					<div class="form-group">
	
						전문분야<br>
						<input type='checkbox' name='specialty' value='이혼' />이혼 &nbsp;
						<input type='checkbox' name='specialty' value='손해배상' />손해배상 &nbsp; 
						<input type='checkbox' name='specialty' value='폭행' />폭행/협박  &nbsp;
						<input type='checkbox' name='specialty' value='가사' />가사기타  &nbsp;
						<input type='checkbox' name='specialty' value='성범죄' />성범죄  &nbsp;
						<input type='checkbox' name='specialty' value='재산범죄' />재산범죄  &nbsp;
						<input type='checkbox' name='specialty' value='수사' />수사  &nbsp;
						<input type='checkbox' name='specialty' value='민사기타' />민사기타&nbsp;<br>
						<input type='checkbox' name='specialty' value='친족' />친족&nbsp;
						<input type='checkbox' name='specialty' value='채권추심' />채권추심&nbsp;
						<input type='checkbox' name='specialty' value='민사소송절차' />민사소송절차&nbsp;
						<input type='checkbox' name='specialty' value='상속' />상속&nbsp;
						<input type='checkbox' name='specialty' value='형사기타' />형사기타&nbsp;
						<input type='checkbox' name='specialty' value='기타법률서비스' />기타법률서비스

					</div>

					<div class="form-group">
						<textarea class="form-control" name="education"
							id="exampleFormControlTextarea1" rows="10"
							placeholder="education를 입력하세요."></textarea>
					</div>

					<div class="form-group">
						<input type=file name="file">
					</div>

					<div id="writeBtn">
						<input type="submit" id="write" value="작성 완료"> <input
							type="button" id="back" value="목록으로">
					</div>

				</div>
			</form>



		</div>
		<!-- contents 영역 끝 -->

	</div>
	<!--container 끝-->



	<!--     footer 영역      -->
	<div class="row footer">
		<div class="col-12 sponser" style="padding: 0"></div>
		<div class="col-12 col-md-5 info1 infotext">
			<br>Copyrightⓒ 2020 Law View Inc. All Rights Reserved.
		</div>
		<div class="col-12 col-md-7 info2 infotext">
			<br> <a href=#>이용약관 </a>| <a href=#> 개인정보처리방침 </a>| <a href=#>
				이메일주소 무단수집 거부 </a>| <a href=#> 정도경영 사이버신문고 </a>| <a href=#> 영상정보처리기기
				운영관리 방침 </a>|
		</div>
		<div class="col-12 col-md-6 info3 infotext">
			<br> <a href=main.jsp><img src="resources/image/lawview.jpg"
				class="doosancompany"></a> Law View is operated by LAW VIEW Inc.<br>
			<br> <a href=#><img src="resources/image/facebook.jpg"
				class="linklogo"></a> <a href=#><img
				src="resources/image/twitter.jpg" class="linklogo"></a> <a href=#><img
				src="resources/image/instagram.png" class="linklogo"></a> <a
				href=#><img src="resources/image/youtube.png" class="linklogo"></a>
		</div>
		<div class="col-12 col-md-6 info4 infotext">
			<br>사업자 등록번호 : 851-87-00622 대표자 성명 : 박정수<br> 사업자주소 : 서울특별시
			중구 남대문로 120 대일빌딩 2F, 3F<br> 연락처 : 02-722-0858 개인정보관리책임자 : 김영재
		</div>
	</div>

</body>
</html>

 

profile.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>LawView</title>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script
	src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script
	src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>

<style>
* {
	box-sizing: border-box;
	text-align: center;
}

/* 전체 틀 설정 (header, contents, footer영역) */
.container {
	width: 100%;
	margin: auto;
}

.header {
	/*맨위 고정메뉴*/
	position: fixed;
	width: 100%;
	z-index: 5;
	background-color: white;
	margin: 0px;
	width: 100%;
}

.contents {
	text-align: center;
	position: relative;
	top: 100px;
	margin: auto;
}

.footer {
	position: relative;
	top: 170px;
	width: 100%;
	margin: auto;
}

/* header 영역 설정 */
.q_menu_btn {
	text-align: left;
	padding-top: 10px;
}

/*퀵메뉴 버튼*/
.quickBtn {
	border: 0px solid white;
	background-color: white;
	width: 50px;
	height: 50px;
}

.quickLine {
	border-bottom: 3px solid #f56a6a;
	padding: 3px;
}

.logo {
	width: 200px;
	padding-top: 10px;
}

.navi {
	padding: 0px;
}

.nav {
	height: 100%;
}

.nav-item {
	line-height: 60px;
}

.nav-link {
	font-size: 18px;
	font-weight: 600;
	color: #f56a6a;
}

.nav-link:hover {
	color: #f9a5a5;
}

/* footer 영역 */
.footer {
	padding: 0;
}

.sponser {
	border: 1px solid lightgray;
}

.info1, .info3 {
	text-align: left;
}

.info2, .info4 {
	text-align: right;
}

.doosancompany {
	width: 100px;
}

.linklogo {
	width: 30px;
}

.infotext {
	font-size: 13px;
	color: gray;
}

.info2>a {
	color: black;
}

/* 퀵메뉴 사이드바 설정 */
.quickmenu {
	width: 230px;
	height: 100%;
	background-color: #f5f5f5;
	text-align: center;
	position: fixed;
	z-index: 10;
	top: 0px;
	left: -230px;
	/*퀵메뉴 위치*/
	transition-duration: 0.5s;
}

.quick_title {
	/*사이드바 Menu title 부분*/
	color: black;
	font-size: 20px;
	font-weight: 600;
	text-align: left;
	padding-top: 70px;
	padding-left: 30px;
}

.q_line {
	/* Menu 밑에 빨간줄 */
	border-bottom: 3px solid #f56a6a;
	width: 60px;
}

.quick_menu {
	padding-top: 10px;
}

.quick_menu>li {
	position: relative;
	width: 100%;
	height: 50px;
	list-style-type: none;
	padding-left: 30px;
}

.q_m_line {
	/*사이드메뉴 나누는 회색줄*/
	border: 0.5px solid lightgray;
	width: 150px;
}

.q_b_line {
	/*메뉴,로그인 나누는 굵은 회색줄*/
	border: 1px solid lightgray;
	width: 200px;
	position: relative;
	left: 20px;
	top: 30px;
	display: none;
}

.quick_menu>li>a {
	/* 사이드바 메뉴 글씨 */
	position: relative;
	text-decoration: none;
	color: dimgray;
	display: block;
	width: 100%;
	height: 100%;
	line-height: 50px;
	text-align: left;
}

.quick_menu>li>a:hover {
	color: darkgray;
}

#q_back:hover {
	cursor: pointer;
}

/* 사이드바 닫는 화살표 */
#q_back {
	margin-left: 170px;
	margin-top: 10px;
	font-size: 30px;
	font-weight: 600;
	width: 50px;
	height: 50px;
	position: fixed;
}

#back_arrow {
	width: 30px;
	height: 30px;
	z-index: 20;
}

/*화살표 이미지설정*/

/* 여기서부터 담당 페이지 스타일 추가하시면 됩니다. */

@font-face {
	font-family: "barunGothic";
	src: url("NanumBarunGothic.ttf") format("truetype");
	font-style: normal;
	font-weight: normal;
}

* {
	font-family: "barunGothic";
	font-size: 20px;
	box-sizing: border-box;
}

.container {
	border-radius: 3px;
	width:750px;
	background-color: #f4f5f9;
	color: #252c41;
	margin: auto;
	border: 1px solid #dddfe6;
}

.row:first-child>.col-12 {
	border-radius: 3px;
	padding: 20px;
}

.row>div {
	margin-top: 1px;
	background-color: white;
	padding: 10px;
}

.comment {
	padding: 0px;
}

#box1 {
	width: 100%;
	border: 1px dotted black;
	height: 100%;
	float: left;
	overflow-y: auto;
}

#box2 {
	border-radius: 5px;
	height: 100%;
	text-align: center;
}

#send {
	border: 1px solid #ffffff;
	border-radius: 5px;
	color: #ffffff;
}

.list {
	border-radius: 10px;
	margin: auto;
	word-wrap: break-word;
	word-break: break-all;
}

input[type=button], input[type=submit] {
	border: 1px;
	border-radius: 4px;
	background-color: #f56a6a;
	color: #f4f5f9;
	height: 30px;
}

.cmt {
	postion: relative;
	padding: 15px;
	background-color: #f4f5f9;
}

.cmt>input {
	position: absolute;
	right: 10px;
	top: 10px;
	background-color: #252c41;
}
</style>
<script>
	$(function() {
		$("#back").on("click", function() {
			location.href = "toProfileList.profile";
		})

		$("#delete").on("click", function() {
			var result = confirm("정말 삭제하시겠습니까?");
			if (result) {
				location.href = "delete.profile?seq=" + ${pdto.seq};
			}
		})

		$("#modify").on("click", function() {
			location.href = "toProfileModify.profile?seq=" + ${pdto.seq};
		})
		$("#reservation").on("click", function() {
			location.href = "toReservation.profile?seq=" + ${pdto.seq};
		})
		
	})
</script>
</head>
<body>
            <!-- header 영역 (맨위에 메뉴바) -->
            <div class="row header">

                <!-- quick menu 버튼 -->
                <div class="q_menu_btn col-2 col-sm-1 col-md-0 d-md-none d-block" id=q_menu_btn>
                    <!--   quickmenu 넣기-->
                    <button class=quickBtn>
                        <div class=quickLine></div>
                        <div class=quickLine></div>
                        <div class=quickLine></div>
                    </button>

                </div>

                <!-- quick menu -->           
                <div class="quickmenu" id="quickmenu">
                    <div id=q_back><img src="resources/image/back.png" id=back_arrow></div>

                    <div class=quick_title>
                        Menu
                        <div class=q_line></div>
                    </div>
                    <div class=quick_menu>
                        <li><a href=search.jsp>법률검색</a><div class=q_m_line></div></li>
                        <li><a href=board.req>의뢰하기</a><div class=q_m_line></div></li>
                        <li><a href=toProfileList.profile>변호사</a><div class=q_m_line></div></li>
                        <li><a href=faqlist.question>Q&A</a></li>
                    </div>
                    <div class=q_b_line></div>
                    <div class=quick_title>
                        Login
                        <div class=q_line></div>
                    </div>
                    <div class=quick_menu>
                    	<c:choose>
                    		<c:when test="${empty sessionScope.clientInfo && empty sessionScope.lawyerInfo}">
                    			<li><a href=login.jsp>로그인</a><div class=q_m_line></div></li>
                    		</c:when>
                    		<c:otherwise>
                    			<li><a href="logout.login">로그아웃</a><div class=q_m_line></div></li>
                    			<li><a href="go.mypage">마이페이지</a></li>
                    		</c:otherwise>
                    	</c:choose>                        
                    </div>
                </div>

                <div class="logo col-2 col-md-3 col-lg-2">
                    <a href=main.jsp><img src="resources/image/lawview.jpg" class="logo"></a>
                </div>

                <div class="navi col-9 col-lg-10 d-md-block d-none">
                    <ul class="nav justify-content-end">
                        <li class="nav-item">
                            <a class="nav-link active" href=search.jsp>법률 검색</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href=board.req>의뢰하기</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href=toProfileList.profile>변호사</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="faqlist.question">Q&A</a>
                        </li>
                        <li class="nav-item">
	                        <c:choose>
	                    		<c:when test="${empty sessionScope.clientInfo && empty sessionScope.lawyerInfo}">
	                    			<a class="nav-link" href=login.jsp>Login</a>
	                    		</c:when>
	                    		<c:otherwise>
	                    			<a class="nav-link" href=logout.login>Logout</a>
	                    		</c:otherwise>
	                    	</c:choose>
                        </li>
                    </ul>
                </div>

            </div>
				<!-- contents 영역 (여기에 각자 컨텐츠들 넣으시면 돼요) -->
		<div class=contents>

	<div class="container">
		<div class="row">
		<div class="col-12" align=center>
			<div class="card bg-dark text-white">
				<c:if test="${!empty pdto.img}">
					<img
						src="${pageContext.request.contextPath}/upload/${pdto.img}"
						class="card-img" id=profileImg>

				</c:if>
				<c:if test="${empty dto.img}">
					<img
						src="${pageContext.request.contextPath}/upload/lawyer.png"
						class="card-img" id=profileImg>
				</c:if>


				<div class="card-img-overlay">
					<h5 class="card-title">${pdto.name}</h5>
					<p class="card-text">${pdto.title}</p>
				</div>
			</div>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=center>
				<b>변호사 ${pdto.name}</b>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=center>
				<b> ${pdto.title}</b>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=center>
				<b>${pdto.office_name}</b>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=center>
				<b>☎ ${pdto.office_phone}</b>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=left>
				<b> ${pdto.name}변호사의 전문 분야</b><br>
			  	 <c:forEach var="i" begin="0" step="1" end="14">
				 ${pdto.specialty[i]} &nbsp;
				 </c:forEach>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=left>
				<b> ${pdto.name}변호사의 교육 사항을 확인하세요</b><br> <p>${pdto.education}</p>
			</div>
		</div>

		<div class="row">
			<div class="col-12"></div>
		</div>
		<div class="row">
			<!--
			<c:forEach var="f" items="${fileList}">
				<div class="col-12">첨부파일 : ${f.oriFileName}</div>
			</c:forEach>
			  -->
		</div>

		<c:forEach var="cmt" items="${list}">
			<div class="row">
				<div class="col-12 list"></div>
			</div>
		</c:forEach>

		<div class="row">
			<c:choose>
				<c:when test="${pdto.id == sessionScope.lawyerInfo}">
					<div class="col-12" align=right>
						<input type=button id=back value="프로필 목록으로"> <input
							type=button id=delete value="프로필 삭제"> <input type=button
							id=modify value="프로필 수정">
					</div>
				</c:when>

				<%-- admin.id 일 때도 버튼이 보이도록 수정 : admin.id는 개발자가 결정?		
				<c:when test="${not empty sessionScope.adminInfo}">
					<div class="col-12" align=right>
						<input type=button id=back value="프로필 목록으로"> <input
							type=button id=delete value="프로필 삭제"> <input type=button
							id=modify value="프로필 수정">
					</div>
				</c:when>				
--%>

				<c:otherwise>
					<div class="col-12" align=right>
						<input type=button id=back value="프로필 목록으로"> <input
							type=button id=reservation value="예약하기">


					</div>
				</c:otherwise>
			</c:choose>
		</div>
	</div>
		</div>

	<!--     footer 영역      -->
	<div class="row footer">
		<div class="col-12 sponser" style="padding: 0"></div>
		<div class="col-12 col-md-5 info1 infotext">
			<br>Copyrightⓒ 2020 Law View Inc. All Rights Reserved.
		</div>
		<div class="col-12 col-md-7 info2 infotext">
			<br> <a href=#>이용약관 </a>| <a href=#> 개인정보처리방침 </a>| <a href=#>
				이메일주소 무단수집 거부 </a>| <a href=#> 정도경영 사이버신문고 </a>| <a href=#> 영상정보처리기기
				운영관리 방침 </a>|
		</div>
		<div class="col-12 col-md-6 info3 infotext">
			<br> <a href=main.jsp><img src="resources/image/lawview.jpg"
				class="doosancompany"></a> Law View is operated by LAW VIEW Inc.<br>
			<br> <a href=#><img src="resources/image/facebook.jpg"
				class="linklogo"></a> <a href=#><img
				src="resources/image/twitter.jpg" class="linklogo"></a> <a href=#><img
				src="resources/image/instagram.png" class="linklogo"></a> <a
				href=#><img src="resources/image/youtube.png" class="linklogo"></a>
		</div>
		<div class="col-12 col-md-6 info4 infotext">
			<br>사업자 등록번호 : 851-87-00622 대표자 성명 : 박정수<br> 사업자주소 : 서울특별시
			중구 남대문로 120 대일빌딩 2F, 3F<br> 연락처 : 02-722-0858 개인정보관리책임자 : 김영재
		</div>
	</div>

</body>
</html>

 

profileModify.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script
	src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script
	src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script>
	
</script>
<style>

            *{
                box-sizing: border-box;
                text-align: center;
            }

            /* 전체 틀 설정 (header, contents, footer영역) */
            .container{width: 100%; margin: auto;}
            .header{   /*맨위 고정메뉴*/
                position: fixed; 
                width: 100%; 
                z-index: 5; 
                background-color: white; 
                margin: 0px;
                width: 100%;
            }
            .contents{text-align: center; position: relative; top: 100px; margin: auto;}
            .footer{position: relative; top: 170px; width: 100%; margin: auto;}



            /* header 영역 설정 */
            .q_menu_btn{text-align: left; padding-top: 10px;}  /*퀵메뉴 버튼*/
            .quickBtn{border: 0px solid white; background-color: white; width: 50px; height: 50px;}
            .quickLine{border-bottom: 3px solid #f56a6a; padding: 3px;}
            .logo{width: 200px; padding-top: 10px;}

            .navi{padding: 0px;}
            .nav{height: 100%;}
            .nav-item{line-height: 60px;}
            .nav-link{font-size: 18px; font-weight: 600; color:#f56a6a;}
            .nav-link:hover{color: #f9a5a5;}



            /* footer 영역 */
            .footer {padding: 0;}
            .sponser{border:1px solid lightgray;}
            .info1,.info3{text-align: left;}
            .info2,.info4{text-align: right;}

            .doosancompany{width: 100px;}
            .linklogo{width: 30px;}
            .infotext{font-size: 13px; color: gray;}
            .info2>a{color: black;}



            /* 퀵메뉴 사이드바 설정 */
            .quickmenu{
                width: 230px; height: 100%;
                background-color: #f5f5f5;
                text-align: center;
                position: fixed;
                z-index: 10;
                top: 0px; left: -230px;  /*퀵메뉴 위치*/
                transition-duration: 0.5s;
            }
            .quick_title{  /*사이드바 Menu title 부분*/
                color: black; 
                font-size: 20px; 
                font-weight: 600;
                text-align: left;
                padding-top: 70px;
                padding-left: 30px;
            }
            .q_line{   /* Menu 밑에 빨간줄 */
                border-bottom: 3px solid #f56a6a;
                width: 60px;
            }
            .quick_menu{
                padding-top: 10px;
            }
            .quick_menu>li{
                position: relative;
                width: 100%; height: 50px;
                list-style-type: none;
                padding-left: 30px;
            }
            .q_m_line{   /*사이드메뉴 나누는 회색줄*/
                border: 0.5px solid lightgray; 
                width: 150px;
            }
            .q_b_line{  /*메뉴,로그인 나누는 굵은 회색줄*/
                border: 1px solid lightgray; 
                width: 200px;
                position: relative;
                left: 20px; top: 30px;
                display: none;
            }
            .quick_menu>li>a{  /* 사이드바 메뉴 글씨 */
                position: relative;
                text-decoration: none;
                color: dimgray;
                display: block;
                width: 100%; height: 100%;
                line-height: 50px;
                text-align: left;
            }
            .quick_menu>li>a:hover{color: darkgray;}
            #q_back:hover{cursor: pointer;}  /* 사이드바 닫는 화살표 */
            #q_back{
                margin-left: 170px; 
                margin-top: 10px;
                font-size: 30px; font-weight: 600; 
                width: 50px; height: 50px;
                position: fixed;
            }
            #back_arrow{width: 30px; height: 30px; z-index: 20;}  /*화살표 이미지설정*/
            
            
            
            
            
            /* 여기서부터 담당 페이지 스타일 추가하시면 됩니다. */
            
input[type=button], input[type=submit] {
	border: 1px;
	border-radius: 4px;
	background-color: #f56a6a;
	color: #f4f5f9;
	height: 25px;
	margin-top: 20px;
}
     

.thumbnail img{
height : 50px;
width : auto;
}

</style>
<script>
$(function(){
    $("#q_menu_btn").on("click", function(){
        $("#quickmenu").css("transform", "translate(100%, 0px)");
    })
    $("#q_back").on("click", function(){
        $(this).parent().css("transform", "translate(-100%, 0px)");
        $(this).parent().css("transition-duration", "1s");
    })
    
    
    //여기서부터 담당 페이지 스크립트 새로 추가하시면 됩니다!
	$("#back").on("click", function() {
		location.href = 'toProfileList.profile'
	});
    

})
</script>
</head>

<body>

             <!-- header 영역 (맨위에 메뉴바) -->
            <div class="row header">

                <!-- quick menu 버튼 -->
                <div class="q_menu_btn col-2 col-sm-1 col-md-0 d-md-none d-block" id=q_menu_btn>
                    <!--   quickmenu 넣기-->
                    <button class=quickBtn>
                        <div class=quickLine></div>
                        <div class=quickLine></div>
                        <div class=quickLine></div>
                    </button>

                </div>

                <!-- quick menu -->           
                <div class="quickmenu" id="quickmenu">
                    <div id=q_back><img src="resources/image/back.png" id=back_arrow></div>

                    <div class=quick_title>
                        Menu
                        <div class=q_line></div>
                    </div>
                    <div class=quick_menu>
                        <li><a href=search.jsp>법률검색</a><div class=q_m_line></div></li>
                        <li><a href=board.req>의뢰하기</a><div class=q_m_line></div></li>
                        <li><a href=toProfileList.profile>변호사</a><div class=q_m_line></div></li>
                        <li><a href=faqlist.question>Q&A</a></li>
                    </div>
                    <div class=q_b_line></div>
                    <div class=quick_title>
                        Login
                        <div class=q_line></div>
                    </div>
                    <div class=quick_menu>
                    	<c:choose>
                    		<c:when test="${empty sessionScope.clientInfo && empty sessionScope.lawyerInfo}">
                    			<li><a href=login.jsp>로그인</a><div class=q_m_line></div></li>
                    		</c:when>
                    		<c:otherwise>
                    			<li><a href="logout.login">로그아웃</a><div class=q_m_line></div></li>
                    			<li><a href="go.mypage">마이페이지</a></li>
                    		</c:otherwise>
                    	</c:choose>                        
                    </div>
                </div>

                <div class="logo col-2 col-md-3 col-lg-2">
                    <a href=main.jsp><img src="resources/image/lawview.jpg" class="logo"></a>
                </div>

                <div class="navi col-9 col-lg-10 d-md-block d-none">
                    <ul class="nav justify-content-end">
                        <li class="nav-item">
                            <a class="nav-link active" href=search.jsp>법률 검색</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href=board.req>의뢰하기</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href=toProfileList.profile>변호사</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="faqlist.question">Q&A</a>
                        </li>
                        <li class="nav-item">
	                        <c:choose>
	                    		<c:when test="${empty sessionScope.clientInfo && empty sessionScope.lawyerInfo}">
	                    			<a class="nav-link" href=login.jsp>Login</a>
	                    		</c:when>
	                    		<c:otherwise>
	                    			<a class="nav-link" href=logout.login>Logout</a>
	                    		</c:otherwise>
	                    	</c:choose>
                        </li>
                    </ul>
                </div>

            </div>


        <!--      전체 컨테이너 (헤더,푸터 제외)    -->
        <div class=container>

            <!-- contents 영역 (여기에 각자 컨텐츠들 넣으시면 돼요) -->
            <div class=contents>

	<form action=modify.profile?seq=${dto.seq}  method="post" enctype="multipart/form-data">
		<div class="container">

	

			<div class="form-group row">
				<div class="col-sm">
					<input id="title" name="title" class="form-control-plaintext"
						type="text" value=${dto.title}>
				</div>
			</div>

			<div class="form-group">
						<b> ${dto.name}변호사의 전문 분야</b><br>
			  	 <c:forEach var="i" begin="0" step="1" end="14">
				 ${dto.specialty[i]} &nbsp;
				 </c:forEach>
				 		<input type='checkbox' name='specialty' value='이혼' />이혼 &nbsp;
						<input type='checkbox' name='specialty' value='손해배상' />손해배상 &nbsp; 
						<input type='checkbox' name='specialty' value='폭행' />폭행/협박  &nbsp;
						<input type='checkbox' name='specialty' value='가사' />가사기타  &nbsp;
						<input type='checkbox' name='specialty' value='성범죄' />성범죄  &nbsp;
						<input type='checkbox' name='specialty' value='재산범죄' />재산범죄  &nbsp;
						<input type='checkbox' name='specialty' value='수사' />수사  &nbsp;
						<input type='checkbox' name='specialty' value='민사기타' />민사기타&nbsp;<br>
						<input type='checkbox' name='specialty' value='친족' />친족&nbsp;
						<input type='checkbox' name='specialty' value='채권추심' />채권추심&nbsp;
						<input type='checkbox' name='specialty' value='민사소송절차' />민사소송절차&nbsp;
						<input type='checkbox' name='specialty' value='상속' />상속&nbsp;
						<input type='checkbox' name='specialty' value='형사기타' />형사기타&nbsp;
						<input type='checkbox' name='specialty' value='기타법률서비스' />기타법률서비스
				 
				
			</div>
			
			<div class="form-group">
				<textarea class="form-control" name="education"
					id="exampleFormControlTextarea1" rows="10"
					 placeholder="education 수정">${dto.education}</textarea>
			</div>
			
			<div class="form-group">
			<p>프로필 사진</p>
			<div class=thumbnail>
					<img
						src="${pageContext.request.contextPath}/upload/${dto.img}"
						class="card-img" id=profileImg>
						</div>
				<input type=file name="file">
			</div>


	
			<div id="modifyBtn">
					<input type="submit"  id="write" value="수정 완료"> <input type="button"  id="back" value="목록으로">
			</div>

		</div>
	</form>

            </div>  <!-- contents 영역 끝 -->

        </div>  <!--container 끝-->



        <!--     footer 영역      -->
        <div class="row footer">
            <div class="col-12 sponser" style="padding: 0">

            </div>
            <div class="col-12 col-md-5 info1 infotext">
                <br>Copyrightⓒ 2020 Law View Inc. All Rights Reserved.
            </div>
            <div class="col-12 col-md-7 info2 infotext">
                <br>
                <a href=#>이용약관 </a>|
                <a href=#> 개인정보처리방침 </a>| 
                <a href=#> 이메일주소 무단수집 거부 </a>| 
                <a href=#> 정도경영 사이버신문고 </a>| 
                <a href=#> 영상정보처리기기 운영관리 방침 </a>| 
            </div>
            <div class="col-12 col-md-6 info3 infotext">
                <br>
                <a href=main.jsp><img src="resources/image/lawview.jpg" class="doosancompany"></a>
                Law View is operated by LAW VIEW Inc.<br><br>
                <a href=#><img src="resources/image/facebook.jpg" class="linklogo"></a>
                <a href=#><img src="resources/image/twitter.jpg" class="linklogo"></a>
                <a href=#><img src="resources/image/instagram.png" class="linklogo"></a>
                <a href=#><img src="resources/image/youtube.png" class="linklogo"></a>
            </div>
            <div class="col-12 col-md-6 info4 infotext">
                <br>사업자 등록번호 : 851-87-00622  대표자 성명 : 박정수<br>
                   사업자주소 : 서울특별시 중구 남대문로 120 대일빌딩 2F, 3F<br>
                   연락처 : 02-722-0858  개인정보관리책임자 : 김영재
            </div>
        </div>
</body>
</html>

 

'디지털 컨버전스 > Project' 카테고리의 다른 글

부트스트랩 에러  (0) 2020.07.10
[파이널] 이메일 인증 가입 - DB연결  (0) 2020.06.24
[project] 파일 업로드  (0) 2020.05.20
[Project] 원형 썸네일  (0) 2020.05.19
[문제발생] missing node.js  (0) 2020.05.19

멀티파트 인코딩을 해야 파일과 text 구분 가능

싱글턴 패턴으로 바꾸는 것을 추천

 

파일은 데이터베이스에 넣지 않음

파일이 여러개일 경우 : 가변개수, 한 컬럼에 넣기 어려움

 

파일을 저장하기 위한 독자적 테이블 필요

 

파일에 댓글달기 (어디에 연결되는 파일인지)

 

폴더가 존재하지 않는다면 만들어라
일반 리퀘스트로는 멀티파트폼데이터를 꺼낼 수 없음

cos.jar 에서는 MultipartRequest라는 이름, (다른 라이브러리에는 다른 방식)

단순한게 장점이지만 여러개의 파일을 올리는 경우 번거로워진다.

 

스프링프레임 워크에서는 파일업로드용 쉬운 기능 있음

요청객체, 경로, 사이즈, 인코딩, 이름이겹치는경우 처리

데이터베이스 준비 후 실행

 

메세지 시퀀스값이 생성되면서 파일의 parent시퀀스에도 저장해야함

이 파일이 몇번글에 첨부되어있는지 확인 할 수 있도록

Day_06_02_File.zip
0.07MB

--파일 업로드 실습 oracle

select * from messages;
select * from files;
desc messages;
select * from user_sequences;

create SEQUENCE files_seq
start with 1
INCREMENT by 1
NOMAXVALUE
NOCACHE
;

create table files(
seq NUMBER PRIMARY KEY,
sysname VARCHAR2(100),
oriname VARCHAR2(100),
parent_seq NUMBER
);

[문제해결]

<div class="thumbnail-wrapper">
  <div class="thumbnail">
    <div class="thumbnail-centered">
      <img class="thumbnail-img" src="http://image.chosun.com/sitedata/image/201904/10/2019041001881_0.png"/>
    </div>
  </div>
</div>
.thumbnail-wrapper {
  width: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.thumbnail {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
}

.thumbnail-centered {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translate(50%, 50%);
}

.thumbnail-img {
/*   max-width: 100%; */
/*   height: 박스의 height와 같아야 한다. */
  transform: translate(-50%, -50%);
}

1. thumbnail-wrapper는 width를 조절할 수 있는 박스다. 반응형으로 구성한다면 해당 값은 %가 될 것이다.

2. thumbnail은 padding-top을 가지는데, padding은 %로 값을 줄 경우, width의 크기에 비례하는 특성이 있다. 즉 padding-top이 100%면 width의 100%만큼 padding-top이 높아지는 것이다. thumbnail-wrapper에 따로 height를 주지 않았기 때문에, 전체 박스의 크기는 정방형이 된다. 만약 70%로 두면 4:3 비율이 될 것이다.

3. thunbnail-centered는 정방형이 된 박스에 이미지를 위치시키는 역할을 한다. position: absolute 속성과 translate 속성으로 위치를 잡아준다. 

4. thunbnail-img는 마찬가지로 translate로 위치를 잡아준다. 여기서 만약 max-width의 값을 100%로 두면 박스 내에 빈 공간이 남더라도 이미지의 비율은 그대로 유지된다. 해당 값이 없을 경우, 이미지는 중앙만을 보여준다. 이때 height 속성이 중요하다. height 속성은 최상위 박스(thunbnail-wrapper)의 높이가 돼야 한다. 이는 자바스크립트를 사용해 wrapper의 높이를 받아온 뒤 넣어주면 된다.



출처: https://n-log.tistory.com/42 [N-Log]

.box {
    width: 150px;
    height: 150px; 
    border-radius: 70%;
    overflow: hidden;
}
.profile {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profileImg {
	float: right;
	width: 100px;
	height: 100%;
}

.thumbnail {
	
	border-radius: 70%;
	
	position: relative;
	padding-top: 100%;
	overflow: hidden;
}

.thumbnail .centered {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	transform: translate(50%, 50%);
}

.thumbnail .centered img {
	max-width: 100%;
	height: 100%;
	object-fit: cover;
	transform: translate(-50%, -50%);
}

'디지털 컨버전스 > Project' 카테고리의 다른 글

[Project] 데이터베이스에 배열 저장  (0) 2020.05.20
[project] 파일 업로드  (0) 2020.05.20
[문제발생] missing node.js  (0) 2020.05.19
[Project] profile 파트  (0) 2020.05.19
[Project] 이미지 업로드 & 출력  (0) 2020.05.18

?? 왜?

'디지털 컨버전스 > Project' 카테고리의 다른 글

[project] 파일 업로드  (0) 2020.05.20
[Project] 원형 썸네일  (0) 2020.05.19
[Project] profile 파트  (0) 2020.05.19
[Project] 이미지 업로드 & 출력  (0) 2020.05.18
[LawView]  (0) 2020.05.15


 

통합용코드

더보기

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
        <script src="https://code.jquery.com/jquery-3.5.1.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css">
        

        <style>
            *{
                box-sizing: border-box;
                text-align: center;
            }

            /* 전체 틀 설정 (header, contents, footer영역) */
            .container{width: 100%; margin: auto;}
            .header{   /*맨위 고정메뉴*/
                position: fixed; 
                width: 100%; 
                z-index: 5; 
                background-color: white; 
                margin: 0px;
                width: 100%;
            }
            .contents{text-align: center; position: relative; top: 100px; margin: auto;}
            .footer{position: relative; top: 170px; width: 100%; margin: auto;}



            /* header 영역 설정 */
            .q_menu_btn{text-align: left; padding-top: 10px;}  /*퀵메뉴 버튼*/
            .quickBtn{border: 0px solid white; background-color: white; width: 50px; height: 50px;}
            .quickLine{border-bottom: 3px solid #f56a6a; padding: 3px;}
            .logo{width: 200px; padding-top: 10px;}

            .navi{padding: 0px;}
            .nav{height: 100%;}
            .nav-item{line-height: 60px;}
            .nav-link{font-size: 18px; font-weight: 600; color:#f56a6a;}
            .nav-link:hover{color: #f9a5a5;}



            /* footer 영역 */
            .footer {padding: 0;}
            .sponser{border:1px solid lightgray;}
            .info1,.info3{text-align: left;}
            .info2,.info4{text-align: right;}

            .doosancompany{width: 100px;}
            .linklogo{width: 30px;}
            .infotext{font-size: 13px; color: gray;}
            .info2>a{color: black;}



            /* 퀵메뉴 사이드바 설정 */
            .quickmenu{
                width: 230px; height: 100%;
                background-color: #f5f5f5;
                text-align: center;
                position: fixed;
                z-index: 10;
                top: 0px; left: -230px;  /*퀵메뉴 위치*/
                transition-duration: 0.5s;
            }
            .quick_title{  /*사이드바 Menu title 부분*/
                color: black; 
                font-size: 20px; 
                font-weight: 600;
                text-align: left;
                padding-top: 70px;
                padding-left: 30px;
            }
            .q_line{   /* Menu 밑에 빨간줄 */
                border-bottom: 3px solid #f56a6a;
                width: 60px;
            }
            .quick_menu{
                padding-top: 10px;
            }
            .quick_menu>li{
                position: relative;
                width: 100%; height: 50px;
                list-style-type: none;
                padding-left: 30px;
            }
            .q_m_line{   /*사이드메뉴 나누는 회색줄*/
                border: 0.5px solid lightgray; 
                width: 150px;
            }
            .q_b_line{  /*메뉴,로그인 나누는 굵은 회색줄*/
                border: 1px solid lightgray; 
                width: 200px;
                position: relative;
                left: 20px; top: 30px;
                display: none;
            }
            .quick_menu>li>a{  /* 사이드바 메뉴 글씨 */
                position: relative;
                text-decoration: none;
                color: dimgray;
                display: block;
                width: 100%; height: 100%;
                line-height: 50px;
                text-align: left;
            }
            .quick_menu>li>a:hover{color: darkgray;}
            #q_back:hover{cursor: pointer;}  /* 사이드바 닫는 화살표 */
            #q_back{
                margin-left: 170px; 
                margin-top: 10px;
                font-size: 30px; font-weight: 600; 
                width: 50px; height: 50px;
                position: fixed;
            }
            #back_arrow{width: 30px; height: 30px; z-index: 20;}  /*화살표 이미지설정*/
            
            
            
            
            
            /* 여기서부터 담당 페이지 스타일 추가하시면 됩니다. */
            
            
            
            
        </style>


        <script>
            $(function(){
                $("#q_menu_btn").on("click", function(){
                    $("#quickmenu").css("transform", "translate(100%, 0px)");
                })
                $("#q_back").on("click", function(){
                    $(this).parent().css("transform", "translate(-100%, 0px)");
                    $(this).parent().css("transition-duration", "1s");
                })
                
                
                //여기서부터 담당 페이지 스크립트 새로 추가하시면 됩니다!
                
                
                

            })
        </script>
    </head>



    <body>

        <!-- header 영역 (맨위에 메뉴바) -->
        <div class="row header">

            <!-- quick menu 버튼 -->
            <div class="q_menu_btn col-2 col-sm-1 col-md-0 d-md-none d-block" id=q_menu_btn>
                <!--   quickmenu 넣기-->
                <button class=quickBtn>
                    <div class=quickLine></div>
                    <div class=quickLine></div>
                    <div class=quickLine></div>
                </button>

            </div>

            <!-- quick menu -->           
            <div class="quickmenu" id="quickmenu">
                <div id=q_back><img src="resources/image/back.png" id=back_arrow></div>

                <div class=quick_title>
                    Menu
                    <div class=q_line></div>
                </div>
                <div class=quick_menu>
                    <li><a href=search.jsp>법률검색</a><div class=q_m_line></div></li>
                    <li><a href=request.jsp>의뢰하기</a><div class=q_m_line></div></li>
                    <li><a href=profileList.jsp>변호사</a></li><div class=q_m_line></div></li>
                    <li><a href=faqlist.question>Q&A</a></li>
                </div>
                <div class=q_b_line></div>
                <div class=quick_title>
                    Login
                    <div class=q_line></div>
                </div>
                <div class=quick_menu>
                    <li><a href=login.jsp>로그인</a><div class=q_m_line></div></li>
                    <li><a href=mypage.jsp>마이페이지</a></li>
                </div>
            </div>

            <div class="logo col-2 col-md-3 col-lg-2">
                <a href=main.jsp><img src="resources/image/lawview.jpg" class="logo"></a>
            </div>

            <div class="navi col-9 col-lg-10 d-md-block d-none">
                <ul class="nav justify-content-end">
                    <li class="nav-item">
                        <a class="nav-link active" href=search.jsp>법률 검색</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href=request.jsp>의뢰하기</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href=profileList.jsp>변호사</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="faqlist.question">Q&A</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href=login.jsp>Login</a>
                    </li>
                </ul>
            </div>

        </div>


        <!--      전체 컨테이너 (헤더,푸터 제외)    -->
        <div class=container>

            <!-- contents 영역 (여기에 각자 컨텐츠들 넣으시면 돼요) -->
            <div class=contents>




                


            </div>  <!-- contents 영역 끝 -->

        </div>  <!--container 끝-->



        <!--     footer 영역      -->
        <div class="row footer">
            <div class="col-12 sponser" style="padding: 0">

            </div>
            <div class="col-12 col-md-5 info1 infotext">
                <br>Copyrightⓒ 2020 Law View Inc. All Rights Reserved.
            </div>
            <div class="col-12 col-md-7 info2 infotext">
                <br>
                <a href=#>이용약관 </a>|
                <a href=#> 개인정보처리방침 </a>| 
                <a href=#> 이메일주소 무단수집 거부 </a>| 
                <a href=#> 정도경영 사이버신문고 </a>| 
                <a href=#> 영상정보처리기기 운영관리 방침 </a>| 
            </div>
            <div class="col-12 col-md-6 info3 infotext">
                <br>
                <a href=main.jsp><img src="resources/image/lawview.jpg" class="doosancompany"></a>
                Law View is operated by LAW VIEW Inc.<br><br>
                <a href=#><img src="resources/image/facebook.jpg" class="linklogo"></a>
                <a href=#><img src="resources/image/twitter.jpg" class="linklogo"></a>
                <a href=#><img src="resources/image/instagram.png" class="linklogo"></a>
                <a href=#><img src="resources/image/youtube.png" class="linklogo"></a>
            </div>
            <div class="col-12 col-md-6 info4 infotext">
                <br>사업자 등록번호 : 851-87-00622  대표자 성명 : 박정수<br>
                   사업자주소 : 서울특별시 중구 남대문로 120 대일빌딩 2F, 3F<br>
                   연락처 : 02-722-0858  개인정보관리책임자 : 김영재
            </div>
        </div>


    </body>
</html>

 

 

SQL

create table member2(
id varchar(20) PRIMARY key,
pw varchar(128) not null,
name varchar(20) not null,
phone varchar(20),
email varchar(50),
zipcode varchar(7),
address1 varchar(100),
address2 varchar(100)
);

 


profileList.jsp : 프론트엔드 통합 적용

더보기

#p_board 스타일중 border가 없거나 너무 얇으면 무한스크롤 동작 안함?

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
	integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
	crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script
	src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
	integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
	crossorigin="anonymous"></script>
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet"
	href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css">
<style>
* {
	box-sizing: border-box;
	text-align: center;
}

/* 전체 틀 설정 (header, contents, footer영역) */
.container {
	width: 100%;
	margin: auto;
}

.header {
	/*맨위 고정메뉴*/
	position: fixed;
	width: 100%;
	z-index: 5;
	background-color: white;
	margin: 0px;
	width: 100%;
}

.contents {
	text-align: center;
	position: relative;
	top: 100px;
	margin: auto;
}

.footer {
	position: relative;
	top: 170px;
	width: 100%;
	margin: auto;
}

/* header 영역 설정 */
.q_menu_btn {
	text-align: left;
	padding-top: 10px;
}

/*퀵메뉴 버튼*/
.quickBtn {
	border: 0px solid white;
	background-color: white;
	width: 50px;
	height: 50px;
}

.quickLine {
	border-bottom: 3px solid #f56a6a;
	padding: 3px;
}

.logo {
	width: 200px;
	padding-top: 10px;
}

.navi {
	padding: 0px;
}

.nav {
	height: 100%;
}

.nav-item {
	line-height: 60px;
}

.nav-link {
	font-size: 18px;
	font-weight: 600;
	color: #f56a6a;
}

.nav-link:hover {
	color: #f9a5a5;
}

/* footer 영역 */
.footer {
	padding: 0;
}

.sponser {
	border: 1px solid lightgray;
}

.info1, .info3 {
	text-align: left;
}

.info2, .info4 {
	text-align: right;
}

.doosancompany {
	width: 100px;
}

.linklogo {
	width: 30px;
}

.infotext {
	font-size: 13px;
	color: gray;
}

.info2>a {
	color: black;
}

/* 퀵메뉴 사이드바 설정 */
.quickmenu {
	width: 230px;
	height: 100%;
	background-color: #f5f5f5;
	text-align: center;
	position: fixed;
	z-index: 10;
	top: 0px;
	left: -230px;
	/*퀵메뉴 위치*/
	transition-duration: 0.5s;
}

.quick_title {
	/*사이드바 Menu title 부분*/
	color: black;
	font-size: 20px;
	font-weight: 600;
	text-align: left;
	padding-top: 70px;
	padding-left: 30px;
}

.q_line {
	/* Menu 밑에 빨간줄 */
	border-bottom: 3px solid #f56a6a;
	width: 60px;
}

.quick_menu {
	padding-top: 10px;
}

.quick_menu>li {
	position: relative;
	width: 100%;
	height: 50px;
	list-style-type: none;
	padding-left: 30px;
}

.q_m_line {
	/*사이드메뉴 나누는 회색줄*/
	border: 0.5px solid lightgray;
	width: 150px;
}

.q_b_line {
	/*메뉴,로그인 나누는 굵은 회색줄*/
	border: 1px solid lightgray;
	width: 200px;
	position: relative;
	left: 20px;
	top: 30px;
	display: none;
}

.quick_menu>li>a {
	/* 사이드바 메뉴 글씨 */
	position: relative;
	text-decoration: none;
	color: dimgray;
	display: block;
	width: 100%;
	height: 100%;
	line-height: 50px;
	text-align: left;
}

.quick_menu>li>a:hover {
	color: darkgray;
}

#q_back:hover {
	cursor: pointer;
}

/* 사이드바 닫는 화살표 */
#q_back {
	margin-left: 170px;
	margin-top: 10px;
	font-size: 30px;
	font-weight: 600;
	width: 50px;
	height: 50px;
	position: fixed;
}

#back_arrow {
	width: 30px;
	height: 30px;
	z-index: 20;
}

/*화살표 이미지설정*/

/* 여기서부터 담당 페이지 스타일 추가하시면 됩니다. */
#p_board {
	width: 600px;
	height: 500px;
	margin: auto;
	border: 1px solid gray;
	overflow-y: auto;
	-ms-overflow-style: none; /*스크롤바 숨기기 - IE and Edge */
	scrollbar-width: none; /* 스크롤바 숨기기 - Firefox */
}

#p_board::-webkit-scrollbar {
	display: none; /* 스크롤바 숨기기 - Chrome, Safari, Opera*/
}

.article {
	float: left;
	height: 100px;
	width: 100%;
	text-align: center;
	background-color: #f5f5f5;
	margin-bottom :10px;

}

.title {
	float: left;
	width: 80%;
	height: 50%;
	text-align: left;
	line-height: 50px;
}

.name {
	float: left;
	width: 80%;
	height: 25%;
	text-align: left;
	line-height: 25px;
	text-size: 25px;
}

.phone {
	color: #f56a6a;
	float: left;
	width: 80%;
	height: 25%;
	text-align: left;
	line-height: 25px;
}

.profileImg {
	float: right;
	width: 100px;
	height: 100%;
}

.thumbnail {
	
	border-radius: 70%;
	
	position: relative;
	padding-top: 100%;
	overflow: hidden;
}

.thumbnail .centered {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	transform: translate(50%, 50%);
}

.thumbnail .centered img {
	max-width: 100%;
	height: 100%;
	object-fit: cover;
	transform: translate(-50%, -50%);
}

input[type=button], input[type=submit] {
	border: 1px;
	border-radius: 4px;
	background-color: #f56a6a;
	color: #f4f5f9;
	height: 25px;
	margin-top: 20px;
}
</style>

<script>


		var pageNo = 1;
		$(function() {
			$.ajax({
						url : "profileListAjax.profile",
						data : {
							cpage : pageNo++
						},
						dataType : "json"
					})
					.done(
							function(resp) {
								console.log(resp);
								for (var i = 0; i < resp.length; i++) {

									console.log(resp[i].seq);

		var line = $("<div>");
									line.addClass("article")

									var title = $("<div>");
									title.addClass("title");
									title.append(resp[i].title);

									var name = $("<div>");
									name.addClass("name");
									name.append("<a href='toProfile.profile?seq="
													+ resp[i].seq
													+ "'>"
													+ resp[i].name + "</a>");

									var phone = $("<div>");
									phone.addClass("phone");
									phone.append("☎ " + resp[i].office_phone);

									var profileImg = $("<div>");
									profileImg.addClass("profileImg");
									if(resp[i].img == null){
										profileImg.append("<div class=thumbnail><div class=centered><img src='${pageContext.request.contextPath}/upload/lawyer.png'></div></div>")

									}else{
										profileImg.append("<div class=thumbnail><div class=centered><img src='${pageContext.request.contextPath}/upload/"+resp[i].img+"''></div></div>")

									}



									line.append(name);
									line.append(profileImg);
									line.append(title);
									line.append(phone);
									
									$("#p_board").append(line);
								}
							});
		
		
					                $("#q_menu_btn").on("click", function(){
					                    $("#quickmenu").css("transform", "translate(100%, 0px)");
					                })
					                $("#q_back").on("click", function(){
					                    $(this).parent().css("transform", "translate(-100%, 0px)");
					                    $(this).parent().css("transition-duration", "1s");
					                })
					                
		
					                
					                $("#p_board").on("scroll", function() {
			var board = document.getElementById("p_board");
			if (board.offsetHeight + board.scrollTop > board.scrollHeight) {
				loadData();
			}
		})
		function loadData() {
			$.ajax({
				url : "profileListAjax.profile",
				data : {
					cpage : pageNo++
				},
				dataType : "json"
			}).done(
					function(resp) {
						console.log(resp);
						for (var i = 0; i < resp.length; i++) {

							var line = $("<div >");
							line.addClass("article")

							var title = $("<div>");
							title.addClass("title");
							title.append(resp[i].title);

							var name = $("<div>");
							name.addClass("name");
							name.append("<a href='toProfile.profile?seq="
									+ resp[i].seq + "'>" + resp[i].name
									+ "</a>");

							var phone = $("<div>");
							phone.addClass("phone");
							phone.append("☎ " + resp[i].office_phone);
							
							
							var profileImg = $("<div>");
							profileImg.addClass("profileImg");
							if(resp[i].img == null){
								profileImg.append("<div class=thumbnail><div class=centered><img src='${pageContext.request.contextPath}/upload/lawyer.png'></div></div>")

							}else{
								profileImg.append("<div class=thumbnail><div class=centered><img src='${pageContext.request.contextPath}/upload/"+resp[i].img+"''></div></div>")

							}

							line.append(name);
							line.append(profileImg);
							line.append(title);
							line.append(phone);

							$("#p_board").append(line);
						}
					});

		}

			$("#writeProfile").on("click", function() {
				location.href = "profileWrite.jsp";
			})
					                
		})

		
	</script>

</head>
<body>


	<!-- header 영역 (맨위에 메뉴바) -->
	<div class="row header">

		<!-- quick menu 버튼 -->
		<div class="q_menu_btn col-2 col-sm-1 col-md-0 d-md-none d-block"
			id=q_menu_btn>
			<!--   quickmenu 넣기-->
			<button class=quickBtn>
				<div class=quickLine></div>
				<div class=quickLine></div>
				<div class=quickLine></div>
			</button>

		</div>

		<!-- quick menu -->
		<div class="quickmenu" id="quickmenu">
			<div id=q_back>
				<img src="resources/image/back.png" id=back_arrow>
			</div>

			<div class=quick_title>
				Menu
				<div class=q_line></div>
			</div>
			<div class=quick_menu>
				<li><a href=search.jsp>법률검색</a>
					<div class=q_m_line></div></li>
				<li><a href=request.jsp>의뢰하기</a>
					<div class=q_m_line></div></li>
				<li><a href=profileList.jsp>변호사</a></li>
				<div class=q_m_line></div>
				</li>
				<li><a href=faqlist.question>Q&A</a></li>
			</div>
			<div class=q_b_line></div>
			<div class=quick_title>
				Login
				<div class=q_line></div>
			</div>
			<div class=quick_menu>
				<li><a href=login.jsp>로그인</a>
					<div class=q_m_line></div></li>
				<li><a href=mypage.jsp>마이페이지</a></li>
			</div>
		</div>

		<div class="logo col-2 col-md-3 col-lg-2">
			<a href=main.jsp><img src="resources/image/lawview.jpg"
				class="logo"></a>
		</div>

		<div class="navi col-9 col-lg-10 d-md-block d-none">
			<ul class="nav justify-content-end">
				<li class="nav-item"><a class="nav-link active" href=search.jsp>법률
						검색</a></li>
				<li class="nav-item"><a class="nav-link" href=request.jsp>의뢰하기</a>
				</li>
				<li class="nav-item"><a class="nav-link" href=profileList.jsp>변호사</a>
				</li>
				<li class="nav-item"><a class="nav-link"
					href="faqlist.question">Q&A</a></li>
				<li class="nav-item"><a class="nav-link" href=login.jsp>Login</a>
				</li>
			</ul>
		</div>

	</div>


	<!--      전체 컨테이너 (헤더,푸터 제외)    -->
	<div class=container>

		<!-- contents 영역 (여기에 각자 컨텐츠들 넣으시면 돼요) -->
		<div class=contents>


			<div id="p_board"></div>


			<div class="col-12" align=right>
				<input type=button id=writeProfile value="프로필 작성">
			</div>


		</div>
		<!-- contents 영역 끝 -->

	</div>
	<!--container 끝-->



	<!--     footer 영역      -->
	<div class="row footer">
		<div class="col-12 sponser" style="padding: 0"></div>
		<div class="col-12 col-md-5 info1 infotext">
			<br>Copyrightⓒ 2020 Law View Inc. All Rights Reserved.
		</div>
		<div class="col-12 col-md-7 info2 infotext">
			<br> <a href=#>이용약관 </a>| <a href=#> 개인정보처리방침 </a>| <a href=#>
				이메일주소 무단수집 거부 </a>| <a href=#> 정도경영 사이버신문고 </a>| <a href=#> 영상정보처리기기
				운영관리 방침 </a>|
		</div>
		<div class="col-12 col-md-6 info3 infotext">
			<br> <a href=main.jsp><img src="resources/image/lawview.jpg"
				class="doosancompany"></a> Law View is operated by LAW VIEW Inc.<br>
			<br> <a href=#><img src="resources/image/facebook.jpg"
				class="linklogo"></a> <a href=#><img
				src="resources/image/twitter.jpg" class="linklogo"></a> <a href=#><img
				src="resources/image/instagram.png" class="linklogo"></a> <a
				href=#><img src="resources/image/youtube.png" class="linklogo"></a>
		</div>
		<div class="col-12 col-md-6 info4 infotext">
			<br>사업자 등록번호 : 851-87-00622 대표자 성명 : 박정수<br> 사업자주소 : 서울특별시
			중구 남대문로 120 대일빌딩 2F, 3F<br> 연락처 : 02-722-0858 개인정보관리책임자 : 김영재
		</div>
	</div>


</body>
</html>

 

 

 

profile.jsp 

더보기

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>LawView</title>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script
	src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script
	src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>

<style>
* {
	box-sizing: border-box;
	text-align: center;
}

/* 전체 틀 설정 (header, contents, footer영역) */
.container {
	width: 100%;
	margin: auto;
}

.header {
	/*맨위 고정메뉴*/
	position: fixed;
	width: 100%;
	z-index: 5;
	background-color: white;
	margin: 0px;
	width: 100%;
}

.contents {
	text-align: center;
	position: relative;
	top: 100px;
	margin: auto;
}

.footer {
	position: relative;
	top: 170px;
	width: 100%;
	margin: auto;
}

/* header 영역 설정 */
.q_menu_btn {
	text-align: left;
	padding-top: 10px;
}

/*퀵메뉴 버튼*/
.quickBtn {
	border: 0px solid white;
	background-color: white;
	width: 50px;
	height: 50px;
}

.quickLine {
	border-bottom: 3px solid #f56a6a;
	padding: 3px;
}

.logo {
	width: 200px;
	padding-top: 10px;
}

.navi {
	padding: 0px;
}

.nav {
	height: 100%;
}

.nav-item {
	line-height: 60px;
}

.nav-link {
	font-size: 18px;
	font-weight: 600;
	color: #f56a6a;
}

.nav-link:hover {
	color: #f9a5a5;
}

/* footer 영역 */
.footer {
	padding: 0;
}

.sponser {
	border: 1px solid lightgray;
}

.info1, .info3 {
	text-align: left;
}

.info2, .info4 {
	text-align: right;
}

.doosancompany {
	width: 100px;
}

.linklogo {
	width: 30px;
}

.infotext {
	font-size: 13px;
	color: gray;
}

.info2>a {
	color: black;
}

/* 퀵메뉴 사이드바 설정 */
.quickmenu {
	width: 230px;
	height: 100%;
	background-color: #f5f5f5;
	text-align: center;
	position: fixed;
	z-index: 10;
	top: 0px;
	left: -230px;
	/*퀵메뉴 위치*/
	transition-duration: 0.5s;
}

.quick_title {
	/*사이드바 Menu title 부분*/
	color: black;
	font-size: 20px;
	font-weight: 600;
	text-align: left;
	padding-top: 70px;
	padding-left: 30px;
}

.q_line {
	/* Menu 밑에 빨간줄 */
	border-bottom: 3px solid #f56a6a;
	width: 60px;
}

.quick_menu {
	padding-top: 10px;
}

.quick_menu>li {
	position: relative;
	width: 100%;
	height: 50px;
	list-style-type: none;
	padding-left: 30px;
}

.q_m_line {
	/*사이드메뉴 나누는 회색줄*/
	border: 0.5px solid lightgray;
	width: 150px;
}

.q_b_line {
	/*메뉴,로그인 나누는 굵은 회색줄*/
	border: 1px solid lightgray;
	width: 200px;
	position: relative;
	left: 20px;
	top: 30px;
	display: none;
}

.quick_menu>li>a {
	/* 사이드바 메뉴 글씨 */
	position: relative;
	text-decoration: none;
	color: dimgray;
	display: block;
	width: 100%;
	height: 100%;
	line-height: 50px;
	text-align: left;
}

.quick_menu>li>a:hover {
	color: darkgray;
}

#q_back:hover {
	cursor: pointer;
}

/* 사이드바 닫는 화살표 */
#q_back {
	margin-left: 170px;
	margin-top: 10px;
	font-size: 30px;
	font-weight: 600;
	width: 50px;
	height: 50px;
	position: fixed;
}

#back_arrow {
	width: 30px;
	height: 30px;
	z-index: 20;
}

/*화살표 이미지설정*/

/* 여기서부터 담당 페이지 스타일 추가하시면 됩니다. */

@font-face {
	font-family: "barunGothic";
	src: url("NanumBarunGothic.ttf") format("truetype");
	font-style: normal;
	font-weight: normal;
}

* {
	font-family: "barunGothic";
	font-size: 12px;
	box-sizing: border-box;
}

.container {
	border-radius: 3px;
	width:750px;
	background-color: #f4f5f9;
	color: #252c41;
	margin: auto;
	border: 1px solid #dddfe6;
}

.row:first-child>.col-12 {
	border-radius: 3px;
	padding: 20px;
}

.row>div {
	margin-top: 1px;
	background-color: white;
	padding: 10px;
}

.comment {
	padding: 0px;
}

#box1 {
	width: 100%;
	border: 1px dotted black;
	height: 100%;
	float: left;
	overflow-y: auto;
}

#box2 {
	border-radius: 5px;
	height: 100%;
	text-align: center;
}

#send {
	border: 1px solid #ffffff;
	border-radius: 5px;
	color: #ffffff;
}

.list {
	border-radius: 10px;
	margin: auto;
	word-wrap: break-word;
	word-break: break-all;
}

input[type=button], input[type=submit] {
	border: 1px;
	border-radius: 4px;
	background-color: #f56a6a;
	color: #f4f5f9;
	height: 20px;
}

.cmt {
	postion: relative;
	padding: 15px;
	background-color: #f4f5f9;
}

.cmt>input {
	position: absolute;
	right: 10px;
	top: 10px;
	background-color: #252c41;
}
</style>
<script>
	$(function() {
		$("#back").on("click", function() {
			location.href = "toProfileList.profile";
		})

		$("#delete").on("click", function() {
			var result = confirm("정말 삭제하시겠습니까?");
			if (result) {
				location.href = "delete.profile?seq=" + ${dto.seq};
			}
		})

		$("#modify").on("click", function() {
			location.href = "toProfileModify.profile?seq=" + ${dto.seq};
		})
	})
</script>
</head>
<body>
	<!-- header 영역 (맨위에 메뉴바) -->
	<div class="row header">

		<!-- quick menu 버튼 -->
		<div class="q_menu_btn col-2 col-sm-1 col-md-0 d-md-none d-block"
			id=q_menu_btn>
			<!--   quickmenu 넣기-->
			<button class=quickBtn>
				<div class=quickLine></div>
				<div class=quickLine></div>
				<div class=quickLine></div>
			</button>

		</div>

		<!-- quick menu -->
		<div class="quickmenu" id="quickmenu">
			<div id=q_back>
				<img src="resources/image/back.png" id=back_arrow>
			</div>

			<div class=quick_title>
				Menu
				<div class=q_line></div>
			</div>
			<div class=quick_menu>
				<li><a href=search.jsp>법률검색</a>
					<div class=q_m_line></div></li>
				<li><a href=request.jsp>의뢰하기</a>
					<div class=q_m_line></div></li>
				<li><a href=profileList.jsp>변호사</a></li>
				<div class=q_m_line></div>
				</li>
				<li><a href=faqlist.question>Q&A</a></li>
			</div>
			<div class=q_b_line></div>
			<div class=quick_title>
				Login
				<div class=q_line></div>
			</div>
			<div class=quick_menu>
				<li><a href=login.jsp>로그인</a>
					<div class=q_m_line></div></li>
				<li><a href=mypage.jsp>마이페이지</a></li>
			</div>
		</div>

		<div class="logo col-2 col-md-3 col-lg-2">
			<a href=main.jsp><img src="resources/image/lawview.jpg"
				class="logo"></a>
		</div>
		


		<div class="navi col-9 col-lg-10 d-md-block d-none">
			<ul class="nav justify-content-end">
				<li class="nav-item"><a class="nav-link active" href=search.jsp>법률
						검색</a></li>
				<li class="nav-item"><a class="nav-link" href=request.jsp>의뢰하기</a>
				</li>
				<li class="nav-item"><a class="nav-link" href=profileList.jsp>변호사</a>
				</li>
				<li class="nav-item"><a class="nav-link"
					href="faqlist.question">Q&A</a></li>
				<li class="nav-item"><a class="nav-link" href=login.jsp>Login</a>
				</li>
			</ul>
		</div>

	</div>
				<!-- contents 영역 (여기에 각자 컨텐츠들 넣으시면 돼요) -->
		<div class=contents>

	<div class="container">
		<div class="row">
		<div class="col-12" align=center>
			<div class="card bg-dark text-white">
				<c:if test="${!empty dto.img}">
					<img
						src="http://localhost${pageContext.request.contextPath}/upload/${dto.img}"
						class="card-img" id=profileImg>

				</c:if>
				<c:if test="${empty dto.img}">
					<img
						src="http://localhost${pageContext.request.contextPath}/upload/lawyer.png"
						class="card-img" id=profileImg>
				</c:if>


				<div class="card-img-overlay">
					<h5 class="card-title">${dto.name}</h5>
					<p class="card-text">${dto.title}</p>
				</div>
			</div>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=center>
				<b> ${dto.name} 변호사</b>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=center>
				<b> ${dto.title}</b>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=center>
				<b>법무법인 ${dto.office_name}</b>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=center>
				<b>오피스 번호 ${dto.office_phone}</b>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=left>
				<b> ${dto.name}변호사의 전문 분야을 확인하세요</b><br> <b>${dto.specialty}</b>
			</div>
		</div>

		<div class="row">
			<div class="col-12" align=left>
				<b> ${dto.name}변호사의 법률 활동을 확인하세요</b><br> <b>${dto.education}</b>
			</div>
		</div>

		<div class="row">
			<div class="col-12"></div>
		</div>
		<div class="row">
			<!--
			<c:forEach var="f" items="${fileList}">
				<div class="col-12">첨부파일 : ${f.oriFileName}</div>
			</c:forEach>
			  -->
		</div>

		<c:forEach var="cmt" items="${list}">
			<div class="row">
				<div class="col-12 list"></div>
			</div>
		</c:forEach>

		<div class="row">
			<c:choose>
				<c:when test="${dto.id == sessionScope.id}">
					<div class="col-12" align=right>
						<input type=button id=back value="프로필 목록으로"> <input
							type=button id=delete value="프로필 삭제"> <input type=button
							id=modify value="프로필 수정">
					</div>
				</c:when>

				<%-- admin.id 일 때도 버튼이 보이도록 수정 : admin.id는 개발자가 결정?		
				<c:when test="${admin.id == sessionScope.id}">
					<div class="col-12" align=right>
						<input type=button id=back value="프로필 목록으로"> <input
							type=button id=delete value="프로필 삭제"> <input type=button
							id=modify value="프로필 수정">
					</div>
				</c:when>				
--%>

				<c:otherwise>
					<div class="col-12" align=right>
						<input type=button id=back value="프로필 목록으로"> <input
							type=button id=reservation value="예약하기">
						<!--
			원래 조건에 안맞으면 안보여야 하는 버튼들이지만 테스트 용으로 노출
			  -->
						<input type=button id=delete value="(임시)프로필 삭제"> <input
							type=button id=modify value="(임시)프로필 수정">

					</div>
				</c:otherwise>
			</c:choose>
		</div>
	</div>
		</div>

	<!--     footer 영역      -->
	<div class="row footer">
		<div class="col-12 sponser" style="padding: 0"></div>
		<div class="col-12 col-md-5 info1 infotext">
			<br>Copyrightⓒ 2020 Law View Inc. All Rights Reserved.
		</div>
		<div class="col-12 col-md-7 info2 infotext">
			<br> <a href=#>이용약관 </a>| <a href=#> 개인정보처리방침 </a>| <a href=#>
				이메일주소 무단수집 거부 </a>| <a href=#> 정도경영 사이버신문고 </a>| <a href=#> 영상정보처리기기
				운영관리 방침 </a>|
		</div>
		<div class="col-12 col-md-6 info3 infotext">
			<br> <a href=main.jsp><img src="resources/image/lawview.jpg"
				class="doosancompany"></a> Law View is operated by LAW VIEW Inc.<br>
			<br> <a href=#><img src="resources/image/facebook.jpg"
				class="linklogo"></a> <a href=#><img
				src="resources/image/twitter.jpg" class="linklogo"></a> <a href=#><img
				src="resources/image/instagram.png" class="linklogo"></a> <a
				href=#><img src="resources/image/youtube.png" class="linklogo"></a>
		</div>
		<div class="col-12 col-md-6 info4 infotext">
			<br>사업자 등록번호 : 851-87-00622 대표자 성명 : 박정수<br> 사업자주소 : 서울특별시
			중구 남대문로 120 대일빌딩 2F, 3F<br> 연락처 : 02-722-0858 개인정보관리책임자 : 김영재
		</div>
	</div>

</body>
</html>

 

 

profileWrite.jsp

더보기
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script
	src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script
	src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
 <style>
            *{
                box-sizing: border-box;
                text-align: center;
            }

            /* 전체 틀 설정 (header, contents, footer영역) */
            .container{width: 100%; margin: auto;}
            .header{   /*맨위 고정메뉴*/
                position: fixed; 
                width: 100%; 
                z-index: 5; 
                background-color: white; 
                margin: 0px;
                width: 100%;
            }
            .contents{text-align: center; position: relative; top: 100px; margin: auto;}
            .footer{position: relative; top: 170px; width: 100%; margin: auto;}



            /* header 영역 설정 */
            .q_menu_btn{text-align: left; padding-top: 10px;}  /*퀵메뉴 버튼*/
            .quickBtn{border: 0px solid white; background-color: white; width: 50px; height: 50px;}
            .quickLine{border-bottom: 3px solid #f56a6a; padding: 3px;}
            .logo{width: 200px; padding-top: 10px;}

            .navi{padding: 0px;}
            .nav{height: 100%;}
            .nav-item{line-height: 60px;}
            .nav-link{font-size: 18px; font-weight: 600; color:#f56a6a;}
            .nav-link:hover{color: #f9a5a5;}



            /* footer 영역 */
            .footer {padding: 0;}
            .sponser{border:1px solid lightgray;}
            .info1,.info3{text-align: left;}
            .info2,.info4{text-align: right;}

            .doosancompany{width: 100px;}
            .linklogo{width: 30px;}
            .infotext{font-size: 13px; color: gray;}
            .info2>a{color: black;}



            /* 퀵메뉴 사이드바 설정 */
            .quickmenu{
                width: 230px; height: 100%;
                background-color: #f5f5f5;
                text-align: center;
                position: fixed;
                z-index: 10;
                top: 0px; left: -230px;  /*퀵메뉴 위치*/
                transition-duration: 0.5s;
            }
            .quick_title{  /*사이드바 Menu title 부분*/
                color: black; 
                font-size: 20px; 
                font-weight: 600;
                text-align: left;
                padding-top: 70px;
                padding-left: 30px;
            }
            .q_line{   /* Menu 밑에 빨간줄 */
                border-bottom: 3px solid #f56a6a;
                width: 60px;
            }
            .quick_menu{
                padding-top: 10px;
            }
            .quick_menu>li{
                position: relative;
                width: 100%; height: 50px;
                list-style-type: none;
                padding-left: 30px;
            }
            .q_m_line{   /*사이드메뉴 나누는 회색줄*/
                border: 0.5px solid lightgray; 
                width: 150px;
            }
            .q_b_line{  /*메뉴,로그인 나누는 굵은 회색줄*/
                border: 1px solid lightgray; 
                width: 200px;
                position: relative;
                left: 20px; top: 30px;
                display: none;
            }
            .quick_menu>li>a{  /* 사이드바 메뉴 글씨 */
                position: relative;
                text-decoration: none;
                color: dimgray;
                display: block;
                width: 100%; height: 100%;
                line-height: 50px;
                text-align: left;
            }
            .quick_menu>li>a:hover{color: darkgray;}
            #q_back:hover{cursor: pointer;}  /* 사이드바 닫는 화살표 */
            #q_back{
                margin-left: 170px; 
                margin-top: 10px;
                font-size: 30px; font-weight: 600; 
                width: 50px; height: 50px;
                position: fixed;
            }
            #back_arrow{width: 30px; height: 30px; z-index: 20;}  /*화살표 이미지설정*/
            
            
            
            
            
            /* 여기서부터 담당 페이지 스타일 추가하시면 됩니다. */
            
input[type=button], input[type=submit] {
	border: 1px;
	border-radius: 4px;
	background-color: #f56a6a;
	color: #f4f5f9;
	height: 25px;
	margin-top: 20px;
}
            
        </style>

<script>
$(function(){
    $("#q_menu_btn").on("click", function(){
        $("#quickmenu").css("transform", "translate(100%, 0px)");
    })
    $("#q_back").on("click", function(){
        $(this).parent().css("transform", "translate(-100%, 0px)");
        $(this).parent().css("transition-duration", "1s");
    })
    
    
    //여기서부터 담당 페이지 스크립트 새로 추가하시면 됩니다!
	$("#back").on("click", function() {
		location.href = 'toProfileList.profile'
	});
    
    

})
</script>
</head>

<body>

 <!-- header 영역 (맨위에 메뉴바) -->
        <div class="row header">

            <!-- quick menu 버튼 -->
            <div class="q_menu_btn col-2 col-sm-1 col-md-0 d-md-none d-block" id=q_menu_btn>
                <!--   quickmenu 넣기-->
                <button class=quickBtn>
                    <div class=quickLine></div>
                    <div class=quickLine></div>
                    <div class=quickLine></div>
                </button>

            </div>

            <!-- quick menu -->           
            <div class="quickmenu" id="quickmenu">
                <div id=q_back><img src="resources/image/back.png" id=back_arrow></div>

                <div class=quick_title>
                    Menu
                    <div class=q_line></div>
                </div>
                <div class=quick_menu>
                    <li><a href=search.jsp>법률검색</a><div class=q_m_line></div></li>
                    <li><a href=request.jsp>의뢰하기</a><div class=q_m_line></div></li>
                    <li><a href=profileList.jsp>변호사</a></li><div class=q_m_line></div></li>
                    <li><a href=faqlist.question>Q&A</a></li>
                </div>
                <div class=q_b_line></div>
                <div class=quick_title>
                    Login
                    <div class=q_line></div>
                </div>
                <div class=quick_menu>
                    <li><a href=login.jsp>로그인</a><div class=q_m_line></div></li>
                    <li><a href=mypage.jsp>마이페이지</a></li>
                </div>
            </div>

            <div class="logo col-2 col-md-3 col-lg-2">
                <a href=main.jsp><img src="resources/image/lawview.jpg" class="logo"></a>
            </div>

            <div class="navi col-9 col-lg-10 d-md-block d-none">
                <ul class="nav justify-content-end">
                    <li class="nav-item">
                        <a class="nav-link active" href=search.jsp>법률 검색</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href=request.jsp>의뢰하기</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href=profileList.jsp>변호사</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="faqlist.question">Q&A</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href=login.jsp>Login</a>
                    </li>
                </ul>
            </div>

        </div>


        <!--      전체 컨테이너 (헤더,푸터 제외)    -->
        <div class=container>

            <!-- contents 영역 (여기에 각자 컨텐츠들 넣으시면 돼요) -->
            <div class=contents>



	<form action=write.profile method="post" enctype="multipart/form-data">
		<div class="container">

		

			<div class="form-group row">
				<div class="col-sm">
					<input id="title" name="title" class="form-control-plaintext"
						type="text" placeholder="제목을 입력하세요.">
				</div>
			</div>

			<div class="form-group">
				<textarea class="form-control" name="specialty"
					id="exampleFormControlTextarea1" rows="10"
					placeholder="specialty를 입력하세요."></textarea>
			</div>

			<div class="form-group">
				<textarea class="form-control" name="education"
					id="exampleFormControlTextarea1" rows="10"
					placeholder="education를 입력하세요."></textarea>
			</div>

			<div class="form-group">
				<input type=file name="file">
			</div>

			<div id="writeBtn">
					<input type="submit"  id="write" value="작성 완료"> <input type="button"  id="back" value="목록으로">
			</div>

		</div>
	</form>

	
	
            </div>  <!-- contents 영역 끝 -->

        </div>  <!--container 끝-->



        <!--     footer 영역      -->
        <div class="row footer">
            <div class="col-12 sponser" style="padding: 0">

            </div>
            <div class="col-12 col-md-5 info1 infotext">
                <br>Copyrightⓒ 2020 Law View Inc. All Rights Reserved.
            </div>
            <div class="col-12 col-md-7 info2 infotext">
                <br>
                <a href=#>이용약관 </a>|
                <a href=#> 개인정보처리방침 </a>| 
                <a href=#> 이메일주소 무단수집 거부 </a>| 
                <a href=#> 정도경영 사이버신문고 </a>| 
                <a href=#> 영상정보처리기기 운영관리 방침 </a>| 
            </div>
            <div class="col-12 col-md-6 info3 infotext">
                <br>
                <a href=main.jsp><img src="resources/image/lawview.jpg" class="doosancompany"></a>
                Law View is operated by LAW VIEW Inc.<br><br>
                <a href=#><img src="resources/image/facebook.jpg" class="linklogo"></a>
                <a href=#><img src="resources/image/twitter.jpg" class="linklogo"></a>
                <a href=#><img src="resources/image/instagram.png" class="linklogo"></a>
                <a href=#><img src="resources/image/youtube.png" class="linklogo"></a>
            </div>
            <div class="col-12 col-md-6 info4 infotext">
                <br>사업자 등록번호 : 851-87-00622  대표자 성명 : 박정수<br>
                   사업자주소 : 서울특별시 중구 남대문로 120 대일빌딩 2F, 3F<br>
                   연락처 : 02-722-0858  개인정보관리책임자 : 김영재
            </div>
        </div>
	
</body>
</html>

 

 

profileModify.jsp

더보기
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script
	src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script
	src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script>
	
</script>
<style>

            *{
                box-sizing: border-box;
                text-align: center;
            }

            /* 전체 틀 설정 (header, contents, footer영역) */
            .container{width: 100%; margin: auto;}
            .header{   /*맨위 고정메뉴*/
                position: fixed; 
                width: 100%; 
                z-index: 5; 
                background-color: white; 
                margin: 0px;
                width: 100%;
            }
            .contents{text-align: center; position: relative; top: 100px; margin: auto;}
            .footer{position: relative; top: 170px; width: 100%; margin: auto;}



            /* header 영역 설정 */
            .q_menu_btn{text-align: left; padding-top: 10px;}  /*퀵메뉴 버튼*/
            .quickBtn{border: 0px solid white; background-color: white; width: 50px; height: 50px;}
            .quickLine{border-bottom: 3px solid #f56a6a; padding: 3px;}
            .logo{width: 200px; padding-top: 10px;}

            .navi{padding: 0px;}
            .nav{height: 100%;}
            .nav-item{line-height: 60px;}
            .nav-link{font-size: 18px; font-weight: 600; color:#f56a6a;}
            .nav-link:hover{color: #f9a5a5;}



            /* footer 영역 */
            .footer {padding: 0;}
            .sponser{border:1px solid lightgray;}
            .info1,.info3{text-align: left;}
            .info2,.info4{text-align: right;}

            .doosancompany{width: 100px;}
            .linklogo{width: 30px;}
            .infotext{font-size: 13px; color: gray;}
            .info2>a{color: black;}



            /* 퀵메뉴 사이드바 설정 */
            .quickmenu{
                width: 230px; height: 100%;
                background-color: #f5f5f5;
                text-align: center;
                position: fixed;
                z-index: 10;
                top: 0px; left: -230px;  /*퀵메뉴 위치*/
                transition-duration: 0.5s;
            }
            .quick_title{  /*사이드바 Menu title 부분*/
                color: black; 
                font-size: 20px; 
                font-weight: 600;
                text-align: left;
                padding-top: 70px;
                padding-left: 30px;
            }
            .q_line{   /* Menu 밑에 빨간줄 */
                border-bottom: 3px solid #f56a6a;
                width: 60px;
            }
            .quick_menu{
                padding-top: 10px;
            }
            .quick_menu>li{
                position: relative;
                width: 100%; height: 50px;
                list-style-type: none;
                padding-left: 30px;
            }
            .q_m_line{   /*사이드메뉴 나누는 회색줄*/
                border: 0.5px solid lightgray; 
                width: 150px;
            }
            .q_b_line{  /*메뉴,로그인 나누는 굵은 회색줄*/
                border: 1px solid lightgray; 
                width: 200px;
                position: relative;
                left: 20px; top: 30px;
                display: none;
            }
            .quick_menu>li>a{  /* 사이드바 메뉴 글씨 */
                position: relative;
                text-decoration: none;
                color: dimgray;
                display: block;
                width: 100%; height: 100%;
                line-height: 50px;
                text-align: left;
            }
            .quick_menu>li>a:hover{color: darkgray;}
            #q_back:hover{cursor: pointer;}  /* 사이드바 닫는 화살표 */
            #q_back{
                margin-left: 170px; 
                margin-top: 10px;
                font-size: 30px; font-weight: 600; 
                width: 50px; height: 50px;
                position: fixed;
            }
            #back_arrow{width: 30px; height: 30px; z-index: 20;}  /*화살표 이미지설정*/
            
            
            
            
            
            /* 여기서부터 담당 페이지 스타일 추가하시면 됩니다. */
            
input[type=button], input[type=submit] {
	border: 1px;
	border-radius: 4px;
	background-color: #f56a6a;
	color: #f4f5f9;
	height: 25px;
	margin-top: 20px;
}
     

.thumbnail img{
height : 50px;
width : auto;
}

</style>
<script>
$(function(){
    $("#q_menu_btn").on("click", function(){
        $("#quickmenu").css("transform", "translate(100%, 0px)");
    })
    $("#q_back").on("click", function(){
        $(this).parent().css("transform", "translate(-100%, 0px)");
        $(this).parent().css("transition-duration", "1s");
    })
    
    
    //여기서부터 담당 페이지 스크립트 새로 추가하시면 됩니다!
	$("#back").on("click", function() {
		location.href = 'toProfileList.profile'
	});
    

})
</script>
</head>

<body>

 <!-- header 영역 (맨위에 메뉴바) -->
        <div class="row header">

            <!-- quick menu 버튼 -->
            <div class="q_menu_btn col-2 col-sm-1 col-md-0 d-md-none d-block" id=q_menu_btn>
                <!--   quickmenu 넣기-->
                <button class=quickBtn>
                    <div class=quickLine></div>
                    <div class=quickLine></div>
                    <div class=quickLine></div>
                </button>

            </div>

            <!-- quick menu -->           
            <div class="quickmenu" id="quickmenu">
                <div id=q_back><img src="resources/image/back.png" id=back_arrow></div>

                <div class=quick_title>
                    Menu
                    <div class=q_line></div>
                </div>
                <div class=quick_menu>
                    <li><a href=search.jsp>법률검색</a><div class=q_m_line></div></li>
                    <li><a href=request.jsp>의뢰하기</a><div class=q_m_line></div></li>
                    <li><a href=profileList.jsp>변호사</a></li><div class=q_m_line></div></li>
                    <li><a href=faqlist.question>Q&A</a></li>
                </div>
                <div class=q_b_line></div>
                <div class=quick_title>
                    Login
                    <div class=q_line></div>
                </div>
                <div class=quick_menu>
                    <li><a href=login.jsp>로그인</a><div class=q_m_line></div></li>
                    <li><a href=mypage.jsp>마이페이지</a></li>
                </div>
            </div>

            <div class="logo col-2 col-md-3 col-lg-2">
                <a href=main.jsp><img src="resources/image/lawview.jpg" class="logo"></a>
            </div>

            <div class="navi col-9 col-lg-10 d-md-block d-none">
                <ul class="nav justify-content-end">
                    <li class="nav-item">
                        <a class="nav-link active" href=search.jsp>법률 검색</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href=request.jsp>의뢰하기</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href=profileList.jsp>변호사</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="faqlist.question">Q&A</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href=login.jsp>Login</a>
                    </li>
                </ul>
            </div>

        </div>


        <!--      전체 컨테이너 (헤더,푸터 제외)    -->
        <div class=container>

            <!-- contents 영역 (여기에 각자 컨텐츠들 넣으시면 돼요) -->
            <div class=contents>

	<form action=modify.profile?seq=${dto.seq}  method="post" enctype="multipart/form-data">
		<div class="container">

	

			<div class="form-group row">
				<div class="col-sm">
					<input id="title" name="title" class="form-control-plaintext"
						type="text" value=${dto.title}>
				</div>
			</div>

			<div class="form-group">
				<textarea class="form-control" name="specialty"
					id="exampleFormControlTextarea1" rows="10"
					 placeholder="specialty 수정">${dto.specialty}</textarea>
			</div>
			
			<div class="form-group">
				<textarea class="form-control" name="education"
					id="exampleFormControlTextarea1" rows="10"
					 placeholder="education 수정">${dto.education}</textarea>
			</div>
			
			<div class="form-group">
			<p>프로필 사진</p>
			<div class=thumbnail>
					<img
						src="${pageContext.request.contextPath}/upload/${dto.img}"
						class="card-img" id=profileImg>
						</div>
				<input type=file name="file">
			</div>


	
			<div id="modifyBtn">
					<input type="submit"  id="write" value="수정 완료"> <input type="button"  id="back" value="목록으로">
			</div>

		</div>
	</form>

            </div>  <!-- contents 영역 끝 -->

        </div>  <!--container 끝-->



        <!--     footer 영역      -->
        <div class="row footer">
            <div class="col-12 sponser" style="padding: 0">

            </div>
            <div class="col-12 col-md-5 info1 infotext">
                <br>Copyrightⓒ 2020 Law View Inc. All Rights Reserved.
            </div>
            <div class="col-12 col-md-7 info2 infotext">
                <br>
                <a href=#>이용약관 </a>|
                <a href=#> 개인정보처리방침 </a>| 
                <a href=#> 이메일주소 무단수집 거부 </a>| 
                <a href=#> 정도경영 사이버신문고 </a>| 
                <a href=#> 영상정보처리기기 운영관리 방침 </a>| 
            </div>
            <div class="col-12 col-md-6 info3 infotext">
                <br>
                <a href=main.jsp><img src="resources/image/lawview.jpg" class="doosancompany"></a>
                Law View is operated by LAW VIEW Inc.<br><br>
                <a href=#><img src="resources/image/facebook.jpg" class="linklogo"></a>
                <a href=#><img src="resources/image/twitter.jpg" class="linklogo"></a>
                <a href=#><img src="resources/image/instagram.png" class="linklogo"></a>
                <a href=#><img src="resources/image/youtube.png" class="linklogo"></a>
            </div>
            <div class="col-12 col-md-6 info4 infotext">
                <br>사업자 등록번호 : 851-87-00622  대표자 성명 : 박정수<br>
                   사업자주소 : 서울특별시 중구 남대문로 120 대일빌딩 2F, 3F<br>
                   연락처 : 02-722-0858  개인정보관리책임자 : 김영재
            </div>
        </div>
</body>
</html>

 

 

ProfileDAO.java

더보기
package lv.backend.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;

import lv.backend.dto.ProfileDTO;
import lv.backend.statics.Configuration;


public class ProfileDAO {

	private Connection getConnection() throws Exception{
		Context ctx = new InitialContext();
		DataSource ds = (DataSource)ctx.lookup("java:comp/env/dbcp"); //경로
		return ds.getConnection();
	}

	public int insertProfile(ProfileDTO dto) throws Exception{

		String sql = "insert into profile_board values(profile_board_seq.nextval,?,?,?,?,?,?,?,?,?,?)";
		try(Connection con = this.getConnection();	
				PreparedStatement pstat = con.prepareStatement(sql)){
			pstat.setString(1, dto.getName());
			pstat.setString(2, dto.getTitle());
			pstat.setString(3, dto.getPhone());
			pstat.setString(4, dto.getSpecialty());
			pstat.setString(5, dto.getOffice_name());
			pstat.setString(6, dto.getOffice_phone());
			pstat.setString(7, dto.getTest());
			pstat.setString(8, dto.getEducation());
			pstat.setString(9, dto.getId());
			pstat.setString(10, dto.getImg());

			int result = pstat.executeUpdate();
			System.out.println("insertProfile 결과 : "+result);
			con.commit();
			return result;
		}
	}

	//전체 프로필 리스트 불러오기
	public List<ProfileDTO> selectAll() throws Exception{
		String sql = "select * from profile_board order by 1";
		List<ProfileDTO> result = new ArrayList<>();
		try(Connection con = this.getConnection();
				PreparedStatement pstat = con.prepareStatement(sql);
				ResultSet rs = pstat.executeQuery(); ){
			while(rs.next()) {
				int seq = rs.getInt("seq");
				String name = rs.getString("name");
				String title = rs.getString("title");
				String phone = rs.getString("phone");
				String specialty = rs.getString("specialty");
				String office_name = rs.getString("office_name");
				String office_phone = rs.getString("office_phone");
				String test = rs.getString("test");
				String education = rs.getString("education");
				String id = rs.getString("id");

				ProfileDTO dto = new ProfileDTO(seq,name,title,phone,specialty,office_name,office_phone,test,education,id);
				result.add(dto);
			}
			return result;
		}
	}

	// 전체를 불러오지 말고 일부만 불러오는 경우
	public List<ProfileDTO> selectByPageNo(int cpage) throws Exception{

		int start = cpage * Configuration.recordCountPerpage - (Configuration.naviCountPerPage-1);
		int end = start + (Configuration.recordCountPerpage-1);

		String sql = "select * from (select profile_board.*, row_number() over(order by seq desc) rnum from profile_board) where rnum between ? and ?";
		List<ProfileDTO> list = new ArrayList<>();	
		try(Connection con = this.getConnection();
				PreparedStatement pstat = con.prepareStatement(sql);
				){
			pstat.setInt(1, start);
			pstat.setInt(2, end);

			try(ResultSet rs = pstat.executeQuery();){
				while(rs.next()) {

					int seq = rs.getInt("seq");
					String name = rs.getString("name");
					String title = rs.getString("title");
					String phone = rs.getString("phone");
					String specialty = rs.getString("specialty");
					String office_name = rs.getString("office_name");
					String office_phone = rs.getString("office_phone");
					String test = rs.getString("test");
					String education = rs.getString("education");
					String id = rs.getString("id");
					String img = rs.getString("img");

					ProfileDTO dto = new ProfileDTO(seq,name,title,phone,specialty,office_name,office_phone,test,education,id,img);
					list.add(dto);
				}
				return list;
			}
		}
	}

	public String getpageNavi(int currentPage) throws Exception {
		//총 몇개의 글이 있는가? 한페이지에 몇개의 글을 보여줄 것인가?
		int recordTotalCount = this.getArticleCount(); // 총 게시물의 개수
		int recordCountPerPage = 10;// 한 페이지에 게시글 몇개를 보여줄 것인가?
		int naviCountPerPage = 10; //한 페이지에 네비게이터 몇개를 보여줄 것인가?
		int pageTotalCount = 0; // 전체 페이지의 개수
		if(recordTotalCount % recordCountPerPage > 0) {
			pageTotalCount = recordTotalCount / recordCountPerPage + 1;
			// 게시글 개수를 페이지당 게시글로 나누어 나머지 값이 있으면 한페이지를 더한다.
			// ex) 147개의 글이 있다면 10글 짜리 14페이지 + 7글짜리 1페이지 -> 총 15페이지 필요
		}else {
			pageTotalCount = recordTotalCount / recordCountPerPage;
			// 게시글 개수를 페이지당 게시글로 나누어 나머지 값이 없으면 더할 필요없다.
			// ex) 140개의 글이 있다면 10글 짜리 14페이지로 끝.
		}
		//현재 내가 위치한 페이지 번호, 1~pageTotalCount까지의 범위를 가진다.
		if(currentPage < 1) {
			currentPage = 1;
		}else if(currentPage > pageTotalCount) {
			currentPage = pageTotalCount;
		} // 공격자가 currentPage 값을 변조할 경우에 대한 보안 코드
		int startNavi = (currentPage - 1) / Configuration.naviCountPerPage * Configuration.naviCountPerPage + 1 ;
		int endNavi = startNavi + naviCountPerPage - 1 ;
		if(endNavi > pageTotalCount) {
			endNavi = pageTotalCount;
		}
		boolean needPrev = true;
		boolean needNext = true;
		if(startNavi == 1) {needPrev = false;}
		if(endNavi == pageTotalCount) {needNext = false;}

		StringBuilder sb = new StringBuilder(); // 리턴할 스트링 조합
		if(needPrev) {
			sb.append("<li><a href='toProfileListView.profile?cpage="+(startNavi-1)+"'><</a></li>");
		}
		for (int i = startNavi;i <= endNavi;i++) {
			sb.append("<li><a href='toProfileListView.profile?cpage="+i+"'>"+i+"</a></li>");
		}
		if(needNext) {
			sb.append("<li><a href='toProfileListView.profile?cpage="+(endNavi+1)+"'>></a></li>");
		}
		return sb.toString();
	}

	public int getArticleCount() throws Exception{
		String sql = "select count(*) from profile_board";
		try(Connection con = this.getConnection();	
				PreparedStatement pstat = con.prepareStatement(sql);
				ResultSet rs = pstat.executeQuery();){
			rs.next(); // 안쓰면 헤더를 가르키는 상태
			return rs.getInt(1);
		}
	}

	public ProfileDTO selectBySeq(int seq) throws Exception{
		String sql = "select * from profile_board where seq=?";
		try(
				Connection con = this.getConnection();
				PreparedStatement pstat = con.prepareStatement(sql);
				){
			pstat.setInt(1, seq);
			try(
					ResultSet rs = pstat.executeQuery();					
					){
				ProfileDTO dto = null;
				if(rs.next()) {
					String name = rs.getString("name");
					String title = rs.getString("title");
					String phone = rs.getString("phone");
					String specialty = rs.getString("specialty");
					String office_name = rs.getString("office_name");
					String office_phone = rs.getString("office_phone");
					String test = rs.getString("test");
					String education = rs.getString("education");
					String id = rs.getString("id");
					String img = rs.getString("img");
					dto = new ProfileDTO(seq,name,title,phone,specialty,office_name,office_phone,test,education,id,img);
				}
				return dto;	
			}
		}
	}

	public int deleteBySeq(int seq) throws Exception{
		String sql = "delete from profile_board where seq=?";
		try(
				Connection con = this.getConnection();
				PreparedStatement pstat = con.prepareStatement(sql);
				){
			pstat.setInt(1, seq);
			int result = pstat.executeUpdate();
			con.commit();
			return result;
		}
	}

	public int updateBySeq(ProfileDTO dto) throws Exception{


		if(dto.getImg() !=null) {
			String sql = "update profile_board set title=?, specialty=?, education=?, img=? where seq =?";
			try(
					Connection con = this.getConnection();
					PreparedStatement pstat = con.prepareStatement(sql);
					){
				pstat.setString(1, dto.getTitle());
				pstat.setString(2, dto.getSpecialty());
				pstat.setString(3, dto.getEducation());
				pstat.setString(4, dto.getImg());
				pstat.setInt(5, dto.getSeq());
				int result = pstat.executeUpdate();
				con.commit();
				return result;
			}

		}else { //이미지를 새로 업로드 하지 않은 경우 기존 이미지 유지
			String sql = "update profile_board set title=?, specialty=?, education=? where seq =?";
			try(
					Connection con = this.getConnection();
					PreparedStatement pstat = con.prepareStatement(sql);
					){
				pstat.setString(1, dto.getTitle());
				pstat.setString(2, dto.getSpecialty());
				pstat.setString(3, dto.getEducation());
				pstat.setInt(4, dto.getSeq());
				int result = pstat.executeUpdate();
				con.commit();
				return result;
			}


		}

	}
}

 

ProfileDTO.java

더보기
package lv.backend.dto;


public class ProfileDTO {

	private int seq;
	private String name; 
	private String title;
	private String phone;
	private String specialty;
	private String office_name;
	private String office_phone;
	private String test;
	private String education;
	private String id;
	private String img;
	
	public ProfileDTO() {
		super();
	}
	
	
	public ProfileDTO(String name, String title, String phone, String specialty, String office_name,
			String office_phone, String test, String education, String id, String img) {
		super();
		this.name = name;
		this.title = title;
		this.phone = phone;
		this.specialty = specialty;
		this.office_name = office_name;
		this.office_phone = office_phone;
		this.test = test;
		this.education = education;
		this.id = id;
		this.img = img;
	}


	public ProfileDTO(int seq, String name, String title, String phone, String specialty, String office_name,
			String office_phone, String test, String education, String id) {
		super();
		this.seq = seq;
		this.name = name;
		this.title = title;
		this.phone = phone;
		this.specialty = specialty;
		this.office_name = office_name;
		this.office_phone = office_phone;
		this.test = test;
		this.education = education;
		this.id = id;
	}
	
	public ProfileDTO(String name, String title, String phone, String specialty, String office_name,
			String office_phone, String test, String education, String id) {
		super();
		this.name = name;
		this.title = title;
		this.phone = phone;
		this.specialty = specialty;
		this.office_name = office_name;
		this.office_phone = office_phone;
		this.test = test;
		this.education = education;
		this.id = id;
	}
	
	public ProfileDTO(int seq, String name, String title, String phone, String specialty, String office_name,
			String office_phone, String test, String education, String id, String img) {
		super();
		this.seq = seq;
		this.name = name;
		this.title = title;
		this.phone = phone;
		this.specialty = specialty;
		this.office_name = office_name;
		this.office_phone = office_phone;
		this.test = test;
		this.education = education;
		this.id = id;
		this.img = img;
	}

	public String getImg() {
		return img;
	}

	public void setImg_location(String img) {
		this.img = img;
	}


	public int getSeq() {
		return seq;
	}
	public void setSeq(int seq) {
		this.seq = seq;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getSpecialty() {
		return specialty;
	}
	public void setSpecialty(String specialty) {
		this.specialty = specialty;
	}
	public String getOffice_name() {
		return office_name;
	}
	public void setOffice_name(String office_name) {
		this.office_name = office_name;
	}
	public String getOffice_phone() {
		return office_phone;
	}
	public void setOffice_phone(String office_phone) {
		this.office_phone = office_phone;
	}
	public String getTest() {
		return test;
	}
	public void setTest(String test) {
		this.test = test;
	}
	public String getEducation() {
		return education;
	}
	public void setEducation(String education) {
		this.education = education;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	
	
}

 

 

 

 

ProfileController

더보기
package lv.backend.controller;

import java.io.File;
import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.gson.Gson;
import com.oreilly.servlet.MultipartRequest;
import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;

import lv.backend.dao.FileDAO;
import lv.backend.dao.ProfileDAO;
import lv.backend.dto.ProfileDTO;


@WebServlet("*.profile")
public class ProfileController extends HttpServlet {


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

	    request.setCharacterEncoding("utf8");
	    response.setCharacterEncoding("utf8");
	    
	    
		String contextPath = request.getContextPath();
		String requestURI = request.getRequestURI();
		String cmd = requestURI.substring(contextPath.length());
		ProfileDAO dao = new ProfileDAO();
		
		String uploadPath = request.getServletContext().getRealPath("upload");
		File uploadPathF = new File(uploadPath);
		if(!uploadPathF.exists()) { //경로가 없다면
			uploadPathF.mkdir();    //만들어라
		}
		
		System.out.println("저장 경로 : "+ uploadPath );
		
		try {
			
			if(cmd.contentEquals("/write.profile")) {
//-------------- 나중에 병합시 lawyerDTO 변호사 회원가입 dto 이름 확인할것!
//				LawyerDTO dto = (LawyerDTO)request.getSession().getAttribute("loginInfo");
				// request getSession으로 꺼낼 수 있나? 꺼낼 이름이 "loginInfo"인가?
				// profileWrite.jsp의 입력값 + Session에 담긴 lawyerDTO
//				String name = dto.getName(); 
//				String title = request.getParameter("title");
//				String phone = dto.getPhone();
//				String specialty = request.getParameter("specialty");
//				String office_name = dto.getOffice_name();
//				String office_phone = dto.getOffice_phone();
//				String test = dto.getTest();
//				String education = request.getParameter("education");
//				String id = dto.getId();
								
				
				MultipartRequest multi = new MultipartRequest(
						request,
						uploadPath,
						1024*1024*10, //사이즈
						"utf8", //인코딩
						new DefaultFileRenamePolicy() // 이름 겹치면 덮어씌워짐 -> 중복 방지 필요 : 처리코드를 직접 쓸수도 있지만, 디폴트값으로
						);
				String sysName = multi.getFilesystemName("file");
				String oriName = multi.getOriginalFileName("file");
				System.out.println("저장된 사진 이름 : "+ sysName);
				System.out.println("원래 사진 이름 : "+ oriName);
				
				
				String name = "이름"; 
				String title = multi.getParameter("title");
				String phone = "번호";
				String specialty = multi.getParameter("specialty");
				String office_name = "사무소명";
				String office_phone = "사무소번호";
				String test = "출신시험";
				String education = multi.getParameter("education");
				String id = "아이디";
				String img = sysName; 
						
				
				System.out.println("title : " + title);
				System.out.println("specialty : " + specialty);
				System.out.println("education : " + education);
				System.out.println("img(저장된 이름) : " + img);
				//여기가 문제
				int result = dao.insertProfile(new ProfileDTO(name,title,phone,specialty,office_name,office_phone,test,education,id,img));
				
				if(result>0) {
					response.sendRedirect("profileList.jsp");
				}else {
					response.sendRedirect("error.jsp");
				}
				
						

		
			}else if(cmd.contentEquals("/toProfileList.profile")) {
	

				
				response.sendRedirect("profileList.jsp");

				
			}else if(cmd.contentEquals("/profileListAjax.profile")){
				
				int cpage = Integer.parseInt(request.getParameter("cpage"));
				try {
					List<ProfileDTO> list = dao.selectByPageNo(cpage);
					//클라이언트는 JSON으로 받는게 좋음 : List<BoardDTO>를 JSON으로
					String respArr = new Gson().toJson(list);
					response.getWriter().append(respArr);
				
					//프로필 수정 / 삭제 기능 미구현
				} catch (Exception e) {
					e.printStackTrace(); //에러나면 어쩌피 fail로 가기 때문에 여기서 따로 에러페이지 보낼 필요없음
					response.sendError(500); //에러메세지를 응답으로 보내겠
				}
				
			}else if(cmd.contentEquals("/toProfile.profile")) {
//				System.out.println("toProfile.profile 컨트롤러 실행 : "+request.getQueryString().substring(4) );
//				System.out.println(request.getParameter("seq"));
				
				int seq = Integer.parseInt(request.getParameter("seq"));
				System.out.println("받아온 시퀀스 확인용 : "+seq); // 받아온 시퀀스 확인용
				ProfileDTO dto = dao.selectBySeq(seq);

				request.setAttribute("dto", dto);

//				List<FileDTO> fileList = dao.selectFileBySeq(seq);
//				request.setAttribute("fileList", fileList);
				
				RequestDispatcher rd = request.getRequestDispatcher("profile.jsp");
				rd.forward(request, response);
				
			}else if(cmd.contentEquals("/delete.profile")) {
				
				int seq = Integer.parseInt(request.getParameter("seq"));
				dao.deleteBySeq(seq);
				response.sendRedirect("toProfileList.profile");
				
			}else if(cmd.contentEquals("/toProfileModify.profile")) {
				// 프로필에서 수정하기 버튼을 누르면 
				// 해당 글seq로 프로필dto를 새로 찾아서
				// 수정하기 페이지로 이동
				int seq = Integer.parseInt(request.getParameter("seq"));
				System.out.println("modify할 seq : "+seq); // 받아온 시퀀스 확인용

				ProfileDTO dto = dao.selectBySeq(seq);
				request.setAttribute("dto", dto);
				RequestDispatcher rd = request.getRequestDispatcher("profileModify.jsp");
				rd.forward(request, response);
				
			}else if(cmd.contentEquals("/modify.profile")) {
				
				int seq = Integer.parseInt(request.getParameter("seq"));
				// 변호사 테이블에서 불러오기?
				// 아니면 여기서도 수정? 외래키는?
				MultipartRequest multi = new MultipartRequest(
						request,
						uploadPath,
						1024*1024*10, //사이즈
						"utf8", //인코딩
						new DefaultFileRenamePolicy() // 이름 겹치면 덮어씌워짐 -> 중복 방지 필요 : 처리코드를 직접 쓸수도 있지만, 디폴트값으로
						);
				String sysName = multi.getFilesystemName("file");
				String oriName = multi.getOriginalFileName("file");
				System.out.println("저장된 사진 이름 : "+ sysName);
				System.out.println("원래 사진 이름 : "+ oriName);
				
				String name = "이름"; 
				String title = multi.getParameter("title");
				String phone = "번호";
				String specialty = multi.getParameter("specialty");
				String office_name = "사무소명";
				String office_phone = "사무소번호";
				String test = "출신시험";
				String education = multi.getParameter("education");
				String id = "아이디";
				String img = sysName; 
				
				int result = dao.updateBySeq(new ProfileDTO(seq,name,title,phone,specialty,office_name,office_phone,test,education,id,img));
				response.sendRedirect("toProfile.profile?seq="+seq);
				
			}
			
		}catch(Exception e) {
			
		}
		
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}

profile관련 JSP만 0519.zip
0.01MB

'디지털 컨버전스 > Project' 카테고리의 다른 글

[Project] 원형 썸네일  (0) 2020.05.19
[문제발생] missing node.js  (0) 2020.05.19
[Project] 이미지 업로드 & 출력  (0) 2020.05.18
[LawView]  (0) 2020.05.15
[LawView] 프로필 쓰기 오류  (0) 2020.05.14

+ Recent posts