ssm项从controller控制页面弹窗上
jsp页面代码块
<form action="detailnews" method="post" id="detailnewsform">
<input value="${news.id }" name="id"><br>
<input value="${news.title }" name="title"><br>
<input value="${news.content }" name="content" style="width:100%;height:100px;"><br>
<input value="${news.image }" name="image"><br>
<input value="${news.type }" name="type"><br>
<input value="${news.author }" name="author"><br>
<input value="${news.date }" name="date"><br>
<input type="submit" value="修改">
</form>
controller代码块
/**
* 修改新闻
* @param id
* @param title
* @param content
* @param image
* @param type
* @param author
* @param date
* @param response
* @return
* @throws IOException
*/
@RequestMapping("/detailnews")
public String updateNews(int id,String title,String content,String image,String type,String author,String date,HttpServletResponse response) throws IOException {
response.setContentType("text/html;charset=utf-8");
News news=newsService.updateNews(id,title,content,image,type,author,date);
response.getWriter().write("<script>alert('修改成功!');window.location='adminshow'; </script>");
return null;
}
如有问题,联系我修改!