胖鸭 2018-06-07 10:04
浏览 19

在XHR缓冲区上发送Struts标签

I'm working in struts 2 project and now i'm trying to load a second select from the result choosen in the first select.

With the following code I can populate and load the second select.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="com.lbv.dao.impl.ArticleDao"%>
<%@page import="java.util.ArrayList"%>   
<%@page import="com.lbv.models.Campagne" %> 
<%@page import="com.lbv.models.Article" %>
<%@page import="java.util.List" %>
<%@page import="org.apache.struts2.ServletActionContext"%>   
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
System.out.println("Je suis dans le fichier AJAX...");
String four = request.getParameter("four");
System.out.println("four : "+four);
     List<Article> articles = new ArrayList<Article>();
     ArticleDao articleDao = new ArticleDao();     
     articles = articleDao.listArticleByFour(four);
      System.out.println(articles.size());
      String buffer= "<select class='form-control' multiple='true' data-live-search='true' >";
      for(int i =0; i<articles.size(); i++){
     buffer+="<option value="+articles.get(i).getCNUF_FOURNISSEUR()+">"+articles.get(i).getLIBELLE_ARTICLE()+"</option>";

      }
     buffer+="</select>";

response.getWriter().println(buffer);
%>

But the problem appear when i try to send a struts tag s:select instead of select, the page dont show everything.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器