pranav-varshney.blogspot.com
Tech Discussions: Interceptors in Spring MVC
http://pranav-varshney.blogspot.com/2010/05/interceptors-in-spring-mvc.html
Wednesday, May 12, 2010. Interceptors in Spring MVC. These are different ways to configure Interceptors for Spring MVC based controllers. 1 If you have the URL / Controller mapping in xml you can define the interceptors as. Bean id="myService" class="com.test.services.MyService"/. Bean id="myInterceptorOne" class="com.test.interceptors.FirstInterceptor". Property name="myService" ref="myService" /. Bean id="myInterceptorTwo" class="com.test.interceptors.SecondInterceptor" /. Here ThirdInterceptor would b...
pranav-varshney.blogspot.com
Tech Discussions: August 2009
http://pranav-varshney.blogspot.com/2009_08_01_archive.html
Monday, August 3, 2009. Spring Web Service - Writing client. Now let us write dummy client to test the web service that we wrote earlier. Let us follow these steps -. 1 Use the WSDL (http:/ localhost:8080/test/user.wsdl) and create the client classes. We can use XJC to create the classes. This is sample build.xml. Use "ant generate". Project name="spring-ws-user-ws-server" basedir="." default="default". Fileset dir="C: jaxb-ri-20090708 lib". Include name="* /*.jar"/. That I would be using. Property name=...
pranav-varshney.blogspot.com
Tech Discussions: July 2009
http://pranav-varshney.blogspot.com/2009_07_01_archive.html
Wednesday, July 22, 2009. Spring provides a special remoting strategy which allows for Java serialization via HTTP, supporting any Java interface. The corresponding support classes are HttpInvokerProxyFactoryBean and HttpInvokerServiceExporter. I will write a simple service and a client to demonstrate the use of Spring HTTP Remoting. Let us follow the following steps -. 1 Write an interface let say it is IMyTestService. Package com.test.server;. Public interface IMyTestService {. 4 Write web.xml. Web-app...
pranav-varshney.blogspot.com
Tech Discussions: Spring Security – Part 1 – Necessary Configuration and Custom UserDetailsService
http://pranav-varshney.blogspot.com/2010/01/spring-security-part-1-necessary.html
Saturday, January 2, 2010. Spring Security – Part 1 – Necessary Configuration and Custom UserDetailsService. Here we will look into –. 1 The necessary configurations required. 2 Write custom userDetailsService reading user name, password and roles from properties file. We will not use default security namespace configuration instead we will define beans and configure our own FilterChainProxy. Add the schema declaration to the application context file –. Now let us define and configure springSecurityFilte...
pranav-varshney.blogspot.com
Tech Discussions: January 2010
http://pranav-varshney.blogspot.com/2010_01_01_archive.html
Saturday, January 9, 2010. Developing Modular Web Application using Slices on Spring DM 2 RC1. 1 Download Spring DM 2 RC1. 2 Download Slices bundles from http:/ www.springsource.com/download/community? 3 Copy the bundles and the plan file in the dist directory of the zip to dm Server's repository/usr directory. 4 Edit DM Server's config/com.springsource.kernel.userregion.properties file to add slice’s plan under initialArtifacts –. 8221; and zero or more children called “ slices. Now let us look into web...
pranav-varshney.blogspot.com
Tech Discussions: Spring Security – Part 2 – Custom securityMetadataSource
http://pranav-varshney.blogspot.com/2010/01/spring-security-part-2-custom.html
Sunday, January 3, 2010. Spring Security – Part 2 – Custom securityMetadataSource. Now let us look into filterSecurityInterceptor. This filter authorizes web requests based on URL patterns. Instead of having the URLs configured in application context, we will have URLs in the properties file. We can even have these URLs configured in database or LDAP server. Here let us have properties file having URLs and the corresponding roles. The properties file looks like –. Admin/* =ROLE ADMIN,ROLE MANAGER. Bean i...
pranav-varshney.blogspot.com
Tech Discussions: Spring Web Service
http://pranav-varshney.blogspot.com/2009/08/spring-web-service.html
Sunday, August 2, 2009. Spring-WS supports the contract-first development style that means we start with the WSDL contract and use Java to implement said contract. We will write a sample code to demonstrate how to write contract-first Web services, that is, developing web services that start with the XML Schema/WSDL contract first followed by the Java code second. Let us follow the following steps -. 1 So, first step would be to create XSD (let us name it as user.xsd). Element name="AuthenticateUserRespo...
pranav-varshney.blogspot.com
Tech Discussions: May 2010
http://pranav-varshney.blogspot.com/2010_05_01_archive.html
Wednesday, May 12, 2010. Interceptors in Spring MVC. These are different ways to configure Interceptors for Spring MVC based controllers. 1 If you have the URL / Controller mapping in xml you can define the interceptors as. Bean id="myService" class="com.test.services.MyService"/. Bean id="myInterceptorOne" class="com.test.interceptors.FirstInterceptor". Property name="myService" ref="myService" /. Bean id="myInterceptorTwo" class="com.test.interceptors.SecondInterceptor" /. Here ThirdInterceptor would b...
pranav-varshney.blogspot.com
Tech Discussions: April 2009
http://pranav-varshney.blogspot.com/2009_04_01_archive.html
Wednesday, April 8, 2009. Struts 2, Apache Tiles 2 - View Preparer - Dynamic Menu Creation. Let us develop as page using Struts 2, Apache Tile and Spring. This page has the following tiles – Header, Menu, Body and Footer. Let us have our Menu which is dynamic in nature which gets all menu items from database. So, we will use View Preparer to prepare the Menu before rendering. Our tile definition file (tiles.xml) would look like. Xml version="1.0" encoding="ISO-8859-1"? Xsi:schemaLocation="http:/ www....