Search Results

Search found 3 results on 1 pages for 'wiretap'.

Page 1/1 | 1 

  • Reference a Map by name within Velocity Template

    - by Wiretap
    Pretty sure there is an easy answer to this, but just can't find the right VTL syntax. In my context I'm passing a Map which contains other Maps. I'd like to reference these inner maps by name and assign them within my template. The inner maps are constructed by different parts of the app, and then added to the context by way of example public static void main( String[] args ) throws Exception { VelocityEngine ve = new VelocityEngine(); ve.init(); Template t = ve.getTemplate( "test.vm" ); VelocityContext context = new VelocityContext(); Map<String,Map<String,String>> messageData = new HashMap<String, Map<String,String>>(); Map<String,String> data_map = new HashMap<String,String>(); data_map.put("data_1","1234"); data_map.put("a_date", "31-Dec-2009"); messageData.put("inner_map", data_map); context.put("msgData", messageData); StringWriter writer = new StringWriter(); t.merge( context, writer ); System.out.println( writer.toString() ); } Template - test.vm #set ($in_map = $msgData.get($inner_map) ) data: $in_map.data_1 $in_map.a_date

    Read the article

  • Do you have examples of un-helpful/Obscure error messages

    - by Wiretap
    Yesterday I got this error The processing instruction target matching "[xX][mM][lL]" is not allowed when I investigated, it was caused by whitespace at the very start of my XML document. Not difficult to solve, but I was struck with how unhelpful that particular error message was to identifying the actual problem. So what other examples of obscure errors do people have, and are you willing to admit to some of your own making.

    Read the article

  • Example of standalone Apache Qpid (amqp) Junit Test

    - by Wiretap
    Does anyone have an example of using Apache Qpid within a standalone junit test. Ideally I want to be able to create a queue on the fly which I can put/get msgs within my test. So I'm not testing QPid within my test, I'll use integration tests for that, however be very useful to test methods handling msgs with having to mock out a load of services.

    Read the article

1