关于前端下拉框不显示公共作用域里的内容

关于前端下拉框不显示公共作用域里的内容

问题描述:

img


关于下拉框,不显示内容
前端代码为



```javascript
<tr>
                            <td class="one">类别</td>
                            <td>
                                <select name="typeId">
                                    <c:forEach items="${typetlist}" var="type">
                                        <option value="${type.typeId}">${type.typeName}</option>
                                    </c:forEach>
                                </select>
                            </td>
                        </tr>



typeList已经在监听器中赋予到公共作用域
@Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        //手工从spring容器取出ProductTypeServiceImpl对象
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext_*.xml");
        ProductTypeService productTypeService = (ProductTypeService) context.getBean("ProductTypeServiceImpl");
        List<ProductType> typeList = productTypeService.getAll();
        //放入全局应用作用域中,新增页面,修改页面,前台查询功能提供全部商品类别集合
        servletContextEvent.getServletContext().setAttribute("typeList",typeList);
    }

```

items="${typetlist}"写错了,改为:items="${typeList}"