Skip to content

Commit

Permalink
refactor : BindException 예외처리 후 html에 에러메시지 출력
Browse files Browse the repository at this point in the history
  • Loading branch information
DOEKYONG committed Apr 14, 2023
1 parent e3ca408 commit c483e58
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 72 deletions.
6 changes: 6 additions & 0 deletions src/main/resources/templates/qna/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@
<div class="form-group">
<label for="title">제목</label>
<input type="text" class="form-control" id="title" name="title" placeholder="제목"/>
{{#title}}
{{title}}
{{/title}}
</div>
<div class="form-group">
<label for="contents">내용</label>
<textarea name="contents" id="contents" rows="5" class="form-control"></textarea>
{{#contents}}
{{contents}}
{{/contents}}
</div>
<button type="submit" class="btn btn-success clearfix pull-right">질문하기</button>
<div class="clearfix" />
Expand Down
10 changes: 8 additions & 2 deletions src/main/resources/templates/qna/update_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@
<!-- </div>-->
<div class="form-group">
<label for="title">제목</label>
<input type="text" class="form-control" id="title" name="title" value="{{title}}" placeholder="제목"/>
<input type="text" class="form-control" id="title" name="title" value="{{setTitle}}" placeholder="제목"/>
{{#title}}
{{title}}
{{/title}}
</div>
<div class="form-group">
<label for="contents">내용</label>
<textarea name="contents" id="contents" rows="5" class="form-control">{{contents}}</textarea>
<textarea name="contents" id="contents" rows="5" class="form-control">{{setContent}}</textarea>
{{#contents}}
{{contents}}
{{/contents}}
</div>
<button type="submit" class="btn btn-success clearfix pull-right">질문하기</button>
<div class="clearfix" />
Expand Down
12 changes: 12 additions & 0 deletions src/main/resources/templates/user/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,30 @@
<div class="form-group">
<label for="userId">사용자 아이디</label>
<input class="form-control" id="userId" name="userId" placeholder="User ID">
{{#userId}}
{{userId}}
{{/userId}}
</div>
<div class="form-group">
<label for="password">비밀번호</label>
<input type="password" class="form-control" id="password" name="password" placeholder="Password">
{{#password}}
{{password}}
{{/password}}
</div>
<div class="form-group">
<label for="name">이름</label>
<input class="form-control" id="name" name="name" placeholder="Name">
{{#name}}
{{name}}
{{/name}}
</div>
<div class="form-group">
<label for="email">이메일</label>
<input type="email" class="form-control" id="email" name="email" placeholder="Email">
{{#email}}
{{email}}
{{/email}}
</div>
<button type="submit" class="btn btn-success clearfix pull-right">회원가입</button>
<div class="clearfix" />
Expand Down
72 changes: 2 additions & 70 deletions src/main/resources/templates/user/login_failed.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,79 +5,15 @@
<meta charset="utf-8">
<title>SLiPP Java Web Programming</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="../../static/css/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="../../static/css/styles.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-fixed-top header">
<div class="col-md-12">
<div class="navbar-header">

<a href="../index.html" class="navbar-brand">SLiPP</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse1">
<i class="glyphicon glyphicon-search"></i>
</button>

</div>
<div class="collapse navbar-collapse" id="navbar-collapse1">
<form class="navbar-form pull-left">
<div class="input-group" style="max-width:470px;">
<input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">
<div class="input-group-btn">
<button class="btn btn-default btn-primary" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-bell"></i></a>
<ul class="dropdown-menu">
<li><a href="https://slipp.net" target="_blank">SLiPP</a></li>
<li><a href="https://facebook.com" target="_blank">Facebook</a></li>
</ul>
</li>
<li><a href="ml"><i class="glyphicon glyphicon-user"></i></a></li>
</ul>
</div>
</div>
</nav>
<div class="navbar navbar-default" id="subnav">
<div class="col-md-12">
<div class="navbar-header">
<a href="#" style="margin-left:15px;" class="navbar-btn btn btn-default btn-plus dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-home" style="color:#dd1111;"></i> Home <small><i class="glyphicon glyphicon-chevron-down"></i></small></a>
<ul class="nav dropdown-menu">
<li><a href=".html"><i class="glyphicon glyphicon-user" style="color:#1111dd;"></i> Profile</a></li>
<li class="nav-divider"></li>
<li><a href="#"><i class="glyphicon glyphicon-cog" style="color:#dd1111;"></i> Settings</a></li>
</ul>

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse2">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse2">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="../index.html">Posts</a></li>
<li><a href="tml" role="button">로그인</a></li>
<li><a href="form.html" role="button">회원가입</a></li>
<li><a href="#" role="button">로그아웃</a></li>
<li><a href="#" role="button">개인정보수정</a></li>
</ul>
</div>
</div>
</div>
{{>layout/header}}

<div class="container" id="main">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-default content-main">
<div class="alert alert-danger" role="alert">아이디 또는 비밀번호가 틀립니다. 다시 로그인 해주세요.</div>
<form name="question" method="post" action="/templates/user/login">
<form name="question" method="post" action="/user/signIn">
<div class="form-group">
<label for="userId">사용자 아이디</label>
<input class="form-control" id="userId" name="userId" placeholder="User ID">
Expand All @@ -93,9 +29,5 @@
</div>
</div>

<!-- script references -->
<script src="../../static/js/jquery-2.2.0.min.js"></script>
<script src="../../static/js/bootstrap.min.js"></script>
<script src="../../static/js/scripts.js"></script>
</body>
</html>
15 changes: 15 additions & 0 deletions src/main/resources/templates/user/update_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,38 @@
<div class="form-group">
<label for="userId">사용자 아이디</label>
<input class="form-control" id="userId" name="userId" placeholder="User ID" value="{{user.userId}}" readonly>
{{#userId}}
{{userId}}
{{/userId}}
</div>
<div class="form-group">
<label for="password">비밀번호</label>
<input type="password" class="form-control" id="password" name="password" placeholder="Password">
{{#password}}
{{password}}
{{/password}}
</div>
<div class="form-group">
<label for="newPassword">새로운 비밀번호</label>
<input type="password" class="form-control" id="newPassword" name="newPassword"
placeholder="Password">
{{#newPassword}}
{{newPassword}}
{{/newPassword}}
</div>
<div class="form-group">
<label for="name">이름</label>
<input class="form-control" id="name" name="name" placeholder="Name" value="{{user.name}}">
{{#name}}
{{name}}
{{/name}}
</div>
<div class="form-group">
<label for="email">이메일</label>
<input type="email" class="form-control" id="email" name="email" placeholder="Email" value="{{user.email}}">
{{#email}}
{{email}}
{{/email}}
</div>
<button type="submit" class="btn btn-success clearfix pull-right">수정하기</button>
<div class="clearfix" />
Expand Down

0 comments on commit c483e58

Please sign in to comment.