[ 
https://issues.apache.org/jira/browse/FREEMARKER-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15885516#comment-15885516
 ] 

Leonardo Zorzi commented on FREEMARKER-46:
------------------------------------------

Thank for your support.
The code to load data is:
        Map<String, Object> data = new HashMap<>();
        List<AllarmBibliotecaBean> titoli = new ArrayList<>();
        AllarmBibliotecaBean titolo;
        
        String sql = " " +
                " SELECT B.* , A1.* , A2.* , A3.*  " +
                " FROM xjob.biblioteca AS B " +
                " LEFT JOIN xjob.argomento AS A1 ON (biblioteca_arg1 = 
A1.argomento_id) " +
                " LEFT JOIN xjob.argomento AS A2 ON (biblioteca_arg2 = 
A2.argomento_id) " +
                " LEFT JOIN xjob.argomento AS A3 ON (biblioteca_arg3 = 
A3.argomento_id) " +
                " WHERE biblioteca_inserimento >= ? " +
                "   AND biblioteca_esterno = ? ";

        XDB xdb = new XDB();
        Connection con = xdb.openConnection();
        
        PreparedStatement ps = con.prepareStatement(sql);
        ps.setDate(1, new Date(116, 0, 1));
        ps.setString(2, "BIBLIOTECA");
        
        ResultSet rs = ps.executeQuery();
        
        // ciclo su tutti gli accadimenti e li carico in una hash table
        while(rs.next()) {
            
            titolo = new AllarmBibliotecaBean();
            titolo.setArgomento1(rs.getString("A1.argomento_codice"));
            titolo.setArgomento2(rs.getString("A2.argomento_codice"));
            titolo.setArgomento3(rs.getString("A3.argomento_codice"));
            titolo.setNome(rs.getString("biblioteca_nome"));
            titolo.setTipo(rs.getString("biblioteca_tipo"));
            titolo.setTitolo(rs.getString("biblioteca_titolo"));
            
            titoli.add(titolo);
            
            System.out.println("Titolo: " + titolo.toString());
        }
        
        rs.close();
        ps.close();
        
        data.put("titoli", titoli);

--- 
i've test the same code in standalone application and all is ok...
Now i've undestand... the web application, in process deploy, take a 
obfuscation... and the bean class change name's...
Sorry... :-(



> Empty value
> -----------
>
>                 Key: FREEMARKER-46
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-46
>             Project: Apache Freemarker
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 2.3.23
>         Environment: Java 1.8, Tomcat 8.0.15
>            Reporter: Leonardo Zorzi
>            Priority: Critical
>
> Sorry for my bud english.
> I've installed freemarker in develop enviroment (java 1.8, tomcat 8.0.15, 
> Windows 7) and all is ok. When put software in production (jdk 1.8, tomcat 
> 8.0.31, Windows Server 2008) don't work.
> The template:
> <#list titoli as titolo>
>                       <tr>
>                               <td>${(titolo.argomento1)!"default text"}</td>
>                               <td>${(titolo.argomento2)!"default text"}</td>
>                               <td>${(titolo.argomento3)!"default text"}</td>
>                               <td>${(titolo.nome)!"default text"}</td>
>                               <td>${(titolo.titolo)!"default text"}</td>
>                               <td>${(titolo.tipo)!"default text"}</td>
>                       </tr>
>                       </#list>
> In develop is ok, in production all field are "default text" and the number 
> of row is the same. (the origin of data is the same, and the beans are full 
> with correct data!)
> What is the problem!?
> Thank you!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to