Monday, June 16, 2008

JSP Reference

For Reference
--------------

JWS ---> For Testing Purpose
JSP engine ---> Process jsp file

Java Web Sever
---------------
set path =C:\JWS

C:\ jserv -nojre -javahome C:\Jdk1.3

Methods --------> Get ,Post

Get is used to send small amount of data .No Security
In get method all data are in querystring(Enviornment variable--> To send data from Client to server) this are added at the end of requested URL

If method is post all data from user is stored in STDIN (Enviornment variable--> To send data from Client to server) ,high security not visible to client .The data is passed through socket.


The data from Server to Client
------------------------------
Response ----- Response Header ,Response Data ,Status code


Status code ----Result of request

Eg : 404 ---Not found
200----Sucess
500----Internal server (Error prblm with server side pgm)



XML IS FOR DATA STORAGE
MIME -Multipurpose Internet Mail Extension

JSP TAGS
---------
Directives
Scripting Elements
a) Declarations b) Scriplets c) Expression
Actions
Comments

Directives
----------

<%@ page import= "Java.util.*"%> --To import JSP package
<%@ page contentType="text/html"%>
<%@ page language ="java"%>
<%@ page isErrorpage ="true"%>

Directives gives Global information about JSP Pages

------------------------------
Syntax For JSP

1) ASP like Syntax
2) XML syntax


ASP Syntax
----------
<%@ page import="java.util.*"%>

XML syntax
-----------
JSP:directive.page import="java.util.*"

--------------------------------------------------------------
jsp:forward page="abc.jsp"


Actions
--------
jsp:plugin ------ is to download applets >
jsp:usebean ------ is action tag used to create object of java beans >


Example --------- Closing and opening Tags should be added
---------

html
jsp: plugin type ="applet" code="audio.class" width =230 height = 500
jsp: fall back> cannot download applet jsp:fallback
jsp:plugin>
html


Session ------> Represents an user (browser) Creates session ID


Comments
---------

1) (HTML) --- Process at Client Side
2) <%---'Contents'---------> (JSP) --- Process at Server Side
3) Java like
a) // b) /* */


Session Tracking (To identify Client )
----------------

1) User authentication
2) Hidden Fields
3) URL Rewriting
4) Cookies


Command for starting J2EE
> j2ee -verbose
> j2ee -stop ------> To stop

Set Path java_home=d:\jdk\bin

*.jar --------> jar archive (zip like file of java ) (Collection of Class file)

Example
---------
<%@page import ="java.sql.*"%>
<%@page import ="sun.jdbc.odbc.JdbcodbcDriver"%>
---- 3 interfaces connect,statement,Result set
<% Connection con =null // Store actvie db connect Statement st =null; //used for parsing sql command Result set rs =null // Storing db result %>

---Html Codes in this outprintln-------");
out.println("
Employee No.
");
while (rs.next())
{
out.println("
");
out.println("
" + rs.getString("empno")+ "....");
out.println("");
rs.close();
st.close();
con.close();
}
%>
--->

Wednesday, June 11, 2008

PC Tricks -Part One

1) function shw9n0{if(self.moveBy){for(i=35;i>0;i--}{for(j=n;j>0;j--){self.moveby

Type this Code in the Address bar of Internet Explorer

2) TRY -------> Win+L (Lock windows)

3) If u rename a picture to folder.jpg that will be the thumbnail for that folder .check the change in Customize tab in the properties of that particular folder

4)While dragging a file , Hold Crtl to force Copy ,Hold shift to force move ,hold alt to make shortcut

5)While switching to Thumbnail press shift key to hide the name of all files and folders and vice-versa



6) Try to rename a folder with 'Con'.

7) Rename a folder by ALT+[any number or character]

8) To Run Network Diagnostics

Run ---> cmd
c:\netsh diag gui

Tuesday, June 10, 2008

Awaken Children

In someparts of India ,especially in Tamil nadu ,people eat the extremely bitter (margosa ) flower on New Years Eve. There is another celebration at the end of the year called Pongal ,on the day the sun touches the tropic of Capricorn .On this day ,people traditionally chew sugarcane. There is a great deal of symbolism in all Hindu celebrations .In these two particular examples ,chewing the bitter neem flower symbolizes the acceptance of lifes bitter experience from the very first day of life .life involves many hardships & msifortunes.We should learn to accept & even welcome them wholeheartedly,to be patient ,enthusiatistic and optimistic never allowing ourselves to mentally weak or disappointed .Only then can we progress towards the real goal of life-the sweet bliss and joy of immortality .this is symbolized by eating sugarcane at the end of the year.

Source : Awaken Children

Saturday, May 24, 2008

Nice Quotes

One Week Before I accidentally read a book when i have nothing to do (because there was no electricity :) ) ,the book was

The Eye of God (English Edition Translated by Githa Krishankutty)
by Np Muhammad

There are many quotes in the book but according to me most valuable and striking quotes where

Do you know where Heaven is ? ."It is somewhere in the sky.
" I said and pointed upwards .No you fool Heaven is under ummas feet

To Size a Picture into Passport Size Photo in Photoshop

How to Size a Picture into Passport Size Photo in Photoshop

Easy way is pressing Alt+Ctrl+I and change what you want in image box. if you want to change canvas size pressing Alt+Ctrl+c ,you can select a part of picture with selection tools and then press Ctrl+c (Copy) then open a new window with pressing Ctrl +n and then paste selected area to this new window in this way after you open new window will ask you size and resolution .Then proceed