REST WS in Two minutes

Spring make your life very easy while implementing REST web service, using Spring one can implement the WS very efficiently and quickly too.

Lets Start with the implementation

Pre-requisites

1) Working MVC Example

Integration

To implement the REST WS we just need to use @pathvariable annotation tag and rest will be take care by spring framework

@RequestMapping(value="ws/{name}" , method=RequestMethod.GET)
	public String wsExample(@PathVariable String name,Model model){
		model.addAttribute("myString", name);
		return "success";
	}

Compile the project and hit the url ${webapp_url}/ws/spring

once it reaches the request mapping the name variable define in signature will contain the value spring and similarly you can extend your WS by adding more @pathvariable

This is a basic example showing how to create REST WS using Spring.

Hope the article helped in basic integration, suggestion and feedbacks are welcome.

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
+1
0
  

Beginning Groovy, Grails and Griffon – Apress


» Read more..

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
+2
0
  

Lets’ work with Spring mobile

This tutorial discusses about the integration of spring mobile in already created spring project
Add Spring-Mobile-Device dependency in pom.xml

Minutes to be followed:
1) Spring version used is 3.1.1.RELEASE
2) Change spring mvc xsd 3.0 to 3.1 present in servlet-context.xml
» Read more..

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
+3
-1
  

Let’s start with Spring Mobile

This tutorial discusses about the use of spring mobile and brief description of the usage and features

When to use????

Use only if you need any of the following feature:

• A Device resolver abstraction for server-side detection of mobile devices

• Site preference management that allows the user to indicate if he or she prefers a “normal” or “mobile” experience

• A site switcher capable of switching the user to the most appropriate site, either mobile or normal, based on his or her device and optionally indicated site preference

» Read more..

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
+6
0
  

Grails – Installing and Creating a project in Grails

Grails is not only a web framework but a complete development framework which runs on top of JVM.It uses convention over configuration which makes it different from most of the frameworks which require alot of XML configuration. There is no need to use XML to configure various things while creating an web app using Grails. When application is created initially using Grails, it creates various directories in the project which are meant for specific things. For example , it creates folders like spring,hiberante,domain,controller etc where the specific files should be placed and application will automatically pick those up.Also Grails provides utilities to create domain classes and controllers which gets created and also gets copied to the directories which are meant for them. Isn’t this wonderful. This saves alot of development time and is the beauty of framework.
» Read more..

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
+2
-1
  

Spring IOC – Autowiring in Spring

Autowiring in spring reduces lot of headache as a developer. The Autowiring in spring comes with 4 flavors.

1) No: No autowiring, in this case ref has to be used to do autowring(Manually)

2) byname: In this case Autowiring is done by bean name, if the defined bean name    and the name of bean property is same then autowire it.

3) byType: if the defined bean data type and the data type of bean property are same then Autowiring is done.

4) constructor: The autowiring is done using constructor argument using byType mode.
» Read more..

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
+4
0
  

Spring Security Tutorial (Part-II)

After the integration of Spring Security in last tutorial , Lets discuss how to enhance the Security more in the same context. In this tutorial we will discuss:

1) Adding Customize login page.
2) Adding salt and password encoding.
3) Session Management
» Read more..

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
+2
0
  

Joinpoints and Pointcut Expressions in Aspectj

In this tutorial I will cover Joinpoints and Pointcut Expressions

Join Point
A join point is a point of execution in a program like call to a method or method execution or even an assignment to a variable.

I will consider only method join points(method execution and call to a method) for this tutorial.
» Read more..

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
+1
0
  

Spring Security Tutorial (Part-I)

Why use Spring Security??

Spring Security is a very smart solution for the entire authentication based needs, it could be file based authentication, LDAP or Database authentication. The framework takes the responsibility to help with security concerns making it very easy and reliable solution for the user.  Spring Security also allow role based access i.e. it distinguishes user X and user Y flawlessly and allows  user to do the task that are privileged to them. Spring Security can also have the access controlled views by saying we mean that the framework controls the rendering of view user X and user Y can have two different views.
» Read more..

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
+11
0
  

Spring Resource Injection

Many a times, we are often required to read a file into our application. That file can be located anywhere in the system or network. To handle such file accessing tasks, Spring provides an interface called as “Resource” contained in the package org.springframework.core.io. To stream in the file, this interface has a method called as getInputStream() and many other methods that can come handy to get the file information. So now lets see how we can use this functionality in our code.
» Read more..

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
+13
0