Thursday, August 22, 2013

Basic Lesson 10:-Beans and Form processing in jsp

Forms are a very common method of interactions in web sites.  JSP makes forms processing specially easy.
The standard way of handling forms in JSP is to define a "bean".  This is not a full Java bean.  You just need to define a class that has a field corresponding to each field in the form.  The class fields must have "setters" that match the names of the form fields.  For instance, let us modify our GetName.html to also collect email address and age.
The new version of GetName.html is
<HTML>
<BODY>
<FORM METHOD=POST ACTION="SaveName.jsp">
What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
<P><INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>

Basic lesson 11:- Controllers in jsp

Sometimes, some pre-processing needs to be done after the user has submitted a form. The result of this pre-processing decides where the control flow should go next. Such pre-processing code is frequently referred to as a "controller".
JSPs are very highly suited for writing simple controllers. For more complex controller logic, JSPs can easily call Java code in other classes. A sample controller is shown below:


<jsp:useBean id="user" class="user.UserData" scope="session"/>
<jsp:setProperty name="user" property="*"/>

Basic lesson 12:-Tag Libraries in jsp

JSP 1.1 introduces a method of extending JSP tags, called "tag libraries".  These libraries allow addition of tags similar to jsp:include or jsp:forward, but with different prefixes other than jsp: and with additional features.
To introduce you to tag libraries, in this tutorial we use the Blazix tag library as an example.  This tag library comes bundled with the Blazix server. If you are not using the Blazix Server, you may just want to review the material to get familiar with the syntax, and continue on to the next page.
Each tag-library will have its own tag-library specific documentation.  In order to use the tag library, you use the "taglib" directive to specify where your tag library's "description" resides.  For the Blazix tag library,  the (recommended) directive is as follows
<%@ taglib prefix="blx" uri="/blx.tld" %>
The "uri" specifies where to find the tag library description.   The "prefix" is unique for the tag library.  This directive is saying that we will be using the tags in this library by starting them with blx:
The Blazix tag library provides a blx:getProperty tag.  This tag can be used to allow the user to edit form data.  In our GetName.jsp file, we will now add a jsp:useBean and place the form inside blx:getProperty.
The new GetName.jsp is

Basic lesson 13:-Techniques for Form Editing in jsp

A tag library such as the one that comes with the Blazix server, may not be available in your environment.  How can you allow similar features without using a tag library?
It is a little tedious, but it can be done.  Basically, you must edit each HTML tag yourself, and put in a default value.  The following examples shows how we modify GetName.jsp to provide features similar to blx:getProperty but with manual HTML tag editing:
<jsp:useBean id="user" class="user.UserData" scope="session"/>

basic lesson 14:Protecting your website with a login page


Some sites require that all users log-in using a username and password, before being able to visit any page.
This can be done using JSP sessions or servlets, and in fact this was a common technique for a while.  But starting with a new release of Servlets specifications (2.2) from Sun, this feature is now very simple to implement.

It is no longer necessary to use JSP techniques to provide login/password protection, but it is still a very common requirement of web-sites, therefore a brief overview is provided here.

To password-protect your site, you just need to design a login page.  This page can be as simple or complicated as you need it to be.  It must contain a <FORM> tag, with the METHOD set to POST and the ACTION set to "j_security_check".

<FORM METHOD=POST ACTION=j_security_check>

Friday, January 11, 2013

21 Effective Quotation of Swami Vivekananda-The most practical spritual guru


1.    If the mind is intensely eager, everything can be accomplished—mountains can be crumbled into atoms.

2.    Take up one idea. Make that one idea your life – think of it, dream of it, live on idea. Let the brain, muscles, nerves, every part of your body, be full of that idea, and just leave every other idea alone. This is the way to success.

3.    Come out into the universe of Light. Everything in the universe is yours, stretch out your arms and embrace it with love. If you every felt you wanted to do that, you have felt God.

50 thoughts from Swami Vivekananda as the nation celebrates his 150th anniversary



 The world’s most practical spiritual guru, Swami Vivekananda. He needs no introduction, and his name is synonymous with spirituality, modernity, and above all, humanity. To commemorate the 150th birth anniversary of Swamiji on January 12, 2013, the entire nation is getting set to celebrate and spread his humanitarian work across the globe.


  1. Man comes from God in the beginning, in the middle he becomes man, and in the end he goes back to God.
  2. He is an Acharya through whom the Divine Power acts.
  3. According to Karma Yoga, the action one has done cannot be destroyed, until it has borne its fruit; no power in nature can stop it from yielding its results.

Monday, November 12, 2012

Class 9 Chandigarh student's drawing will be the Google doodle on November 14

Google India has announced Arun Kumar Yadav, a class 9 student of Kendriya Vidyalaya from Chandigarh, as the winner of the Doodle4Google 2012 competition.

The winning Doodle titled'India - A Prism if Multiplicity'will go live on the Google (India) homepage on November 14, National Children's Day. The Doodle will also be featured on a special color pack and drawing book by Classmate.

It would be something like this:

Thursday, November 8, 2012

2012 PHENOMENON

The 2012 phenomenon comprises a range of eschatological beliefs according to which cataclysmic or transformative events will occur on 21 December 2012. This date is regarded as the end-date of a 5,125-year-long cycle in the Mesoamerican Long Count calendar. Various astronomical alignments and numerological formulae have been proposed as pertaining to this date, though none have been accepted by mainstream scholarship.

A New Age interpretation of this transition is that this date marks the start of time in which Earth and its inhabitants may undergo a positive physical or spiritual transformation, and that 2012 may mark the beginning of a new era. Others suggest that the 2012 date marks the end of the world or a similar catastrophe. Scenarios suggested for the end of the world include the arrival of the next solar maximum, an interaction between Earth and the black hole at the center of the galaxy, or Earth's collision with a planet called "Nibiru".
Scholars from various disciplines have dismissed the idea of such cataclysmic events occurring in 2012. Professional Mayanist scholars state that predictions of impending doom are not found in any of the extant classic Maya accounts, and that the idea that the Long Count calendar "ends" in 2012 misrepresents Maya history and culture. Astronomers and other scientists have rejected the proposals as pseudoscience, stating that they conflict with simple astronomical observations and amount to "a distraction from more important science concerns, such as global warming and loss of biological diversity


Thursday, November 1, 2012

Procedure for selecting the candidates who are eligible to appear for JEE (Advanced) – 2013.


The following procedure will be used for selecting the 1,50,000 candidates who will be eligible to appear for JEE (Advanced)- 2013 based on their performance in JEE (Main) -2013.
  • 50.5% of the 1,50,000 (75,750 candidates) will be taken from the top rankers of the Common Merit List (CML) of JEE (Main). 27% (40,500), 15% (22,500) and 7.5% (11,250) candidates will be taken from the top rankers of the category rank lists of OBC-NCL, SC and ST, respectively. The candidates figuring in the category rank lists will be those who do not figure in the 75,750 candidates chosen from the CML.
  • 3% of the candidates selected within each category will be those belonging to PwD (Persons with Disability) sub-category, who figure in the respective rank lists of JEE (Main).
  • Only the candidate’s aggregate marks in JEE (Main) will be considered and no tie-break mechanism will be implemented at this stage. This will make the list of candidates eligible to appear in JEE (Advanced)-2013 slightly more than 1,50,000 due to bunching of candidates with the same aggregate marks at the bottom of each category.


BEST OF LUCK TO ALL OUR READERS