Programming

Java:Building a Sample Web App with STRUTS

Java:Building a Sample Web App with STRUTS

Fadıl

In this article, I will discuss building a sample web application using STRUTS. STRUTS is a leading open-source Web Application Framework. NetBeans is the leading open-source IDE and we will use it to demonstrate how to simplify application development using the IDE. Finally our application will run on TomCat application server.

Prerequisites:
We will assume that as a reader you are familiar with web application development, specifically using JSP and Java.
Preparation:
We need to install NetBeans IDE (and JDK needed for the IDE). You can install NetBeans from www.netbeans.org. Or click here for simple instructions on how to install the IDE.
Quick overview:
We will create a very simple web application just to demonstrate screen flow and action handling using STRUTS. We will use NetBeans to create the JSP aNDjava files, use tools such as auto generation of getters and setters and finally use the IDE to compile and test the app. NetBeans comes with integrated TomCat.

PHP Function:  Built-in Functions part 12

PHP Function: Built-in Functions part 12

Fadıl

The last of the Built-in Functions!
String Functions
The functions I will add here only scratch the surface of PHP’s built-in string manipulation functions, but if you understand thses common functions, your programming life will be a lil easier.

addslashes() and stripslashes()
The addslashes() and stripslashes() functions are very important when inserting and retieving data from a database. Often, text inserted into a database will contain special characters such as, single quotes, double quotes, backslashes, NULL, etc. that must be escaped before being inserted. The addslashes() function does just that using this syntax:

Java:The Pitfalls of Inheritance Part-2

Fadıl

Listing 3 A Simple inheritance model

Following this example, we would do the following to create an instance of the Car object:

//create a new instance of the Car object

Car car = new Car();

In this, the instance variable of the Car class named model and also the instance variable registration of the super class Vehicle both will get initialized to their default values. By default, the Java Virtual Machine will allocate enough space for all the instance variables of the Objects own class and all the instance variable in all its super classes. Do not forget that in Java you can have multi-level inheritance, that is a Car IS A Automobile IS A Vehicle. In such cases, the same initialization mechanism will be followed. The initialization chain finally leads to the java.lang.Object class as all the classes in Java implicitly inherits from the Object class.

PHP Function:  Built-in Functions part 11

PHP Function: Built-in Functions part 11

Fadıl

Session-Handling Functions
Session handling is a way of holding on to data as a user navigates your Web Site. Data can be variables or entire objects.

session_start()
The session_start() function starts a session if one has not already been started, or it resumes a session if the session ID is present for the user. This function takes no arguments and is called simply by placing the following at the beginning of your code:

Java:The Pitfalls of Inheritance Part-1

Fadıl

In Object Oriented Programming, inheritance is a commonly used mechanism to model the relationship between two types. However, modelling such relationship without realizing the impact on the overall application may result in unexpected problems. In this article, I will try to present some internal details of inheritance mechanism based on the Java language and highlight some of the problems that a developers should be aware of when using inheritance of types.