You are on page 1of 52

INDEX 1 ABSTRACT 2 Introduction to Organization 3 System Requirements 3.1 Software & Hardware Requirements 5 System Design 5.

2 UML Diagrams 5.2.1 Activity Diagrams 5.2.2 Class Diagrams 5.2.3 Object Diagrams 5.2.4 Use case Diagrams 5.2.5 Sequence Diagrams 5.2.6 Communication Diagrams 5.2.7 State chart Diagram 5.2.8 Deployment Diagram 5.2.9 component Diagram 5.3 Database Design 6 Coding 7 Testing 8 Screen Shots 9 Conclusion 10 Bibliography 15 18 19 10 11 14 20 20 21 25 27 43 51 2 3 4 7 8

ABSTRACT Remote User Details Tracker is an application used to track the Remote Internet visitors information of a website. It includes a visitor who is interacting with the website, visitor may be from any Geo location, and visitors may be from any IP Address. It is someone with a unique IP address who is entering a website for the first time that day or some other specified period based on this data we can track the number of visitor report on daily, weekly, monthly wise. We can also get the information of browser type like Internet Exploreror Mozilla Firefoxor Net Scape Navigator or Opera etc of user. And we can track the information related to operating system which may be a windows XP/NT/Vista, Linux, etc used by the visitor who is interacting with the website. Based this information we came to know the latest visitors, returning visitors, repeated visitors of the N/W or the website. So we can find out how many times a visitor navigates through your web site, they will only be counted once for the specified time period. This is by far the more accurate way of analyzing web site performance.

SOFTWARE REQUIREMENTS: Programming Language Web technologies Scripting Languages Web Server Database Operating System HARDWARE REQUIREMENTS: Processor RAM Hard Disk : : : Pentium IV or above 1 GB 80 GB : : : : : : JDK1.6 Servlets, JSP, HTML, XML Java Script Apache Tomcat 6.0 My SQL 5.0 Windows XP

1.1

NeoApp Profile

NeoApp develops custom software solutions for companies in a variety of industries. Since its beginning in August 2008, NeoApp has offered efficient, reliable and cost-effective solutions with good quality by implementing CMMI practices from its development facility located at Hyderabad. NeoApp has expertise in latest technologies and caters to your exacting requirements. NeoApp helps you from concept to completion of a project with full range of service offerings. Most importantly, NeoApp combines the right strategy with the right products and the right people, ensuring technical superiority, high quality deliverables and timely implementations. NeoApp supports different delivery and billing models to fit your requirements. By having NeoApp involved with your software development projects, you benefit with reduced costs and faster development cycles. To reduce the development costs NeoApp strictly adhere on reusable component model with plug and play architecture. Offshore outsourcing model became easily adoptable and has increased benefits beyond cost reductions. The offshore outsourcing with NeoApp includes full spectrum services and multi fold benefits. NeoApp, with its experience in executing offshore projects ranging from large enterprise solutions to small plug-in applications, helps customers achieve the offshore outsourcing goals. NeoApp establishes suitable project execution methodologies for each project and accomplishes offshore execution on time and on budget. NeoApp pays high importance to quality of deliverables and has mandatory quality doors in place for each project ensuring success of the overall project. NeoApp works with you from conceptualization to completion and has the required expertise to pick up the project at any stage in its life cycle. 1. Business concept and system study 2. Requirement Study 3. Design Architecture and develop specifications 4. Design the framework of the solution 5. Develop the solution 6. QA the solution against requirements 7. Continuous support for the solution 8. Develop prototypes for proof of concept 9. Engineer the solution 10. Release as per plan The team and project approach of NeoApp has resulted in above expected deliveries of projects. NeoApp works with you in refining the project at every stage and with its vast and experienced talent pool, NeoApp brings value with innovation to the project. NeoApp offers complete solutions to application maintenance requirements helping organizations to cut costs and optimize resource utilization. NeoApp performs the following tasks on a variety of technology platforms beginning with Legacy to Client Server to Browser based internet application.

1. Application Development 2. Application Maintenance 3. Application Support NeoApp with its experience in wide range technologies and ability to learn quickly help you ensuring availability of your systems to your customers. NeoApp performs systems monitoring and undertakes evolutionary development of these applications as required and deemed fit. System Requirements: 1. Function Requirements Functional requirements specify which outputs should be produced from the given inputs. They describe the relationship between the input and output of the system, for each functional requirement a detailed description of all data inputs and their source and the range of valid inputs must be specified. All the operations to be performed on the input data to obtain the output should be specified.
1.1 Inputs:

