display formatted json in the page

To Display formatted json we need to use <pre> tag and stringify the js object. Use JSON.Stringify JSON.stringify(value[, replacer [, space]]) Parameters value The value to convert to a JSON string. replacer If a function, transforms values and properties encountered while stringifying; if an array, specifies the set of properties included in objects in the…

Struts DispatchAction form with multiple buttons

DispatchAction provides a mechanism for grouping a set of related functions into a single action, thus eliminating the need to create separate actions for each functions. In this example we will see how to group a set of user related actions like add user, update user and delete user into a single action called UserAction….

JAVA Output Alignment

The printf function works fine for space padding. For example: // % – insert argument value // , – insert locale-specific separators // 20 – pad out to 20 spaces // .2 – fix precision at two decimal places // s – string argument // f – float argument System.out.printf(“%20s %20s\n”, “Column 1”, “Column 2”); System.out.printf(“%,20.2f %,20.2f\n”,…

Notepad++ format xml file (indent)

TextFX To Indent a XML file in notepad++, TextFX > TextFX HTML Tidy > Tidy Reindent XML If the TextFX menu does not exist, you need to download & install the plugin. Plugins->Plugin Manager->Show Plugin Manager and then check the plugin TextFX Characters. Click ‘install,’ restart Notepad++. libTidy.dll might not be included in the new version of NPP. Solution…