java - Springmvc中这个controller需要一个zqbp_dept的参数,可是jsp哪一步传了参数?
怪我咯
怪我咯 2017-04-17 15:18:01
0
1
258

<%@page import="com.qdzq.zzpt.vo.Page"%>
<%@ page language="java" import="java.util.,com.qdzq.zqbp.entity."

pageEncoding="UTF-8"%>

<%

String path = request.getContextPath();
String basePath = request.getScheme() + "://"
  • request.getServerName() + ":" + request.getServerPort()

  • path + "/";

    //Page<zqbp_dept_person> p //= (Page<zqbp_dept_person>) request.getAttribute("page");
    
    zqbp_dept dp=(zqbp_dept)request.getAttribute("dp");
    Page<zqbp_person> p=(Page<zqbp_person>)request.getAttribute("per");

    Page<zqbp_system> p2=(Page<zqbp_system>)request.getAttribute("sys");
    %>

<p class="pageContent">

<form method="post"
    action="<%=basePath%>admin/dept/edit.html?navTabId=dept"
    class="pageForm required-validate"
    onsubmit="return validateCallback(this, navTabAjaxDone);">
    <p class="pageFormContent" layoutH="56">
        <p>
            <label>部门:</label> <select name="dept_sys_id" id="dept_sys_id" style="width:180px">
            
        <%
            for (zqbp_system one: p2.getList()) {
        %>
                
            <option value=<%=one.getSystem_id()%> 
            <% if(one.getSystem_id().equals(dp.getDept_sys_id())){%>
                selected="selected"
            <% }%>

<%=one.getSystem_name()%></option>

            
        <%
            }
        %>                                                
        </select>
        </p>
        <p>
            <label>部门负责人:</label><select name="dept_person_id" id="dept_person_id" style="width:180px">
            
        <%
            for (zqbp_person one: p.getList()) {
        %>
                
            <option value=<%=one.getPerson_id()%> 
            <% if(one.getPerson_id().equals(dp.getDept_person_id())){%>
                selected="selected"
            <% }%>

<%=one.getPerson_name()%></option>

</p>
《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《
这是controller!!!!
public ModelAndView edit(HttpServletRequest request,HttpServletResponse response, zqbp_dept item)

怪我咯
怪我咯

走同样的路,发现不同的人生

全部回复(1)
洪涛

input的name 的值在item中有对应的就可以了

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板