zoukankan      html  css  js  c++  java
  • input 就是直接在value身上设置 使用jsp的时候

    前端的使用:

    <form id="postForm" action="${pageContext.request.contextPath}/uploadSpotImg" method="Post" enctype="multipart/form-data">
    			<table>
    				<tr>
    					标题
    				</tr>
    				<tr>
    				
    					<input  type="text" name="sTitle" value="${spot.sTitle} "/ >
    				</tr>
    				<tr>
    					简介
    				</tr>
    				<tr>
    					<input type="text" name="sInfo" value="${spot.sInfo} " / >
    				</tr>
    				<tr>
    					地区
    				</tr>
    				<tr>
    					
    					省<input name="rProvince" type="text" value=" ${spot.regionInfo.rProvince}"  />
    					市<input name="rCity" type="text" value="${spot.regionInfo.rCity}"  />
    					区<input name="rArea" type="text"  value="${spot.regionInfo.rArea}" />
    					 详细<input name="rInfo" type="text" value="${spot.regionInfo.rInfo}"  />
    				</tr>
    				
    				<tr>
    				图片
    				</tr>
    				
    				<tr>
    				<input name="img1" type="file" value="${spot.sImg}" />
    				</tr>
    				
    				<tr>
    				<input name="img2" type="file" value="" />
    				</tr>
    				<tr>
    				<input name="img3" type="file" value="" />
    				</tr>
    				<tr>
    				<input id="upload" type="submit" value="提交" />
    				</tr>
    			</table>
    		</form>
    

     后台的关联:

    	@Autowired
    	SpotService spotService;
    	@Autowired
    	RegionInfoService regionInfoService;
    	// 景点模块
    	@RequestMapping("/spotModule")
    	public String spotModule(HttpServletRequest request, HttpServletResponse resp) {
    		request.setAttribute("spots", spotService.all());
    
    		return "spotModule";
    	}
    

     给value设置就是直接给赋值

  • 相关阅读:
    Beta/Gamma事后分析
    Gamma阶段发布说明
    Gamma阶段测试报告
    展示时测试Markdown渲染
    Gamma阶段项目展示
    [技术博客] 主题适配指南
    【Gamma】Scrum Meeting 10
    [技术博客]升级 API 面临的问题
    [技术博客] JS正则活学活用
    【Gamma】Scrum Meeting 9
  • 原文地址:https://www.cnblogs.com/xiaoniuniu886/p/9002696.html
Copyright © 2011-2022 走看看