Home » Archives for Chandan Singh » Page 4

Author Archives: Chandan Singh

Chandan holds a degree in Computer Engineering and is a passionate software programmer. He has good experience in Java/J2EE Web-Application development for Banking and E-Commerce Domains.

Spring struts integration example

We have studied about  configuring a web-application to use Spring MVC in the previous example. In this example we will talk about how we integrate the Spring and Struts framework to get the best of both worlds. Struts2 is a quite popular MVC framework. It has an XML file : struts.xml which is mainly responsible for all the configuration. This ...

Read More »

Spring rest template example

Continuing on our Spring Tutorials, we will try to demonstrate the use of RestTemplate class available in Spring Framework. The RestTemplate class is the central class in Spring Framework for the synchronous calls by the client to access a REST web-service. This class provides the functionality for consuming the REST Services in a easy and graceful manner. When using the ...

Read More »

Spring MVC login example

In this example, we shall create a simple Login Application using Spring MVC framework. Spring Framework follows the MVC design by default so that the view,controller and Data modules are loosely coupled. In a typical Spring MVC Application, the role played are : View : JSP Controller : Classes annotated with @Controller Data : Repository Classes With this knowledge we ...

Read More »

Spring data tutorial for beginners

In this example, we shall demonstrate how to configure Spring Framework to communicate with database using JPA and Hibernate as the JPA vendor. The benefits of using Spring Data is that it removes a lot of boiler-plate code and provides a cleaner and more readable implementation of DAO layer. Also, it helps make the code loosely coupled and as such ...

Read More »

XPath parent node example

In the previous example, we introduced the dependant axis specifier. In this example, we shall talk about the ancestor axis in XPath Expression. The ancestor tag is used to select the ancestor of the current node and the ancestor of the ancestor and so on in context of the current node. We will look at a few examples to see ...

Read More »

XPath descendant example

In this example we shall talk about the Descendant axis specifier in XPath. An axis specifier indicates the direction of navigation in DOM tree of that XML document. This helps in effectively querying the XML document. The Descendant axis selects all the descendants of the current node. The ‘descendant’ refers to the children and grand-children of the current node. We ...

Read More »

XPath count example

In the previous example, we studied how to use the XPath Concat method. In this example, we will see how to use the count method in XPath. The XPath count() method is used to count the number of nodes matching a given XpathExpression. Let’s look at a few examples to understand how the count method works. Consider the XML file ...

Read More »

XPath concat Example

We studied about Xpath normalize-space() method in the previous example. In this example, we will study how the concat(String s1, String s2, String... s3) method works. The XPath-concat method works similar to the String#concat method. It joins two or more strings into a single string. The argument strings maybe two or more static strings and/or they may be two or ...

Read More »

XPath normalize-space example

In this example, we will talk about the normalize-space method in XPath. The normalize-space(String s) method is used to normalize a string i.e. to remove any leading or trailing spaces from the string s passed as parameter to the XPath function. We will look at a few examples at the examples to see how the normalize-space method works in an ...

Read More »

XPath substring example

In this example, we will try to see how we can use the sub-string method in the XPath for our use-cases. The sub-string method is used to search for the sub-string in the beginning or the end or anywhere in the XPath node. It can also be used to extract the part of the sub-string from the string by specifying ...

Read More »