Apple received thousands of data requests from US law enforcers

ImgBurn 2.5.8.0

ImgBurn is a lightweight CD / DVD / HD DVD / Blu-ray burning application that everyone should have in their toolkit!





via FileHippo.com http://www.filehippo.com/download_imgburn/ [[ We are also giving web service. Email:wasim.akh2@gmail.com]]

Sandra Lite 2013 SP4 (19.50)

SiSoftware Sandra (the System ANalyser, Diagnostic and Reporting Assistant) is an information & diagnostic utility. It should provide most of the information (including undocumented) you need to know about your hardware, software and other devices whether hardware or software.





via FileHippo.com http://www.filehippo.com/download_sandra_lite/ [[ We are also giving web service. Email:wasim.akh2@gmail.com]]

How to access Static Fields in Freemarker FTL

If you defined static fields in Java class and want to use the same in Freemarker (FTL) it is not possible to do so as FTL is not aware of Java objects during rendering. In order to make static fields available to FTL, we need to expose them.


One way of exposing static Java fields to freemarker template is to use them through Model. But if one constant has to be used at multiple places then this would not meet our purpose.


Using Static fields in Spring MVC


In order to use Java static fields in Freemarker in Spring MVC based application, following code snippet can be used:


To access following Java class with static fields:



package net.vibhati;
public class ConstantsEx {
public final static String NAME = " HELLO WORLD";
}

Add below code in Spring MVC Controller:



import freemarker.ext.beans.BeansWrapper;
...

...
BeansWrapper w = new BeansWrapper();
TemplateHashModel statics = w.getStaticModels();
model.addAttribute("statics", statics);

...

In FTL, use JAVA constants as:




${statics["net.vibhati.ConstantsEx"].NAME}

The TemplateHashModel returned from BeanWrapper.getStaticModels, Exposes all static methods and static fields(both final and non-final, using reflection). Now we can add this hashmodel to our Model, as illustrated above. And use it directly in FTL then.


An alternate way to do this is to prepare the TemplateHashModel in a custom filter or Spring Interceptors, so that it becomes common to all the requests(or to the url pattern specified in our custom filter).


This can be implemented is Spring in almost the same manner as explained below for Struts.


Using Static fields in Struts


As MODEL is not available,


In a custom filter, we put our TemplateHashModel in request (this custom filter should be before the Struts 2 filter):


The Java constant class that we need to access in FTL:



package net.vibhati;

public class ConstantsEx {
public static final String NAME = "Hello World";
}

Just make a custom filter(in this case, MyFilter.java) and put our logic in doFilter():



public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
BeansWrapper bw = StrutsBeanWrapper.getDefaultInstance();
TemplateHashModel statics = bw.getStaticModels();
request.setAttribute("statics", statics);
chain.doFilter(request, response);

}

In FTL, now we can use “statics” as below:



${statics["net.vibhati.ConstantsEx"].NAME}

How to configure our custom filter in web.xml:



<filter>
<filter-name>MyFilter</filter-name>
<filter-class>net.vibhati.interceptor.MyFilter</filter-class>

</filter>
<filter-mapping>
<filter-name>MyFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

Instead of going all the way and configuring our own filter, we can use OGNL in struts , and get the work done by adding just 1 line in our ftl –



${stack.findValue("@net.vibhati.ConstantsEx@NAME") }

Although, All these approaches do have some security threats associated, as we are exposing all static fields to FTL.


Dig in more , to know more ;)


Refer: http://freemarker.sourceforge.net/docs/pgui_misc_beanwrapper.html








via ViralPatel.net http://feedproxy.google.com/~r/viralpatelnet/~3/dkyB_b7LpHI/

China trounces US in TOP500 supercomputer race

How Internet devices are working to save the rainforest

Prepare the Internet for battle, suggests UK official

[Software Update] Opera 129.0.5823.44 Stable Released, Here is What’s New and Fixed

UPDATE: Release of Opera 129.0.5823.44 stable version to public. Good news for Opera users! Opera team has released new Opera 129.0.5823.44 ...