Quantcast
Channel: About Me
Viewing all 768 articles
Browse latest View live

Spring 3 security siteminder pre-authentication example

$
0
0

So far we have learned about securing spring application using login form based security, custom user details security and many more such security related concepts. In this post, I am giving an example of scenario where use is already authenticated via any third party application or tool e.g. site minder which is very common interface [...]

Java interview question: Why Strings are immutable?

$
0
0

This is no doubt, most asked beginner level java interview question. And sometimes you can face at medium level interviews also. So, my suggestion is to learn it here and for ever. Lets start with immutability itself. An immutable object is an object which state is guaranteed to stay identical over its entire lifetime. This [...]

Struts 2 hello world with annotations

$
0
0

In my previous posts, I have written many examples and tutorials on JAX-RS RESTEasy, Spring 3, Hibernate and other java frameworks e.g. maven or junit 4. I also wrote on post related to Struts 2 hello world with xml configuration. In this post, I am updating previous example to use annotations to configure struts 2 [...]

[SOLVED]: Unable to find a result type for extension [properties] or [xml]

$
0
0

If you have just started writing struts 2 application, and you are in process of configuring it then you might face this exception. Complete stack trace will look like this: SEVERE: Dispatcher initialization failed Unable to load configuration. - [unknown location] at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258) [...]

How to correctly set result path in struts 2

$
0
0

Here, result path means the location of JSP files or other view files which Struts 2 will resolve after executing the code in Action classes. These result paths are mentioned in “location” of @Result annotation on top of Action classes. Once the action class finish execution, it will pass the control to view resolvers. View [...]

JavaScript: Correct way to define global variables

$
0
0
javascript jquery


We know that what global variables or constants are, these are fields which are accessible application wide. In java, it is done usually done using defining “public static” fields. Here by adding final keyword, we can change the global variable to global constant. So easy, right? But what about javascript?...
Read more »

Struts 2 custom interceptor with @InterceptorRef example

$
0
0
struts-2


In previous posts, we learned the hello world applications and setting result path for struts 2 applications. Now, moving ahead in this post, I am giving an example of custom or user defined interceptor configuration using annotations. An interceptor is a class whose pre-defined method is called each time, a...
Read more »

[Solved] Unable to find interceptor class referenced by ref-name

$
0
0
Random exceptions


I came to know of this feature while writing code for @InterceptorRef example. I had to declare interceptor definitions in struts.xml file whereas I wanted to use the interceptor using annotations. On first attempt, It failed with following error: Unable to load configuration. - [unknown location] at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)...
Read more »


5 Reasons You Should Consider Migrating Your Legacy Systems

$
0
0
migration


Organizations don’t like to leave their legacy system easily as there are several concerns for moving into a new platform. Latest technologies may have the features to improve their operational efficiency, but moving from one platform to another is not as simple as it seems from the top. Further, some...
Read more »

Hibernate example of insert/select blob from database

$
0
0
Hibernate blob example


In previous hibernate tutorials, we have learned about first level cache, second level cache and some various mapping examples etc. This is complete list of hibernate related tutorials. In this post, I am giving an example of inserting BLOB data into database using hibernate and getting this data from database,...
Read more »

Visitor design pattern example tutorial

$
0
0
Solution using visitor pattern


Design patterns are used to solve the problems which occur in a pattern, we all know that, right? Also we know that behavioral design patterns are design patterns that identify common communication patterns between objects. One of such behavioral patterns is visitor pattern, which we are going to learn about...
Read more »

A birds-eye view on “how web servers work?”

$
0
0
web server application server


Many times we wonder that how a web container/ web-server (e.g. tomcat or jboss) works? How they handle the incoming http requests coming from all over the world? What are the things which make it happen behind the scene? How java servlet API (i.e. classes like ServletContext, ServletRequest, ServletResponse and...
Read more »

How to read data from InputStream into String in java

$
0
0
io-read-into-string


This is very common requirement in several type of applications where you have you read data from network stream or from file system and do some operation on it. If you are using java.nio package then for reading a file, you can read some effective ways my post: 3 ways...
Read more »

SerialVersionUID in java and related fast facts

$
0
0
Serialization-deserialization-demo


In java, serialization is the process of turning an object-in-memory into a stream of bytes so you can do stuff like store it on disk or send it over the network. De-serialization is the reverse process: turning a stream of bytes into an object in memory. In my earlier post...
Read more »

Instances of same class can access private members of each other

$
0
0
Java-Access-Specifiers


From this post onwards, I will spend few days in sharing some little known (if not unknown) features of java language, which we either don’t knew before or didn’t care to think differently. I will really appreciate if all you guys participate in discussion with your thoughts. And for being...
Read more »


Usage of class sun.misc.Unsafe

$
0
0
Java_logo


This post is next update in sequence of discussions regarding little known features of java. Please subscribe through email to get updated when next discussion goes live. And do not forget to express your views in comments section. Java is a safe programming language and prevents programmer from doing a...
Read more »

Checked exceptions thrown in initializer blocks can be declared by the constructors

$
0
0
Java_logo


This post is in continuation to exploring little known features of java. In previous post, I have covered “Instances of same class can access private members of each other” and Some very surprising usage of class sun.misc.Unsafe. In this post, I am discussing about a little known feature of initializes...
Read more »

Instanceof operators don’t need explicit null checks

$
0
0
Java_logo


This post is part of series on little known features of java. Earlier posts covered instances accessing private members from same class, usage of class sun.misc.Unsafe and checked exception thrown through constructors for initializer blocks. In this post, I am discussing about a very common practice adopted by beginner level...
Read more »

Labeled statements in java

$
0
0
Java_logo


Welcome back to my next post in series of less known java features. If you are new to this series, I would like to encourage you to read previously discussed features e.g. usage of sun.misc.Unsafe, SerialVersionUID and related facts, Instanceof operators don’t need explicit null checks and Checked exceptions thrown...
Read more »

How to create splash window using java SWT

$
0
0
splash-screen


Splash window is introductory screen which is shown to the user, by the time application is loading on background. Splash screens cover the entire screen or simply a rectangle near the center of the screen. Usually, a progress bar is also shown along with splash window which indicates how much...
Read more »

Viewing all 768 articles
Browse latest View live