Here inputs are depends on kind of operation or transaction we are going to take. Suppose registering a member comprises feeding full details of the member. And add a new link includes all details related to link. Here inputs are nothing but these details. Every time going to do an operation you are going to see a form that shows what are the details you have to key. Searching operations like looking for an article or an officer or a member are provided. For that purpose you have to just feed corresponding ID.
1.2 Outputs:

1.

Reports: In this project one of the outputs are reports like Officers-

details, list of articles that are available, and Events report. Also we can 4

generate dynamic reports also just by querying. Every report is decorated neatly and clearly. All these reports are useful at the time of decisionmaking. These are designed in an effective way. We spend more time in testing process on these reports as to generate them accurately and effectively.
2.

Database affected: some operations show their affect on database.

Adding entities like member or links are such kind of operation. Effect of these operations is change in database data. So we can call these operations database affected operations. 2. External Interface Requirements
2.1

User Interface: After this application is deployed once in a server

and making it working properly no need of user interaction. We can administrate or manage it form remote location. Totally the user interaction is very low.
2.2

Software Interfaces: This interface requirements should specify the

inter face with other. Software which the system will use or which will use the system, this includes the interface with the operating system and other applications. The message content and format of each interface should be given.
2.3

Hardware Interfaces: Hardware interface is very important to the

documentation. If the software is execute on existing hardware or on the pre-determined hardware, all the characteristics of the hardware, including memory restrictions, should be specified. In addition, the current use and load characteristics of the hardware should be given. 3. Performance Requirements All the requirements relating to the performance characteristics of the system must be clearly specified. There are two types of performance requirements static and dynamic.

Static Requirements are those that do not impose constraint on the execution characteristics of the system. These include requirements like the number of terminals to be supported, and number simultaneous users to be supported, number of files, and their sizes that the system has to process. These are also called capacity of the system. Dynamic requirements specify constraints on execution behavior of the system. These typically include response time and throughput constraints on the system. The processing speed, respective resource consumption throughput and efficiency measure performance. For achieving good performance few requirements like reducing code, less use of controls, minimum involvement of repeated data etc., are to be followed. Each real-time system, software what provides required function but does not conform to performance of software requirements is acceptable. These requirements are used to test run time performance of software with the context of an integrated system. Functional Requirements: System should generate a HTML report to view the total number of Visitors per day for a specific page in a website. Interface Requirements: The application should run on any browser using the browser as an interface. System should connect to any database using API as an interface. System should provide authentication for user. System should support to modify the existing system as per user needs. System should maintain the database accurately without any breakdowns. System should provide the portability to run on any platform. System should be secure. Non functional Requirements:

System Requirements: Programming Language Web technologies Scripting Languages Web Server Database Operating System HARDWARE REQUIREMENTS: Processor RAM Hard Disk System Design Software design is the process through which requirements are translated into a representation of software. : : : Pentium IV or above 1 GB 80 GB : : : : : : JDK1.6 Servlets, JSP, HTML, XML Java Script Apache Tomcat 6.0 My SQL 5.0 Windows XP

Primary design is concerned with the transformation of requirements into data and software architecture. Detailed design focuses on refinements to the architectural representations that lead to detailed data structure and algorithmic representation for software. In the present project report only preliminary design is given more emphasis.

System design is the bridge between system & requirements analysis and system implementation. Some of the essential fundamental concepts involved in the design of as applications are 7

Abstraction Modularity Verification Abstraction is used to construct solutions to problems without having to take account of the intricate details of the various component sub-programs. Abstraction allows system designer to make step-wise refinements by which attach stage of the design unnecessary details annunciate with representation or implementation may be hidden from the surrounding environment. Modularity is concerned with decomposing of main module into welldefined, manageable units with well-defined interfaces among the units. This enhances design clarity, which in turn eases implementation, debugging, testing, and documentation maintaining of the software product. Modularity viewed in this senses vital tool in the construction of large software projects.Verification is fundamental concept in software design. A design is verification. It can be demonstrated that the design will result in an implementation, which satisfied the customers requirements. Some of the important factors of quality that are to be considered in the design of application are:

