Powered by Blogger.

How does the ternary Operator Works?

>> Tuesday, November 15, 2011

The Ternary Operator contains three operands with
  "? :". Based on the return type it will give the value.

operand1 ? operand2 : operand3

Ternary Operator Syntax:

boolean expression ? value1 : value2 ;

The first operand is a boolean expression; if the expression is true then the value of the second operand is returned otherwise the value of the third operand is returned:

Here if operand1 is true, operand2 is returned.

operand1 must be a boolean type

Read more..

JSP Tag Libraries in Breif

>> Sunday, October 30, 2011

You have many options when it comes to generating dynamic content inside the JSP page.

These options are as follows :
  • Scripting elements calling servlet code directly
  • Scripting elements calling servlet code indirectly (by means of utility     classes)
  • Beans
  • Servlet/JSP combo (MVC)
  • MVC with JSP expression language
  • Custom tags

Read more..

1.1. MVC - Architecture - 1

>> Wednesday, October 19, 2011

 Web Application Devolopment Models.

Model - 1 Architecture :

Model 1 architecture based web application development is outdated approach of developing web applications. Now a days most of the companies are using MVC architecture to develop the web application. It has become industries defector standard to develop the web applications.

Model 1 architecture based web application multiple web resources will be there but all these web resources will be developed either by using Servlet technology or by using JSP technology.

Read more..

Using Naming Conventions in Java

>> Tuesday, October 18, 2011

What Is a Naming Convention ?

A naming convention is a rule to follow as you decide what to name your identifiers (e.g. class, package, variable, method, etc..).

Why Use Naming Conventions ?

Different Java programmers can have different styles and approaches to the way they program. By using standard Java naming conventions they make their code easier to read for themselves and for other programmers. Readability of Java code is important because it means less time is spent trying to figure out what the code does, leaving more time to fix or modify it.

Read more..

Using Debug Tag with an Example

>> Thursday, October 13, 2011


In this article we explained that to send the JSP content of the tag body to the client, one need only call the getJspBody().invoke(null) method inside the doTag method of the tag handler class.

This simplicity allows us to easily create tags that output their bodies conditionally. This functionality can be achieved by simply surrounding the getJspBody().invoke(null) invocation within an if statement.

In this section, we present an example of a custom tag that conditionally outputs its tag body. It's quite often the case when the output of the JSP page is something other than what you expected. In such a case, it's useful to have the option of seeing some debugging information right on the page without having to resort to embedding System.out.print statements throughout the page.

Read more..

MultiThreading or MultiTasking

>> Saturday, October 8, 2011

Multithreading / MultiTasking:

Let us assume a class containing three functions named as fun1,fun2 and fun3. If all are called once it may take more time to execute. 

In the above example fun2(), fun3() will be executed only after the complete execution of fun1().
Suppose fun1() is performing any input/output operations then at that time processor will be in the ideal state. If input/output operations take 60sec and also fun2() and fun3() will not be executed until 60sec are completed. To overcome this disadvantage the concept of multitasking is used.

There are two types of multitasking techniques.

                1.Process based multitasking
                2.Thread based multitasking


Read more..

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2022. All rights reserved.