Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: I can't modify the board(controller has a problem)

  1. #1
    Junior Member
    Join Date
    Feb 2018
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I can't modify the board(controller has a problem)

    package com.truffle.everyair.service;
     
    import java.util.List;
     
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Service;
     
    import com.truffle.everyair.db.NoticeBoardDao;
    import com.truffle.everyair.db.Noticeboard;
    @Service
    public class NoticeBoardServiceImpl implements NoticeBoardService {
    	@Autowired
    	private NoticeBoardDao ndDao;
     
     
    	@Override
    	public List<Noticeboard> NoticeBoardList(Noticeboard nb) {
    		// TODO Auto-generated method stub
    		return ndDao.NoticeBoardList(nb);
    	}
     
    	@Override
    	public int Noticeboardtotal() {
    		// TODO Auto-generated method stub
    		return ndDao.Noticeboardtotal();
    	}
     
    	@Override
    	public Noticeboard detail(int nIdx) {
    		// TODO Auto-generated method stub
    		return ndDao.detail(nIdx);
    	}
     
    	@Override
    	public int Noticeboardinsert(Noticeboard nb) {
    		// TODO Auto-generated method stub
    		return ndDao.Noticeboardinsert(nb);
    	}
     
    	@Override
    	public int Noticeboardupdate(Noticeboard nb) {
    		// TODO Auto-generated method stub
    		return ndDao.Noticeboardupdate(nb);
    	}
     
    	@Override
    	public int Noticeboarddelete(int nIdx) {
    		// TODO Auto-generated method stub
    		return ndDao.Noticeboarddelete(nIdx);
    	}
     
     
    }

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
    <c:set var="conPath" value="<%=request.getContextPath() %>"/>    
    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <form action="noticeModify.do" method="post">
    		<table>
    			<caption>게시글 수정</caption>
    			<tr><th>작성자</th>
    				<td><input type="text" name="aID" size="30" 
    					value="${update.aID }">
     
     
    			</tr>
    			<tr><th>제목</th>
    				<td><input type="text" name="nTitle" size="30" 
    					required="required" value="${update.nTitle }"></td>
    			</tr>
    			<tr><th>본문</th>
    				<td><textarea rows="5" cols="30" 
    					name="nContent">${update.nContent }</textarea></td>
     
    			</tr>
    			<tr><td colspan="2">
    					<input type="submit" value="수정">
    					<input type="reset" value="취소">
    					<input type="button" value="목록"
    					 onclick="location.href='nlist.do'">
     
    		</table>
    	</form>
    </body>
    </html>


    <update id="update" parameterType="NoticeBoard">
    		update noticeboard set nTitle=#{nTitle}, 
    			nContent=#{nContent} where nidx=#{nidx}
    	</update>
    @RequestMapping(value="noticeModifyForm")
    	public String noticeModifyForm() {
    		return "noticeboard/noticeModifyForm";
    	}
    	@RequestMapping(value="noticeModify")
    	public String noticeModify(Noticeboard nb, String pageNum) {
    		service.Noticeboardupdate(nb);
    		return "forward:nlist.do?PageNum="+pageNum;
    	}
    Controller has a problem, but I don't know how to modify the code.

  2. #2
    Member John Joe's Avatar
    Join Date
    Jun 2017
    Posts
    279
    My Mood
    Amused
    Thanks
    8
    Thanked 19 Times in 19 Posts

    Default Re: I can't modify the board(controller has a problem)

    Quote Originally Posted by oldblueberry View Post
    Controller has a problem, but I don't know how to modify the code.
    Please specific your problem
    Whatever you are, be a good one

  3. #3
    Member
    Join Date
    Dec 2013
    Location
    Honolulu
    Posts
    83
    Thanks
    1
    Thanked 4 Times in 2 Posts

    Default Re: I can't modify the board(controller has a problem)

    Where was the problem detected? Controller

Similar Threads

  1. Problem in my 2-Dimensional Array Board Game
    By rodneybunkley in forum What's Wrong With My Code?
    Replies: 6
    Last Post: April 2nd, 2024, 07:02 AM
  2. Web mvc controller - Brutos
    By urubu in forum Web Frameworks
    Replies: 6
    Last Post: July 28th, 2013, 12:09 PM
  3. Model View Controller help
    By kari4848 in forum AWT / Java Swing
    Replies: 2
    Last Post: November 15th, 2012, 03:19 PM
  4. Controller for date class
    By Ecosse in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 2nd, 2012, 10:21 AM
  5. File I/O Modify Text Problem
    By Fordy252 in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: November 26th, 2010, 05:30 AM