web-design

web-design

View Answers

August 8, 2008 at 5:53 PM

Hi



package javacode;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import javax.net.*;

public class GetSession extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
HttpSession session = req.getSession(true);
res.setContentType("text/html");
PrintWriter out = res.getWriter();
String title = "Searching the Web";
String heading;
Integer count = new Integer(0);;
if(session.isNew()) {
heading = "Welcome, To GetID";
}
else {
heading = "Welcome Back";
Integer oldcount = (Integer)session.getValue("count");
if (oldcount != null) {
count = new Integer(oldcount.intValue() + 1);
}
}
session.putValue("count", count);
out.println(ServletValue.headWithTitle(title) +
"<body BGCOLOR=\"pink\">\n" +
"<h1 ALIGN=\"CENTER\">" + heading + "</h1>\n" +
"<center><H2>Information on Your Session:</H2></center>\n" +
"<TABLE BORDER=1 ALIGN=CENTER>\n" +
"<tr BGCOLOR=\"green\">\n" +
" <TH>Info Type<TH>Value\n" +
"<tr>\n" +
" <td><b>ID</b>\n" +
" <td>" + session.getId() + "\n" +
"<tr>\n" +
" <td><b>Creation Time</b>\n" +
" <td>" + new Date(session.getCreationTime()) + "\n" +
"<tr>\n" +
" <td><b>Time of Last Access</b>\n" +
" <td>" + new Date(session.getLastAccessedTime()) + "\n" +
"<tr>\n" +
" <td><b>Number of Previous Accesses</b>\n" +
" <td>" + count + "\n" +
"</table>\n" +
"</body></html>");

}
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}

August 8, 2008 at 5:55 PM

web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>



<web-app xmlns="http://java.sun.com/xml/ns/javaee";

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";

version="2.5">



<description>

Servlet and JSP Examples.

</description>

<display-name>Servlet and JSP Examples</display-name>
<servlet>
<servlet-name>getsession</servlet-name>
<servlet-class>javacode.GetSession</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>getsession</servlet-name>
<url-pattern>/jsp/GetSession</url-pattern>
</servlet-mapping>
</web-app>

------------------------------------------------

Read for more information.

http://www.roseindia.net/servlets/

Thanks.









