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.