The software should behave strictly according to the original specification of satisfying customers requirements and should function smoothly under normal and possible abnormal conditions. This product is highly reliable, can handle any number of mails to filter. The design of the system must be such a way that any new additions to the information functional and behavioral domain may be done easily and should be adapted to new specifications. We provided this extensibility to this product. you can add any number of filters to your product in the future.

System design is the process of developing specification for the candidate system that meets the criteria established during the phase of system analysis. Major step in the design is the preparation of input forms and design of output reports in a form acceptable to the user. These steps in turn lead to a successful implementation of the system. System Design: Understanding bigger application with its external interfaces is called System Design.

Web Client

RemoteUserDetailsT racker

Remote User Details Tracker is the practice of measuring, collecting, analyzing and reporting on Visitors for the purposes of understanding how many visitors are coming to the website. Sub System Design: Understanding bigger system into smaller independent working systems is called subsystem design. Sub System Design

Web Application System

RemoteUserDetails Business Logic Sub System

Database Subsystem

Block Design

VisitorIden tifier

ResourceAccessed Information

1. VisitorIdentifier This block calculates the number of visitors visited to the website. The hits may be calculated to a particular page in the website or to the whole website for a specified time period. 2. ResourceAccessedInformation This block identifies the visited Resource accessed information. UML Diagrams: Use Case Diagrams: Use Case Diagram for admin

10

Use Case Diagram for WebApp

Sequence Diagrams: Sequence Diagram for login

11

Sequence Diagram to provide visited Resources Accessed Information

Sequence Diagram to provide Browser details

12

Sequence Diagram to provideOS details

Communication Diagram for Browser details

13

Communication Diagram for OS details

14

Communication Diagram for Remote User details

Activity Diagram for Remote User details

15

Activity Diagram for Browser details

Activity Diagram for OS details

16

Activity Diagram for Login

17

18

Class Diagram:

19

ObjectDiagram:

State chart Diagram:

Deployment Diagram:

20

Component Diagram:

Database Tables: Authentication: Field username password UserDetails: Field uid IPAddress browserType browserType date time Type int(20) varchar(20) varchar(20) varchar(20) date time Null No YES YES YES YES YES Key PK Default Extra autoincrement Type Null varchar(20) YES varchar(20) YES Key Default NULL NULL Extra

21

Coding: SERVLETS Introduction to web applications: HTTP is used by the browsers to communicate with the web servers. In place of browser we can develop our own programs using Socket API to communicate with a web server. According to HTTP the user agent/http client/browser sends a request for a resource and gets back response. According to the protocol the web server/http server sends the response with a status code. Most of the web servers are configured not to list the contents of a directory. Almost every web server provides an option of defining a list of files as welcome files. TOMCAT: Tomcat_home is a directory in which TOMCAT is installed. Ex: C:\Tomcat\Tomcat5.0 (most it look like C:\ jakarta-tomcat-5.0.19/jakartatomcat5.0.19 when you extracted zip file to C drive) Starting and Stopping Tomcat : To start Tomcat run Tomcat_Home\bin\startup.bat To stop Tomcat run Tomcat_Home\bin\shutdown.bat Tomcat requires the location in which java is installed for this we need to add set JAVA_HOME=path where jdk is installed and add set CATALINA_HOME=.. in both startup.bat and shutdown.bat. If you are not installed the tomcat, for accessing Admin and Manager we need to add

22

<role rolename="manager"/> <role rolename="admin"/> <user username=uname" password=pwd roles="admin,manager,tomcat"/> to Tomcat_Home\conf\tomcat-users.xml Tomcat is configured to listen at port no 8080. We can change the port no using configuration files.(Tomcat_Home\conf\server.xml file change <Connector port="8080 >). Request and Response formats: Request format: Initial request line header1 header2 header3 . . . Body (optional) Most of the browsers either implements http 1.0 or 1.1 protocol. According to http, initial request line contains Request method Requested resource Protocol version

23