Related Tutorials/Questions & Answers:
web design
web design   Hii.. I have to design one registration page in java... SUGGESTIONs (here i have to design captcha) submit (while clicking... how could i design that. Please help me asap Thanks a lotADS_TO_REPLACE_2
Web design program - WebSevices
Web design program  Design an HTML page to create the standard calculator. When user will click on the button, display the caption of selected button in new document
Advertisements
Web Design Training
Web Design Training  Hi, How to learn Web Design? What is the best courses in Web Design Training? Thanks   Hi, These days websites... design in PSD format, maintaining the websites etc. As a web designer you should
Web design program - WebSevices
Web design program  Design an HTML page to accept Name (text box), Address (multiline textbox), Gender (radio button), Qualification (single selection), Specialisation (multiple selection), Languages (checkbox), Submit
Web design program - WebSevices
Web design program  Create the .css file. Write different styles for table cell to assign background colour. Incorporate the style in .html file. Create a table of 4 rows, 2 columns in the .html file. Using style, change
Web design program - WebSevices
Web design program  Design an HTML page to accept information of the employee (important 5 details). Use appropriate controls. Give title â... controls using horizontal line. Design the web page with relevant background image
Web design program - WebSevices
Web design program  Accept any two numbers using text box. Provide four buttons Add, Divide, Square, and Modulus (remainder of division). On clicking corresponding button, display the relevant result in new window.  
Web design program - WebSevices
Web design program  Provide two links. Display an image in new document on clicking corresponding link. The image displayed using second link should have 3 links to open 3 different files. Note : Each image should have border
Web design program - WebSevices
Web design program  Create a dynamic page using CSS as follows. a) The text displayed using should have background color â??Brownâ?? and text color â??whiteâ??, font â?? Arial. (2 marks) b) The paragraph can be displayed
web-design - JSP-Servlet
web-design  hi, i wanted to know what is web design.. is it the servlet that we write producing the output on the web page????????  Hi... out = res.getWriter(); String title = "Searching the Web"; String heading
what is php used for in web design
what is php used for in web design  what is php used for in web design
WEB Design
WEB Design  Write a program to open the link in first frame in another frame?   Please visit the following link: Webservices Tutorials
Web design company in Delhi
Web design company in Delhi We are professional web design and development... design premium templates for your online website and web portals...; Cafe and Restaurant We design website and web applications
What are Web Design Services
What are Web Design Services The term web design looks simple that refers to arranging contents... of the customer. A perfect web design service not only enhance the traffic
Professional Web Design Services For You Web Site
Professional Web Design Services For You Web Site  ... affect the entire design of the web site.... However there are also some guidelines to the use of graphics on the web
Top 10 Web Design Tools
of people accessing the web on their handheld device, web design is no more... across the devices. The task of choosing top 10 web design tools is no longer... on handheld devices. In choosing the best web design tools we have nevertheless
Top 10 Web Design Mistakes
Blaming the web design mistakes is a common behavior when a website faces... aspects is lost. There are many philosophies on classifying the web design mistakes... design mistakes nothing is as severe as presenting the content in back foot. Web
10 Common Web Design Mistakes
10 Common Web Design Mistakes Designing a website is the most crucial part... of business deliverables and outcomes. Web design is no more of just ornamental... discussion on top 10 common web design mistakes we must understand the effectiveness
web design - WebSevices
web design  I want to use macromedia Dreamweaver for designing the web pages for my j2ee web application, But i do not know how to use Dreamweaver so please help me. Thanks
web design - WebSevices
web design  I want to use macromedia Dreamweaver for designing the web pages for my j2ee web application, But i do not know how to use Dreamweaver so please help me. Thanks
Summer Internship Program for Web Development and Web Design
Summer Internship Program for Web Development and Web Design - Rose India... and knowledge in web development and design beside introducing you with the latest... will just be the ideal option for internship programs in web development and design
Top 10 Web Design Trends
Top 10 Web Design Trends Website design is no more is just about looks... web design trends tend to evolve with change in technology and user interface... and appreciation, there have been different philosophies of web design that continued
Top 10 Web Design Principles to Follow
Top 10 Web Design Principles to Follow Usefulness, utility and responsiveness... the effectiveness of your web presence. Web design principles mainly focus on how you can better create an interactive space for your audience or users. Web design trends
Web Design Packages, Website Design Packages
an extensive range of web design solutions for all, from individuals to corporate...: HTML Basic Web Design Packages HTML Basic + Web Design Packages HTML Silver Web Design Packages
web design - Design concepts & design patterns
web design  hello sir. my quesstion is same please guide me. please reply my question .because it very urgrent. I want make header like-http://www.sigmainfotech.com.au/ this site but in this site header make in flash, I
Web Design Portfolio
Web Design Portfolio The Roseindia?s Web Designer develops Website... of the web design meets the web standard parameters. Followings are the guidelines that we follow while web design are: Usability Consistency Simplicity
Animated Web Design
Animated Web Design Animation needs the higher skill of work and experience, and animation on web not only need the art but also need the technical skills... Web page design optimization Graphic design Presentations
Corporate Web Design Services
Corporate Web Design Services The corporate website is an informative website that is operated by a business company and provides comprehensive information... and business. ADS_TO_REPLACE_1 Contact to us to our specialist corporate web designers
What is E-Commerce Web Design
What is E-Commerce Web Design...-commerce web design comes with shopping cart, product catalog and built... using our professional Web design services especially for e-commerce
Web Design Packages, Website Design Packages
Shopping cart web design Graphics/ Flash / Animation based website design... custom business web design solutions... Custom Website Design for Business Custom Website Design has become one
Web Development Services,Web Design Development Services,Website Developement Services India
Web Development Services RoseIndia.net is a specialize software firms.../server platform as well as web domain. First of all we do study and understand... information system to fulfill the requirements and design desired by the customer
Fashion Web Templates
, Croquis. The Fashion Design web templates are available in different sizes and types... templates or Fashion Flash Web designing Templates? We offer creative fashion web design templates for Models, Designers, Fashion Magazines and Modeling agencies
What is Tableless Website Design
What is Tableless Website Design The term web design refers to fine art... of the methods of designing is known as tableless web design. The tableless design... in manners that improve the accessibility of the web. Besides, tableless design
Web development - Introduction
a web site for the World Wide Web or an internet that includes web design, web... website that include Graphic design/web design, Information architecture... Web development - Introduction     
Website Migration Services The Ins And Outs Of A Popular New Trend
Website migration services are an essential part of web design these days... will be happy to know that it is easier than ever before. With web migration... of the necessary information regarding web migration A request to your
Website Designing Company India
cutting edge superior quality web design solutions to boost your business. Our skilled web designers have a long experience and amazing imagination power... website design, 3-d animation web designing, e-commerce, e-business, shopping
Web Design Packages, Website Design Packages
Custom Website Design Custom website designs means the designing... special service on custom web designing since last few years. The team of our... point, we take on the responsibilities of completing the custom web
Web Design Packages, Website Design Packages
Why Custom Website Designing? The Custom Web Designing means the designing... different. Thus to design and to develop the site according to general... website design? The answer is simple. A custom website design reflects the image
Top 10 Web Developer Tools
, content editor, web design, etc. While some categories of web tools...-rounder with Adobe web design capability, it is a perfect tool. Its fluid... and web applications. This tool is equipped with range of design and prototyping
Top 10 Web Applications
, web security, web chat, social media, SEO, web design, online education or E...When new and newer range of web based applications are virtually changing our... to choose a list of top 10 web applications. The choice is huge and similar
Domain Registration in India, Domain Name Registration India, Cheap Domain Name Registration in India
real+footer - Java Beginners
real+footer   Copyright 2010 P.A. Property | Web Design Brisbane
Spry framework for Ajax
experience for their users. It is designed to bring Ajax to the web design... Spry framework for Ajax       The Spry framework for Ajax is a JavaScript library for web designers
Web Development
design, web content development, client-side/server-side scripting, and web server... Developer Tools Top 10 Tips for Good Website Design Top 10 Web Applications Top 10 Web Design Principles to Follow Top 10 Web Development
Software Website Templates
features of software web design templates are hardware, software services, software... for the web developing company. We offer e-commerce software templates... web designs. Our Software Web templates are easily customizable to better
Website Designing and Development Company in India
that offers cutting edge superior quality web design solutions to boost your... in creating design for websites, web applications, iOS and Android applications... conversion services E-Commerce Web Design Dynamic
Website Designing and Development Company in India
that offers cutting edge superior quality web design solutions to boost your... designers are expert in creating design for websites, web applications, iOS... website design, 3-d animation web designing, e-commerce, e-business, shopping cart
Database Technology
design/web design, Information architecture and copywriting/copyediting with web... management, Quality Analysis, software testing, web administration and many other
Real Estate WebsiteTemplates
the pressure of making complex web designs. Our one stop solutions for real estate web design are as per professional guidelines. We focus on each small and big... are ready to create a professional real estate web site. If you really need
What is Web Designing
are endless through effective and efficient Web Design. Web Design is an art... Roseindia Web Design Services include: Need Analysis...What is Web Designing The Internet has redefined the borders of our modern

Ads