...::: Recent Updates :::...

Thursday, May 31, 2012

Database Visit Counter






Database Visit Counter

Write a Servlet which displays a message and also displays how many times the message has been displayed (how many times the page has been visited). 
  
Hint: Create a file which will update the counter each and every time the page is being loaded. 


(Using Database Connection)


Step 1: Create a database with name database.mdb , Table name dbCounter , Column name counter with type numeric and add dsn with name db_count.

Step 2: Create VisitCounter.java servlet file which can interact with database for fetching and update counter value. 


Step 3: Create WEB.XML file for Mapping Servlet file.




Wednesday, May 30, 2012

Cookies Visit Counter






Cookies Visit Counter
Write a Servlet which displays a message and also displays how many times the message has been displayed (how many times the page has been visited). 
  
Hint: Create a file which will update the counter each and every time the page is being loaded. 




(Making use of cookies)


Step 1: Create VisitPage.Java using Packages Concepts for servlet which can handle counter variable to keep a track on visits.


Step 2: Create WEB.XML file for Mapping Servlet file.



Write a Servlet which displays a message and also displays how many times the message has been displayed (how many times the page has been visited).





Write a Servlet which displays a message and also displays how many times the message has been displayed (how many times the page has been visited). 
  
Hint: Create a file which will update the counter each and every time the page is being loaded. 


(Simple Counter Variable is Used Without making use of session , cookies  or database)


Step 1: Create VisitCounter.Java using Packages Concepts for servlet which can handle counter variable to keep a track on visits.


Step 2: Create WEB.XML file for Mapping Servlet file.



Write a Servlet to display all the attributes available from headers




Write a Servlet to display all the attributes available from headers (request and context).
Hint: Make use of getHeader() to get all the related and display all the attributes available in the getHeader() function.
All the attribute:
Accept
Accept-Charset
Accept-Encoding
Accept-Language
Authorization
Connection
Content-Length
Host
Referer
User-Agent


Step 1: Create GetHeader.Java using Packages Concepts for servlet which can handle all header Attributes.


Step 2: Create WEB.XML file for Mapping Servlet file.


Monday, May 28, 2012

Write a Servlet to display all the headers available from request.



Write a Servlet to display all the headers available from request. 


Hint: display all the header content using all the header function available in the request header.


Display value for all the function:
getAuthType
getRemoteUser
getContentLength
getContentType
getHeaderNames
getMethod
getRequestURI
getQueryString
getProtocol


Step 1: Create HeaderInfo.Java using Packages Concepts for servlet which can handle all header functions.


Step 2: Create WEB.XML file for Mapping Servlet file.


Sunday, May 27, 2012

Change the above program definition implement more than one textbox and other element on the page pass them as a parameter and handle



Change the above program definition implement more
than one textbox and other element on the page pass
them as a parameter and handle

Step 1 : Create HTML Page With All Form Elements Such As         TextBox,TextArea,Radio,CheckBox,List With MultipleSelection.


Step 2 : Create GetPara.Java which can handle all this form elements and display output in proper html page.



Step 3: Create Web.INF file for Servlet Mapping.


Saturday, May 26, 2012

Write a Servlet which will display all the parameters which are passed to the servlet page.




Write a Servlet which will display all the parameters which are passed to the servlet page.

Hint: The previous page which will send the parameter should implement the method GET and the page should contain one textbox and a button. When the button is clicked the servlet page should get opened and should read the value of the textbox passed as an parameter.

Step 1 : Create Simple HTML Page With Form Elements. 


Step 2 : Create Servlet File Which GET Values from this HTML Form.


Step 3 : Create Web.XML File.





Display Hello World using Servlet and implementing Package

Display Hello World using Servlet and implementing Package

Step 1: Create HelloWorld.Java in Package Test



Step 2: Create Web.xml File in Ur Root Folder