Header is split into (1) Header name (2) Header value Ex: User-Agent : MSIE Response Format: Initial response line header1 header2 header3 . . Body In the response the server sets several heads like Server ----- Name of the server Content length ----- Length of the content MIME is standard format in which different types of contents can be placed standard format used by e-mail clients Status Codes: 1xx Informational message only 2xx Success of some find 3xx Redirects the client to another URL 4xx Error on clients part 5xx Error on servers part Standard Request Methods: GET Used to request a resource HEAD Used to request only header part POST Used to send the data from client to server ex: when we will fill the form the browser may send the data OPTIONS Used to identify the options supported by the browser PUT Used by the clients to ask the server to store the content on it

24

DELETE Used to ask the server to delete a file Diff Btw Get and Post : In our programs most of the time we will use GET or POST methods. In HTML forms we can specify the method as POST or GET When we use GET method the browser appends the form data to the URL but when we use POST method the data will not appended to the URL. Data will be placed as part of request body. In order to upload files from browser to web server we can use <INPUT Type= file> for these types of forms we need to use POST instead of GET. Web-Containers: Java soft has released Servlet and JSP specifications publicly. There are so many vendors who has provided the implementation of these specifications. All these products are known as web containers. A web application developer develops a web application using different resources like html pages, image files, servlets, jsp pages, .. Configuring web applications: Java soft has defined a standard approach for configuring web applications. Once the web application is configured we can deploy it on any of the available web containers. Steps: Create WEB_APP_ROOT directory Under WEB_APP_ROOT create WEB_INF Create classes and lib directories under WEB_INF ( place java classes in classes directory and .jar files in lib directory) Create web.xml and place it under WEB_INF

25

Create a WAR (Web Application Archive) file using java tool for this move to WEB_APP_ROOT dir and use jar cvf webapp.war . Above command places all files in webapp.war We use content paths to identify the web applications. Ex: http://localhost:8080/myweebapp1/index.html By default index.html is consider as a welcomefile. According to our application we can configure a different set of welcome files. Ex: <welcome-file-list> <welcome-file>index.jsp</welcome-file> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> </welcome-file-list> The web containers will not be sending the information about WEB_INF directory to the user agent. Even though we can place all the files under the root it is not recommended. It is not recommended to use the absolute paths of the resource in a web application. We have to use relative paths. Managing web applications in web containers: Most of the vendors provide the tools to manage the web applications. We can use these tools to upload our war files to the server and deploy them. Ex: In Tomcat Use the URL http://localhost:8080 Choose Tomcat Manager (by using uname and pwd given in config file) Choose the war file to be uploaded choose install In Web Logic Login to web logic server using admin uname and pwd Choose deployments web applications node Choose configure a new application. Choose upload the war files Select the war file place it on server , configure and deploy it Today most of the websites generates the content dynamically (when a request is send the web server, the content is generated)

26

First generation web servers are designed to serve the static content. Later on the web servers provided an option of extending its capability using CGI A CGI program or script is the one that runs external to a web server. Earlier most of the programmers have used CGI programs to generate content dynamically. The main problems with this approach are Server has to spend some time in starting a new process As web server gets too many requests the server has to create more no of processes and this reduces the performance. As scripting languages are easier than programming languages most of the web developers has started writing web applications using scripting languages. To run the perl scripts we require a program called perl interpreter. Even it is easy to develop perl scripts we need an interpreter to run them. Later on most of the web server vendors started supporting different scripting languages directly. Java soft designed an alternative for CGI programs as well as script getting executed in a web server called as a Servlet. In servlets the request send by the browser and the response send by the server will be represented as objects. While compiling the java servlets we need to set the classpath point to a jar file that contains javax.servlet and javax.servlet.http packages (in most cases the jar file will be servlet.jar or servlet-api.jar or .). Every container vendor supplies the jar files that contain javax.servlet and javax.servlet.http packages.Deploying servlets: After developing the servlet classes to deploy the servlets, Copy the servlet classes under WEB_APP_ROOT/WEB-INF/classes

27

