0

我想在我的页面 jsp 中显示来自我的数据库的信息,所以我创建了这个方法:

public Agent getInfo(int ppr){
       final String sql = "SELECT DISTINCT NOML,PPR,LL_Fonc,LL_CADRE,NOM_ETABL,cina,cinn from activite_agent WHERE PPR=?";

        RowMapper<Agent> mapper=new RowMapper<Agent>(){

            public Agent mapRow(ResultSet rs, int rowNum)throws SQLException {
                Agent ag = new Agent();
                ag.setPrenomarabe(rs.getString("LL_FONC"));
                ag.setNomlatin(rs.getString("NOML"));
                ag.setPpr(rs.getInt("PPR"));
                ag.setCadre(rs.getString("LL_cadre"));
                ag.setNomarabe(rs.getString("NOM_ETABL"));
                ag.setCina(rs.getString("CINA"));
                ag.setCinn(rs.getInt("CINN"));
                return ag;

            }   
        };
        return (Agent)getJdbcTemplate().queryForObject(sql, new Object[] {Integer.valueOf(ppr) }, mapper);

   }

这是我在上面调用此方法的控制器:

@RequestMapping("servicebyPPR")
    public String getService(@RequestParam("ppr") Integer ppr,ModelMap model,@ModelAttribute Movement movement){
        if (ppr==null) {
            model.addAttribute("Noinsertppr", true);
            return "FicheService";}
            else{
                if (actservice.IfFound(ppr)==true){ model.addAttribute("notfoundppr","true");}
                else{
            model.addAttribute("agact", actservice.getInfo(ppr));
           // model.addAttribute("agserv", actservice.getServices(ppr));
                }
            return "FicheService";

            }
    }

在这里我想展示一些信息:

            <tr>

                                <td><form:input type="text" value="${agact.cina}"
                                        path="cina" /></td>
                                <td><form:input type="text" value="${agact.cinn}"
                                        path="cinn" /></td>

                                <td><form:input type="text" value="${agact.ppr}"
                                        path="ppr" /></td>
                                <td><form:errors path="ppr" Class="errorbox" /></td>
                            </tr>

现在的问题是我的视图中只出现了两个输入并且“ppr”的输入被隐藏了我不知道为什么?

在此处输入图像描述

4

0 回答 0