File download code through stream, Java
Sometimes we may need to give support in our application to download a file. For example if you want to convert String to a file and wants to get a downloadable dialog in browser to download file. To...
View ArticleProgrammatically refresh Spring mvc resource bundle
Programmatically refresh Spring mvc resource bundle OR Inject Spring ReloadableResourceBundleMessageSource OR Spring message translation found in JSP but not in controller Define your ResourceBundle...
View ArticleGenerate Java Axis 2 WebService CLIENT/SERVER
This is compete guide/tutorial to build axis 2 web service server/client side code and interaction of both. It all works for me and I got successfull call to webservice and get response. We will use...
View ArticleRegular Expression caret or circumflex (^) in character class
You can also use a character class to exclude specific characters by adding a caret or circumflex (^) immediately after the opening square bracket like this: [^aeiou] This excludes all vowels from a...
View ArticleSpecial wildcard characters (metacharacters)
Table 1 describes the most important wildcard characters used in regular expressions. Strictly speaking, most of them are metasequences because they are made up of two characters. However,...
View ArticleSpring MVC exception handling and show custom view
Spring MVC is a powerfull Java application framework to create web applications for Java. In this example we’ll learn how to handle exception in Spring MVC and then based on that how to show a...
View ArticleJava Web Service/Client in Eclipse
In this post we’ll learn how to create Java based Web Service/Client in Eclipse. Webservices are widely used between different application to communicate with each other and pass information. There are...
View ArticleExpand and collapse div content in dojo
This is a very nice way to Expand and collapse div content in dojo. Dojo is rich javascript framework used to crete interactive Web Pages HTML Code Call onclick=”collapse(‘1’); method on for every div...
View ArticleMethods of SimpleFormController of Spring MVC
The entire life cycle of a HTML form is handled by SimpleFormController of Spring MVC. The tasks of form viewing, validation, submission are maintained in complex but magical way by this Class. The...
View ArticleApache Atlas Web App Architecture
Atlas-webapp module is the kick start of Apache Atlas server and application. When we run python code to start server it invokes the main class Atlas.java of this module. It sets required...
View ArticleTriggering a Jenkins build
Few common ways out many ways to manual and automatic build creation on Jenkins are: Manual Build: Polling the repository: Now, it is possible to setup a Build Trigger to get Jenkins to poll for...
View ArticleExpose dummy Http URL and get response
com.sun.net.httpserver.HttpServer can do so. A HttpServer is bound to an IP address and port number and listens for incoming TCP connections from clients on this address. import java.io.IOException;...
View ArticleSpring Web Security
Spring Security uses Spring EL for expression support and you should look at how that works if you are interested in understanding the topic in more depth. Expressions are evaluated with a “root...
View ArticleThe wsimport tool and SOAP service
The wsimport tool reads a WSDL and generates all the required artifacts for web service development, deployment, and invocation. The wsimport tool supports the top-down approach to developing JAX-WS...
View ArticleThis regular expression is for which type of strings
How can one know that any particular regular expression matches which type of input? Like I want to know about \$\{([\w]+)\}. Which string will be matched by this regular expression? Pattern...
View ArticleUnbound ID in-memory LDAP server | Multiple base DN
Define two base DN’s in ldif file that contains the schema for LDAP server like dn: dc=com objectclass: domain objectclass: top dc: com dn: SECAUTHORITY=DEFAULT objectclass: domain objectclass: top...
View ArticleMock Object
A Mock Object is an object that substitutes for a real object. In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer...
View ArticleSEO Friendly URL Structure for WordPress
Why SEO Friendly URL Structure When you have a SEO friendly structure, you are increasing your chances of ranking higher in search engines such as Google and others. Which by default are the largest...
View ArticleRun JBOSS AS 7 on standalone-full.xml
Double click on installed JBOSS server in eclipse. Select Runtime Environment Select Standalone-full.xml file for JBOSS Click Finish and restart server. Server will run on standalone-full.xml...
View ArticleCreate users in JBOSS AS 7
Open CMD Open directory for JBOSS bin folder like. Run add-user.bat file It will ask for type of user to add. Type ‘a’ to add Management user and press enter It will ask Real details. Leave empty and...
View Article