Modify web.xml by adding the information about the servlet element as <servlet> <servlet-name>servlet1</servlet-name> <servlet-class>class of servlet</servlet-class> </servlet> <!-- mapping our servlet --> <servlet-mapping> <servlet-name>servlet1</servlet-name> <url-pattern>/serv1</url-pattern> </servlet-mapping> We can use any url pattern like * or *.do or *.xyz etc ex: <url-pattern>/*</url-pattern> To get the name of the user agent we can use stringbuffer = request.getHeader(USER_AGENT); We can get the list of all headers using Java.util.Enumuration list = request.getHeaderNames To invoke a servlet from our applications ( standalone java apps/applets/ servlet/ejb ) Establish a socket connection with web server Send http request to the server Read the response Servlets are initially designed to extend any type of server (web server/ ftp server / smtp ) but almost all the companies has implemented this technology to extend http servers.

28

In object oriented projects to eliminate redundancy we will be using class hierarchy as,

In above ex, code specific to web server in http server class, code specific to ftp server in ftp server class and code that is common to all the servers is implemented in server class. Servlet class hierarchy:

servlet

is

an

object

that

provides

the

implementation

of

javax.servlet.Servlet interface. Web container must provide one ServletConfig object to a servlet. ServletContext is also called as application object. javax.servlet.Servlet has the following methods init called by the web container after our servlet object is created. service called when the client sends the request.

29

destroy called before our servlet object is removed. A servlet life cycle has 3 stages, (a) servlet is created (b) servlet will provide the service (c) servlet will be destroyed.

getServletInfo() must return a string describing the purpose of our servlet. getServletConfig() method must return the servlet config associated with the servlet. It is the responsibility of servlet containers to create the servlet objects and destroy. <load-on-startup>10</load-on-startup> where 10 is the priority. If we use it, the web container will be created our servlet object when our application is deployed.A servlet object is created At the startup if we use load-on-startup When the initial request is send and the servlet is not yet available or Whenever it is required. Servlet object will be destroyed

30

When the web application is undeployed Whenever the server wants to remove.

The GenericServlet implemented as part of javax.servlet package provides the implementation of init method and getServletConfig method that fits almost all the servlets. javax.servlet.http.HttpServlet provides the implementation of service method. We can implement a servlet as a sub class of GenericServlet. service method of GenericServlet takes ServletRequest and ServletResponce as parameters.

HttpServletRequest and HttpServletResponce contains methods specific to http and same as with ftp. If we create a servlet as subclass of GenericServlet we may need to write common code like converting the reference of type ServletRequest, HttpServletResponce. ServletResponce to HttpServletRequest and

31

This can be eliminated by creating our servlet as a subclass of javax.servlet.http.HttpServlet. Inside the servlet containers our servlets are pointing by using reference of type javax.servlet.Servlet. Whenever a method is called on an object the JVM will start searching for the method from the class based on which the object is created. If it is not available then the method will be searched in the super class. The containers always calls the methods exposed by Servlet interface. init(ServletConfig) { init() } service(ServletRequest, ServletResponce) { service(HttpServletRequest,HttpServletResponce) } service(HttpServletRequest,HttpServletResponce) { doXXX() } The implementation of doXXX methods of HttpServlet sends an error to the user agent. To report an error from our servlets we can use response.SendError(status code) Before we start development of any solution we need to understand the business requirements and functional specifications. We can use request.getParameter to get values sumbitted using a form. Instead of using System.out for debugging its better to use log method. The data will be stored in a destination like in a log file or as database. To know the location of log file we need to read the documentation of the container. Typical sequence of steps we carry out in a servlet to process the form Read the input parameters Validate the input 32

Process the input Generate the view.

Instead of hard coding we can place the information as servlet initialization parameters or context parameters. driverManager.registerDriver(driver); con=DriverManager.getConnection(url,dbuser,dbpass); In above ex, instead of hard code we have used variables. Values of these variables can be picked up from web.xml file. ServletConfig provides the methods getInitparameter() and getInitParameterNames(). As this is implementation of GenericServlet we can call these methods in our servlet. String driver = getInitParameter("driver"); String url = getInitParameter("dburl"); Above code read the initialization parameters. In web.xml we can add the names of initialization parameters, <init-param> <param-name>driver</param-name> <param-value>oracle.jdbc.driver.OracleDriver</param-value> </init-param> <init-param> <param-name>dburl</param-name> <param-value>jdbc:oracle:thin:@localhost:1521:orcl</param-value> </init-param> If multiple servlets uses the same set of parameters instead of placing them as servlet initialization parameters we can use context parameters. <context-param> <param-name>name1</param-name>

33

<param-value>value1</param-value> </context-param> getInitparameter() available in ServletContext will be getting the initialization parameters configured as context parameters. ServletContext scon = getServletContext(); url = scon.getInitParameter(dburl) 1st line gets the reference of servlet context 2nd line gets context parameter. We can add any no of context parameters in web.xml file. The web container is responsible for reading context parameters from web.xml and places them in ServletContext. For every servlet the container is responsible for creating ServletConfig and stores the init parameters in this object. public class init extends HttpServlet { public void doGet() { HttpServletRequest req; HttpServletResponce res; out.getInitParameters(name); } public void init(ServletConfig config) throws ServletException{ System.out.println(ServletConfig.getInitParameter(name); } Above code in doGet() will be failing to get the initial parameters. To avoid this failure we need to add super.init(config) if init method is overridden. Methods like getInitParameter, getServletConfig, getServletContext, log available in GenericServlet will fail if we write code with calling super.init(). Instead of overriding init(ServletConfig) we can override init() We can store the strings as resource bundles instead of hard coding the strings in source code. Its very

34

common to submit the information using multiple forms ex: user registration form can be split-up into multiple forms.

In above ex information is gathered from the user using 3 different forms. Once the user fills the 1st page he gets the 2nd page after it is filled he gets 3rd page. Once the 3rd page filled, information will be saved in database. If the protocol is designed to remember what is done earlier by the client then it is called as stateful protocol otherwise it is called as stateless protocol. ** Http 1.0 as well as Http 1.1 is stateless protocols. If we have application with multiple forms the web server will be able to give the information submitted in the current form, it will not be able to give us the info submitted earlier.A web application can use following techniques to remember the state of the client. Hidden Fields Cookies Sessions using cookies Sessions using URL rewriting. We can use <input type= hidden name=n1 value=v1> as part of our html forms. Browser will not be developing the info about the hidden fields. If there are too many no of forms more amount of N/W traffic will be generated if we use hidden fields. Cookie is a piece of info set by the server on the client using

35

http. We can use response.setCookie() to set a cookie on a browser, to get the cookies we can use request.getCookie() Steps to set cookie: Create a cookie object cookie c1 = new cookie(name, value) Add the cookie response.addCookie(name) Cookies are mainly used to serve personalized content according to user requirement. Visitor Identifier.java

import java.sql.SQLException; import java.util.*; public class VisitorIdentifier { DBStorage db = new DBStorage();

public ArrayList getVisitorCountList(long dt) throws SQLException { Collection col = (Collection) db.getUserList(dt); Iterator it = col.iterator(); HashMap hm =null; ArrayList al = new ArrayList();

36

for (int j = 0; j <=24; j++) { hm = new HashMap(); al.add(j, hm); } int count = 0; while (it.hasNext()) { HashMap hmk =null; UserDetails udd=(UserDetails)it.next(); Calendar ca = Calendar.getInstance(); ca.setTimeInMillis(udd.getTime().getTimeInMillis()); int hour=ca.get(Calendar.HOUR_OF_DAY); hmk=(HashMap)al.get(hour); if(hmk.containsKey(udd.getIPAddress())) {

Integer x=(Integer)hmk.get(udd.getIPAddress()); if(x.intValue()!=0) { int y =x.intValue()+1; hmk.put(udd.getIPAddress(), y); }

37

else { int y =x.intValue()+1; hmk.put(udd.getIPAddress(), y); x=y; } if(x.intValue()==1) count++; } else { hmk.put(udd.getIPAddress(),1); } } al.add(25, count);

return al; }

public ArrayList getBrowserTypeCountList(long dt) { Collection col = (Collection) db.getUserList(dt);

38

Iterator it = col.iterator(); ArrayList al = new ArrayList(); for (int j = 0; j < 24; j++) { al.add(j, new Integer(0)); } while (it.hasNext()) { UserDetails ud = (UserDetails) it.next(); Calendar ca = Calendar.getInstance(); ca.setTime(ud.getTime().getTime());

int count = 0; int i = 0;

i = ca.get(Calendar.HOUR_OF_DAY); count = (Integer) al.get(i); count++; al.set(i, count); } return al; } public ArrayList getOSTypeCountList(long dt)

39

{ Collection col = (Collection) db.getUserList(dt); Iterator it = col.iterator(); ArrayList al = new ArrayList(); for (int j = 0; j < 24; j++) { al.add(j, new Integer(0)); } while (it.hasNext()) { UserDetails ud = (UserDetails) it.next(); Calendar ca = Calendar.getInstance(); ca.setTime(ud.getTime().getTime());

int count = 0; int i = 0;

i = ca.get(Calendar.HOUR_OF_DAY); count = (Integer) al.get(i); count++; al.set(i, count); } return al; }

40

} Browsserservlet.java import java.io.*; import javax.servlet.*; import java.util.*; import javax.servlet.http.*; import java.sql.*; public class BrowserCountServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException { HttpSession session=request.getSession(); String date=request.getParameter("date"); StringTokenizer st = new StringTokenizer(date,"/"); Calendar c =Calendar.getInstance(); Integer [] d =new Integer[3]; int i=0; while(st.hasMoreTokens()) { d[i]=Integer.parseInt(st.nextToken()); i++; } c.set(d[2],d[1]-1,d[0]); long l= c.getTimeInMillis(); response.setContentType("text/html"); PrintWriter out=response.getWriter();

41

try{ out.println("<html>"); out.println("<head>"); out.println(" <style type="+"text/css"+">"); out.println("body{font-family:verdana,arial,sans-serf;fontsize:10pt;margin:30px;"); out.println("background-color:CYAN;}</style>"); out.println("</head>"); out.println("<body>"); out.println("<table><body><a href='Reports.html'><font color='blue' size='4'>Back To Reports</font></a></body></html>"); out.println("<table border='1' align='center' width='30%'>"); out.println("<center><font Date:"+date+"</font></center>"); RUDTManager rm=new RUDTManager(); ArrayList al = rm.getBrowserTypeCountList(l); out.println("<h4><font At:</font></h4>"); for (int time = 0; time < 24; time++) { out.println("<tr>"); out.println("<td align='center'> " + time + "o'clock are \t\t\t:" + al.get(time)); out.println("</td>"); out.println("</tr>"); } out.println("</table>"); out.println("</body>"); size='4' color='blue'>Browser Count color='blue' size='4'>Requested

42

out.println("</html>");

} catch(Exception e) { System.out.println(e); } }} Testing: Testing is the major quality measure employed during the software engineering development. Its basic function is to detect error in the software. Testing is necessary for the proper functioning of the system. Testing has to be done at four levels: Unit Testing: Unit testing focuses verification effort on the smallest unit of the software, design the module. Here, using the detail design as a guide, important control paths are tested to uncover errors within the boundary of the module. Unit testing is always white-box oriented, and the step can be conducted in parallel for multiple modules. . Integration Testing: Integration testing is a systematic technique for constructing the program structure while at the same time conducting tests to uncover errors, associated with interfacing .The objective is to take the unit tested modules and build program structure that has been directed by the design.

Validation Testing: Validation testing demonstrates the traces the requirements of the software. This can be achieved through a series of black box tests. System Testing: System testing is actually a series of different tests whose primary purpose is to fully exercise the computer-based system. Although each test has a different purpose, all works should verify that all system elements have 43

been properly integrated and perform allocated functions. The various tests include recovery testing, stress testing, and perform testing.

Maintenance and implementation: 1. Corrective maintenance: This acts to correct errors that are uncovered after the software is in use. 2. Adaptive Maintenance: This is applied when changes is the external environment precipitate modifications to software. 3. Preventive maintenance: This improves future maintainability and reliability and provides basis for future enhancements. Criteria Satisfied by Test Cases: Test cases that reduced by a count that is greater than one, the number of additional test cases that much be designed to achieve reasonable testing. Test cases that tell us something about the presence or absence of classes of errors, rather than an error associated only with the specific test at hand.

44

Screen shots:

45

46

47

48

49

50

Conclusion Finally I conclude that Remote User Details Tracker is an application used to track the Remote Internet visitors information of a website. It includes a visitor who is interacting with the website,finding of browser details and OS details. So we can find out how many times a visitor navigates through your web site, they will only be counted once for the specified time period. This is by far the more accurate way of analyzing web site performance.

51

Biliography Basic Java Concepts : Thinking in JAVA

( Bruce Eckel ) Java Mail API : Wrox Publications Volume I and II An Integrated Approach to Software Engineering : Introduction to System Analysis and Design For UML diagrams Some preferred websites : : : I.T.Hawryszkiewycz UML in 24 Hours Book Pankaj Jalote

www.bruceeckel.com www.sun.com/j2ee/mailapi www.sun.com/j2se

52

You might also like