SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Web ProgrammingTutorial First Week2011BINUS UNIVERSITY INTERNATIONALRaisa Anjani - 1301027504Anthony Herlambang - 130102758004PAC<br />Web Programming 1st Week<br />After learning about Java language in Object Oriented Programming and Object Technology, now in Web Programming we learn further about how to build website using JSP. JSP (Java Server Pages) is a programming language that gives software developers the capability of generating dynamic website based on HTML, XML, or other document types. It was released in 1999 by Sun Microsystems as the contender of ASP and PHP. JSP is powerful programming language because it conveys all the advantages that Java has, such as: having rich library, simple, object oriented, secure, architecture neutral and portable, high performance, interpreted, threaded, dynamic and many more. <br />For us that have been learning Java previous semester, JSP will be easier to understand rather than ASP or PHP because we already familiar with the concept of object and Java syntax. On the other hand, non-programmers tend to choose PHP for creating dynamic website because of its simplicity compared with JSP (in order to use JSP we should have knowledge in Java language and Object Oriented Programming). Because the PHP users mostly do not have programming backgrounds, they tend not to concern about security. As a result the website becomes vulnerable. While for ASP, it is launched by Microsoft in 1996 with .asp or .aspx extension. Pages with the .aspx extension use compiled ASP.NET which makes them faster and more robust than server-side scripting in ASP. Programmers write most ASP pages using VBScript, Jscript, and PerlScript.<br />That is a brief discussion about PHP and ASP. Now before we get deeper about how to create JSP pages, there are several environment and tools setup that must be fulfilled. This is the list of software that user must have in order to build JSP based website:<br />1.-3111535560 Java Development Kit (JDK)2.16510114300NetBeans IDE 6.9.1 3.1651052070Apache Tomcat <br />JSP pages will be built using NetBeans IDE and run under Apache Tomcat server. JDK from Sun Microsystems will enable us to compile and run Java based application in our computer.<br />Installing JDK (Java Development Kit)<br />Download the latest JDK on http://www.oracle.com/technetwork/java/javase/downloads/index.html <br />Look for Java SE 6 Update 24, and then choose Download JDK.<br />694771-334370<br />Run the installer and follow the steps until the installation is finished.<br />Installing NetBeans and Apache Tomcat<br />Download NetBeans 6.9.1 on http://netbeans.org/downloads/index.html  <br />You will see various choices of NetBeans IDE Download Bundles, choose All.<br />After finished downloading, run the installer and select customize.<br />Search for Apache Tomcat 6.0.26 and tick it.<br />Press ok and finish the installation. Now you will have NetBeans and Apache Tomcat installed in your laptop.<br />For more information about installing NetBeans 6.9.1 you may go to this link:<br />http://netbeans.org/community/releases/69/install.html<br />-31750* The latest Apache Tomcat which is version 7.0.11 is not yet compatible for NetBeans 6.9.1, so it is better to install Apache Tomcat from NetBeans 6.9.1 installer which will automatically integrate Tomcat in your NetBeans.<br />Starting and Stopping Apache Tomcat<br />To start Tomcat, first open NetBeans, go to Services tab, and then choose Servers. You will see Apache Tomcat 6.0.26 in the list, right click on it then select Start.<br />To stop Tomcat, first open NetBeans, go to Services tab, and then choose Servers. You will see Apache Tomcat 6.0.26 in the list, right click on it then select Stop.<br />-5905596520*In the server list you may see two different servers which are Apache Tomcat and GlassFish. In Web Programming we use Apache Tomcat server. Their main difference is Apache Tomcat used for general web application whereas GlassFish is used for enterprise application.<br />Testing Apache Tomcat<br />To test whether the server has been run or not:<br />Make sure your Tomcat is running then open your web browser.<br />Type http://localhost:8084/ in the URL bar. If the server is running, the browser will show the page below.<br />When you host your web pages in a server like Apache Tomcat, you can access other data in the different computer using static routing.<br />How to do static routing and connect 2 computers?<br />Connect both computers using crossover cable.<br />*Image from http://www.aboutonlinetips.com/how-to-setup-home-network/<br />*Image from http://dhika.cikul.or.id/crossover-ethernet-cable.html<br />To create cross cable you first create normal configuration (T-568A), then for the second RJ-45 you switch cable 1 with 3 and cable 2 with 6 (T-568B).<br />In both computers open Control Paneletwork and Internetetwork and Sharing Center. Then choose Local Area Connection.<br />Choose properties.<br />Then choose Internet Protocol Version 4 (TCP/IPv4), click on properties.<br />Then select use the following IP address and fill as below to computer 1.<br />For computer2 the configuration is as below.<br />Press OK.<br />Open command prompt and try to ping other computer by typing ping 192.168.0.2; from computer1. If the packet is successfully sent, then the connection is already built.<br />Now you can access computer2’s JSP pages by typing http://192.168.0.2/application name/ on the web browser. <br />NetBeans vs. EditPlus and other text editor<br />             <br />There are some differences in case of coding JSP in the NetBeans IDE and EditPlus or other text editor.<br />In NetBeans when you build a Web Application project, all your needs will be provided by NetBeans automatically. The XML file is one of the examples.<br />NetBeans automatically start Apache Tomcat and link it to your application that uses Tomcat as a server by compiling and running the application.<br />When you code it in EditPlus and other text editor, you have to do all configurations manually. And of course you also have to set up your application in order to connect it to the server.<br />Web Browser<br />Web browser is program that is used for retrieving and presenting information in form of web page that is identified by Uniform Resource Identifier on the World Wide Web. Web page contains hyperlinks that enable users to navigate the browser easily to the related resources.<br />Besides accessing World Wide Web, browser can also used to access information provided by the web server in private networks or file systems such as our own-made HTML page.<br />Web Server<br />A web server is referred to both hardware and software that helps to deliver content that can be accessed through the Internet. Its primary function is to handle request and respond of the client by delivering web pages in form of HTML documents on request of the client (which commonly a web browser). Because you never know when user will visit and use your web application, web server must be up and running all the time.<br />Request and Response<br />*referenced from Java for the Web with Servlets, JSP, and EJB: A Developer's Guide to J2EE Solutions<br />When you type URL in the Address box of your browser, the following things happens:<br />The client browser establish a TCP/IP connection to the server <br />The browser send request to the server<br />The server send respond to the client (web browser)<br />The server closes the connection<br />164084085090<br />*Image from http://www.cs.uregina.ca/Links/class-info/215/Webpage/<br />HTTP *referenced from Java for the Web with Servlets, JSP, and EJB: A Developer's Guide to J2EE Solutions.<br />HTTP is the protocol that allows web servers and browsers to exchange data over the web. It is a request and response protocol. The client requests a file and the server responds to the request. HTTP uses reliable TCP connections—by default on TCP port 80.<br />In HTTP, it's always the client who initiates a transaction by establishing a connection and sending an HTTP request. The server is in no position to contact a client or make a callback connection to the client. Either the client or the server can prematurely terminate a connection. For example, when using a web browser you can click the Stop button on your browser to stop the download process of a file, effectively closing the HTTP connection with the web server.<br />HTTP Requests<br />An HTTP transaction begins with a request from the client browser and ends with a response from the server. An example of an HTTP request is the following:<br />GET index.jsp HTTP/1.1 <br />Host: localhost <br />GET is the request method; index.jsp represents the URI and HTTP/1.1 the Protocol/Version section.<br />HTML<br />In order to get better understanding of JSP, first we will look into HTM. HTML (Hypertext Markup Language) is the basic building blocks for website. It is written in the form of HTML elements consisting of tags that are enclosed in angle brackets <HTML>. HTML uses markup tags to describe web pages. HTML tags normally come in pairs like <BODY> and </BODY>. The first tag is the start tag, the second tag is the end tag (they are also called opening tags and closing tags).<br />W3schools is a website that provides an online HTML tutorial. You may learn the basics of HTML and other web related language such as PHP, ASP, CSS, and many more.<br />Here is the link of w3schools for learning HTML: http://www.w3schools.com/html/default.asp. <br />45593013335<br />To create a HTML documents you simply create new text file, and name it with .html or .htm extension. You may open the file using web browser such as: Google Chrome, Mozilla Firefox, Opera, Safari, Internet Explorer, etc. <br />Browsers are able to read HTML documents and display them as web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page. Here are some of the basic tags to create HTML documents:<br /><html><head><title>My Web Page</title></head><body><h1>Heading1</h1><p>Paragraph</p></body></html><br />All the HTML documents should start with <HTML> tag and end with </HTML>. The head element is a container for all the head elements. Elements inside <head> can include scripts, instruct the browser where to find style sheets, provide meta information, and more. The body is where we declare all our web content.<br />Here, we will briefly discuss 2 basic HTML functionalities: HTML Table and HTML form. The rest of it you may learn it as the lesson goes.<br />HTML Table*referenced from w3schools.com<br />Tables are defined with the <table> tag. A table is divided into rows <tr>, and each row is divided into data cells <td>.tr stands for “table row” and td stands for quot;
table data”. <br /><table border=quot;
1quot;
><tr><td>row 1, cell 1</td><td>row 1, cell 2</td></tr><tr><td>row 2, cell 1</td><td>row 2, cell 2</td></tr></table><br />How the HTML code above looks in a browser:<br />row 1, cell 1row 1, cell 2row 2, cell 1row 2, cell 2<br />HTML form*referenced from w3schools.com<br />HTML forms are used to pass data to server. A form can contain input elements, select list, text area, field set, legend, and label elements<br />Input elements:<br />Text fields<br />Checkboxes<br />Radio-buttons <br />Submit buttons <br />Etc.<br />The <form> tag is used to create an HTML form.<br /><form method=quot;
getquot;
 action=quot;
html_form_action.aspquot;
>Username: <input type=quot;
textquot;
 name=quot;
userquot;
><input type=quot;
submitquot;
 value=quot;
Submitquot;
></form><br />The method attribute specifies how to send form-data (the form-data is sent to the page specified in the action attribute).The form-data can be sent as URL variables (with method=quot;
getquot;
) or as HTTP post (with method=quot;
postquot;
).<br />Method specifies the How the HTML code above looks in a browser:<br /> Top of FormBottom of Form<br />The form itself is not visible. Also note that the default width of a text field is 20 characters. *More details implementation of form will be discussed in the exercise.<br />Building your first JSP page<br />Open your NetBeans and choose File  New Project. Click on Java Web then choose Web Application. Click next.<br />Fill the project name (in this case MyFirstJSP) and determine your saving location. Click next.<br />Choose Apache Tomcat as the server and Java EE 5 version. Click next.<br />Leave all empty and click finish.<br />Below is your first JSP will look like. You may find your JSP page under directory Application Name/Web Pages or in this case MyFirstJSP/Web Pages. Then you may start to build and modify the JSP page.<br />To compile and run it press Shift+F6.The JSP pages will be shown on your browser like below.<br />-34290395605*For the Java EE Version you may see 2 different versions which are Java EE 5 and J2EE 1.4. Java EE 5 is the newer version of J2EE 1.4. It has more APIs and functionalities than the latest J2EE.*The name of the Java platform for the enterprise has been simplified. Formerly, the platform was known as Java 2 Platform, Enterprise Edition (J2EE), and specific versions had quot;
dot numbersquot;
 such as J2EE 1.4. The quot;
2quot;
 has been dropped from the name, as has the minor revision number. So the next version of the Java platform for the enterprise is Java Platform, Enterprise Edition 5 (Java EE 5).<br />EXERCISE<br />Now after you understand the basic of HTML and JSP, we will create login page and examine the parameter.<br />Modify My First JSP into a login page that looks like below in the browser:<br />When user press OK button, it will check the username and password. If it is correct it will redirect to welcome page and show Welcome (name), otherwise it will show INVALID.<br />In this example, the valid value for username is “user” and password is “user”.<br />CORRECT PASSWORD<br />Username: user Password: user<br /> <br />WRONG PASSWORD<br />Username: user Password: apple<br />Solution:<br />index.jsp<br />Code:<br /><html>    <head>        <title>JSP Page</title>    </head>    <body>        <form method=quot;
getquot;
 action=quot;
Welcome.jspquot;
>            Username:<input type=quot;
textquot;
 name=quot;
userquot;
><br/>            Password:<input type=quot;
passwordquot;
 name=quot;
passquot;
><br/>            <input type=quot;
submitquot;
 value=quot;
Submitquot;
>        </form>    </body></html><br />To create a login form, you use form and input tag in the BODY of index.jsp as shown above and below are the explanation of the form and input attributes.<br />This will be name of this formData will be sent to Welcome.jsp<br /> <form name=quot;
inputquot;
    action=quot;
Welcome.jspquot;
 method=quot;
getquot;
><br />            Name: <input type=quot;
textquot;
 name=quot;
userquot;
><br/><br />            Password: <input type=quot;
passwordquot;
 name=quot;
passquot;
><br/><br /><input type=quot;
submitquot;
 value=quot;
Submitquot;
><br /></form><br />27305125730<br />“method=” specify how to send form-data (the form-data is sent to the page specified in the action attribute).The form-data can be sent as URL variables (with method=quot;
getquot;
) or as HTTP post (with method=quot;
postquot;
).<br />“action=”redirect page to specified path.<br />“type=” specify the type of input that will be shown in the browser. Below are the mostly used types:  a. text: create a text field b. password: create a text field which value is hidden from the user c. submit: create a button<br /> “value=” specify the text that will be shown on screen of a specific element (*Text Submit in submit button is caused by value).<br />“name=”the name of the elements that will be used as parameter name. (It is used for retrieving parameter value using getParameter command)<br />Welcome.jsp<br />Code:<br /><html>    <head>        <title>JSP Page</title>    </head>    <body>        <%            String user = request.getParameter(quot;
userquot;
);            String pass = request.getParameter(quot;
passquot;
);            if (user.equals(quot;
userquot;
) && pass.equals(quot;
userquot;
)){                out.println(quot;
Welcome quot;
 +user+quot;
 !quot;
);            }else{                out.println(quot;
INVALIDquot;
);            }        %>    </body></html><br />In the body of Welcome.jsp we process the data that we receive from index.jsp. Here is the explanation of the logic:<br />  <% symbol is used to start enclosing java code%> symbol is used to marks the end of java code and you may start to code in HTML againJava code that is enclosed by <% %> is called Scriptlet.-17145-447675  In JSP you can print words to the browser by using java code: out.print(); /out.println(); <br />The getParameter method is used to get parameter passed from index.jsp“user” will get the value of the username and “pass” will get the value of the password.<br /><%<br />String user = request.getParameter(quot;
userquot;
);<br />String pass = request.getParameter(quot;
passquot;
);<br />if (user.equals(quot;
userquot;
) && pass.equals(quot;
userquot;
)){<br />If the username and password is correct (equals to ”user”) then it will print ”Welcome (the username) !”(In this case the username is user so it will print “Welcome user!”)If username or password wrong then it will print “INVALID”.                out.println(quot;
Welcome quot;
 +user+quot;
 !quot;
); <br /> }else{<br />               out.println(quot;
INVALIDquot;
);<br />}<br />%><br />POST and GET<br />GET<br /><form method=quot;
getquot;
 action=quot;
Welcome.jspquot;
><br />     Username :<input type=quot;
textquot;
 name=quot;
userquot;
><br/><br />     Password :<input type=quot;
passwordquot;
 name=quot;
passquot;
><br/><br />     <input type=quot;
submitquot;
 value=quot;
Submitquot;
><br /></form><br />As we can see, we use form tag to pass data to server then redirect it to Welcome.jsp. GET method is used to simply retrieves the data identified by URL. It will show the parameter passed on the header so user may see it. The URL shows our username and password that we inputted before in the index.jsp<br />POST<br /><form method=quot;
postquot;
 action=quot;
Welcome.jspquot;
><br />     Username :<input type=quot;
textquot;
 name=quot;
userquot;
><br/><br />     Password :<input type=quot;
passwordquot;
 name=quot;
passquot;
><br/><br />     <input type=quot;
submitquot;
 value=quot;
Submitquot;
><br /></form><br />The other method that mostly used is POST. POST is the HTTP request method that transfers data (parameters) to the server in the entity body of the request. So, it won’t show our username or password on the URL. It usually used in the login pages where the information passed to server is confidential. Using POST method the parameter will be hidden from the user.<br />Difference between GET and POST:<br />*the table is referenced from w3schools.com<br />GETPOSTThis method appends the form-data to the URL in name/value pairsThis method is useful for form submissions where a user want to bookmark the resultThere is a limit to how much data you can place in a URL (varies between browsers), therefore, you cannot be sure that all of the form-data will be correctly transferredNever use the quot;
getquot;
 method to pass sensitive information! (password or other sensitive information will be visible in the browser's address bar)This method sends the form-data as an HTTP post transactionForm submissions with the quot;
postquot;
 method cannot be bookmarkedThe quot;
postquot;
 method is more robust and secure than quot;
getquot;
, and quot;
postquot;
 does not have size limitations<br />This explanation about POST and GET will end this tutorial. Hopefully through this tutorial you may get better understanding about the basic of JSP. Deeper explanation about JSP and Servlet will be done on the next session. Thank you.<br />
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary
Web Programming First Week Summary

Weitere ähnliche Inhalte

Was ist angesagt?

KMUTNB - Internet Programming 1/7
KMUTNB - Internet Programming 1/7KMUTNB - Internet Programming 1/7
KMUTNB - Internet Programming 1/7phuphax
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetAdil Mughal
 
Web engineering 2(lect 0)
Web engineering 2(lect 0)Web engineering 2(lect 0)
Web engineering 2(lect 0)Roohul Amin
 
internet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcainternet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcaRenu Thakur
 
Proper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersProper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersMark Myers
 
Web Server-Side Programming Techniques
Web Server-Side Programming TechniquesWeb Server-Side Programming Techniques
Web Server-Side Programming Techniquesguest8899ec02
 
PHP Basics
PHP BasicsPHP Basics
PHP BasicsRoohul Amin
 
Server side programming
Server side programmingServer side programming
Server side programmingSayed Ahmed
 
Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Amit Kumar Singh
 
Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273hussulinux
 
Intro to Dynamic Web Pages
Intro to Dynamic Web PagesIntro to Dynamic Web Pages
Intro to Dynamic Web PagesJussi Pohjolainen
 
Introduction to Web Technology
Introduction to Web TechnologyIntroduction to Web Technology
Introduction to Web TechnologyRob Bertholf
 
Jsp slides
Jsp slidesJsp slides
Jsp slidesKumaran K
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technologyvikram singh
 
Osp ii presentation
Osp ii presentationOsp ii presentation
Osp ii presentationpresse_jkp
 

Was ist angesagt? (18)

PHP
PHPPHP
PHP
 
KMUTNB - Internet Programming 1/7
KMUTNB - Internet Programming 1/7KMUTNB - Internet Programming 1/7
KMUTNB - Internet Programming 1/7
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp Net
 
Web engineering 2(lect 0)
Web engineering 2(lect 0)Web engineering 2(lect 0)
Web engineering 2(lect 0)
 
internet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcainternet programming and java notes 5th sem mca
internet programming and java notes 5th sem mca
 
Proper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersProper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino Developers
 
Web Server-Side Programming Techniques
Web Server-Side Programming TechniquesWeb Server-Side Programming Techniques
Web Server-Side Programming Techniques
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
5. HTML5
5. HTML55. HTML5
5. HTML5
 
Server side programming
Server side programmingServer side programming
Server side programming
 
Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)
 
Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273
 
Intro to Dynamic Web Pages
Intro to Dynamic Web PagesIntro to Dynamic Web Pages
Intro to Dynamic Web Pages
 
Introduction to Web Technology
Introduction to Web TechnologyIntroduction to Web Technology
Introduction to Web Technology
 
Jsp slides
Jsp slidesJsp slides
Jsp slides
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Servlet & jsp
Servlet  &  jspServlet  &  jsp
Servlet & jsp
 
Osp ii presentation
Osp ii presentationOsp ii presentation
Osp ii presentation
 

Andere mochten auch

YPT10J BENUTZERHANDBUCH
YPT10J BENUTZERHANDBUCHYPT10J BENUTZERHANDBUCH
YPT10J BENUTZERHANDBUCHjulia135
 
E-WRITE - Repurpose web content for social media - 17 mar2013
E-WRITE - Repurpose web content for social media - 17 mar2013E-WRITE - Repurpose web content for social media - 17 mar2013
E-WRITE - Repurpose web content for social media - 17 mar2013LeslieOflahavan
 
Profil Ringkas INSPIRASI BAKAT
Profil Ringkas INSPIRASI BAKATProfil Ringkas INSPIRASI BAKAT
Profil Ringkas INSPIRASI BAKATMohd Helmi Md Suhaimi
 
2012.04.05 Learning Sessions 1 - Mercury
2012.04.05 Learning Sessions 1 - Mercury2012.04.05 Learning Sessions 1 - Mercury
2012.04.05 Learning Sessions 1 - Mercuryjvielman
 
2012.04.05 Learning Sessions 1 - City ArtWorks
2012.04.05 Learning Sessions 1 - City ArtWorks2012.04.05 Learning Sessions 1 - City ArtWorks
2012.04.05 Learning Sessions 1 - City ArtWorksjvielman
 
031100 Jewish Museums Conference3
031100 Jewish Museums Conference3031100 Jewish Museums Conference3
031100 Jewish Museums Conference3Dov Winer
 
Toomore 20130627 Taipei.py
Toomore 20130627 Taipei.pyToomore 20130627 Taipei.py
Toomore 20130627 Taipei.pyToomore
 
Learning sessions #5 Pre Incubator - NobleMotion Dance
Learning sessions #5 Pre Incubator - NobleMotion DanceLearning sessions #5 Pre Incubator - NobleMotion Dance
Learning sessions #5 Pre Incubator - NobleMotion Dancejvielman
 
2012 11 07 pre incubator workshop
2012 11 07 pre incubator workshop2012 11 07 pre incubator workshop
2012 11 07 pre incubator workshopjvielman
 
Powa point
Powa pointPowa point
Powa pointHadden14
 
060426 Presentation_jewish_heritage_digitisation
060426 Presentation_jewish_heritage_digitisation060426 Presentation_jewish_heritage_digitisation
060426 Presentation_jewish_heritage_digitisationDov Winer
 
Governance as Sustainability in the Enterprise Architecture Discipline
Governance as Sustainability in the Enterprise Architecture Discipline Governance as Sustainability in the Enterprise Architecture Discipline
Governance as Sustainability in the Enterprise Architecture Discipline Eric Stephens
 
HTML5 Games - Not Just for Gamers
HTML5 Games - Not Just for GamersHTML5 Games - Not Just for Gamers
HTML5 Games - Not Just for GamersRobin Hawkes
 
2013 01 24 learning sessions 4 presentation hope stone
2013 01 24 learning sessions 4 presentation   hope stone2013 01 24 learning sessions 4 presentation   hope stone
2013 01 24 learning sessions 4 presentation hope stonejvielman
 
Open Web Apps and the Mozilla Labs Apps project
Open Web Apps and the Mozilla Labs Apps projectOpen Web Apps and the Mozilla Labs Apps project
Open Web Apps and the Mozilla Labs Apps projectRobin Hawkes
 
Keluarga Galaksi, Sebuah Tinjauan Genotip
Keluarga Galaksi, Sebuah Tinjauan GenotipKeluarga Galaksi, Sebuah Tinjauan Genotip
Keluarga Galaksi, Sebuah Tinjauan GenotipNur Agustinus
 
Session2 pl online_course_15_september2011
Session2  pl online_course_15_september2011Session2  pl online_course_15_september2011
Session2 pl online_course_15_september2011LeslieOflahavan
 

Andere mochten auch (20)

YPT10J BENUTZERHANDBUCH
YPT10J BENUTZERHANDBUCHYPT10J BENUTZERHANDBUCH
YPT10J BENUTZERHANDBUCH
 
E-WRITE - Repurpose web content for social media - 17 mar2013
E-WRITE - Repurpose web content for social media - 17 mar2013E-WRITE - Repurpose web content for social media - 17 mar2013
E-WRITE - Repurpose web content for social media - 17 mar2013
 
Profil Ringkas INSPIRASI BAKAT
Profil Ringkas INSPIRASI BAKATProfil Ringkas INSPIRASI BAKAT
Profil Ringkas INSPIRASI BAKAT
 
2012.04.05 Learning Sessions 1 - Mercury
2012.04.05 Learning Sessions 1 - Mercury2012.04.05 Learning Sessions 1 - Mercury
2012.04.05 Learning Sessions 1 - Mercury
 
2012.04.05 Learning Sessions 1 - City ArtWorks
2012.04.05 Learning Sessions 1 - City ArtWorks2012.04.05 Learning Sessions 1 - City ArtWorks
2012.04.05 Learning Sessions 1 - City ArtWorks
 
031100 Jewish Museums Conference3
031100 Jewish Museums Conference3031100 Jewish Museums Conference3
031100 Jewish Museums Conference3
 
Toomore 20130627 Taipei.py
Toomore 20130627 Taipei.pyToomore 20130627 Taipei.py
Toomore 20130627 Taipei.py
 
Learning sessions #5 Pre Incubator - NobleMotion Dance
Learning sessions #5 Pre Incubator - NobleMotion DanceLearning sessions #5 Pre Incubator - NobleMotion Dance
Learning sessions #5 Pre Incubator - NobleMotion Dance
 
2012 11 07 pre incubator workshop
2012 11 07 pre incubator workshop2012 11 07 pre incubator workshop
2012 11 07 pre incubator workshop
 
Usabilities
UsabilitiesUsabilities
Usabilities
 
Powa point
Powa pointPowa point
Powa point
 
060426 Presentation_jewish_heritage_digitisation
060426 Presentation_jewish_heritage_digitisation060426 Presentation_jewish_heritage_digitisation
060426 Presentation_jewish_heritage_digitisation
 
Governance as Sustainability in the Enterprise Architecture Discipline
Governance as Sustainability in the Enterprise Architecture Discipline Governance as Sustainability in the Enterprise Architecture Discipline
Governance as Sustainability in the Enterprise Architecture Discipline
 
HTML5 Games - Not Just for Gamers
HTML5 Games - Not Just for GamersHTML5 Games - Not Just for Gamers
HTML5 Games - Not Just for Gamers
 
Hw fdb(2)
Hw fdb(2)Hw fdb(2)
Hw fdb(2)
 
2013 01 24 learning sessions 4 presentation hope stone
2013 01 24 learning sessions 4 presentation   hope stone2013 01 24 learning sessions 4 presentation   hope stone
2013 01 24 learning sessions 4 presentation hope stone
 
Wiraswasta
WiraswastaWiraswasta
Wiraswasta
 
Open Web Apps and the Mozilla Labs Apps project
Open Web Apps and the Mozilla Labs Apps projectOpen Web Apps and the Mozilla Labs Apps project
Open Web Apps and the Mozilla Labs Apps project
 
Keluarga Galaksi, Sebuah Tinjauan Genotip
Keluarga Galaksi, Sebuah Tinjauan GenotipKeluarga Galaksi, Sebuah Tinjauan Genotip
Keluarga Galaksi, Sebuah Tinjauan Genotip
 
Session2 pl online_course_15_september2011
Session2  pl online_course_15_september2011Session2  pl online_course_15_september2011
Session2 pl online_course_15_september2011
 

Ă„hnlich wie Web Programming First Week Summary

Web container and Apache Tomcat
Web container and Apache TomcatWeb container and Apache Tomcat
Web container and Apache TomcatAuwal Amshi
 
Jsp tutorial
Jsp tutorialJsp tutorial
Jsp tutorialsiddhesh2466
 
Web II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentWeb II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentRandy Connolly
 
Unit 4 1 web technology uptu
Unit 4 1 web technology uptuUnit 4 1 web technology uptu
Unit 4 1 web technology uptuAbhishek Kesharwani
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet backdoor
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my wayNicola Pedot
 
Unit5 servlets
Unit5 servletsUnit5 servlets
Unit5 servletsPraveen Yadav
 
Aspnet2.0 Introduction
Aspnet2.0 IntroductionAspnet2.0 Introduction
Aspnet2.0 IntroductionChanHan Hy
 
Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course JavaEE Trainers
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Web Server and how we can design app in C#
Web Server and how we can design app  in C#Web Server and how we can design app  in C#
Web Server and how we can design app in C#caohansnnuedu
 
Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practicesejjavies
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music storeADEEBANADEEM
 
Application Note APLX-LMW-0403: Interfacing the Apache Web ...
Application Note APLX-LMW-0403: Interfacing the Apache Web ...Application Note APLX-LMW-0403: Interfacing the Apache Web ...
Application Note APLX-LMW-0403: Interfacing the Apache Web ...webhostingguy
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran TochAdil Jafri
 
Ibm web sphere application server interview questions
Ibm web sphere application server interview questionsIbm web sphere application server interview questions
Ibm web sphere application server interview questionspraveen_guda
 

Ă„hnlich wie Web Programming First Week Summary (20)

Web container and Apache Tomcat
Web container and Apache TomcatWeb container and Apache Tomcat
Web container and Apache Tomcat
 
Jsp tutorial
Jsp tutorialJsp tutorial
Jsp tutorial
 
Web II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentWeb II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side development
 
Unit 4 1 web technology uptu
Unit 4 1 web technology uptuUnit 4 1 web technology uptu
Unit 4 1 web technology uptu
 
Servlet by Rj
Servlet by RjServlet by Rj
Servlet by Rj
 
Java part 3
Java part  3Java part  3
Java part 3
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
 
Jsp and jstl
Jsp and jstlJsp and jstl
Jsp and jstl
 
Unit5 servlets
Unit5 servletsUnit5 servlets
Unit5 servlets
 
Aspnet2.0 Introduction
Aspnet2.0 IntroductionAspnet2.0 Introduction
Aspnet2.0 Introduction
 
Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Web Server and how we can design app in C#
Web Server and how we can design app  in C#Web Server and how we can design app  in C#
Web Server and how we can design app in C#
 
Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practices
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 
Application Note APLX-LMW-0403: Interfacing the Apache Web ...
Application Note APLX-LMW-0403: Interfacing the Apache Web ...Application Note APLX-LMW-0403: Interfacing the Apache Web ...
Application Note APLX-LMW-0403: Interfacing the Apache Web ...
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
 
Ibm web sphere application server interview questions
Ibm web sphere application server interview questionsIbm web sphere application server interview questions
Ibm web sphere application server interview questions
 

Mehr von Raisa Anjani

How packet data travel over network
How packet data travel over networkHow packet data travel over network
How packet data travel over networkRaisa Anjani
 
How packet data travel from each network
How packet data travel from each networkHow packet data travel from each network
How packet data travel from each networkRaisa Anjani
 
Data communication and network oral test
Data communication and network oral testData communication and network oral test
Data communication and network oral testRaisa Anjani
 
Data communication and network oral test
Data communication and network oral testData communication and network oral test
Data communication and network oral testRaisa Anjani
 

Mehr von Raisa Anjani (6)

Hw fdb(2)
Hw fdb(2)Hw fdb(2)
Hw fdb(2)
 
Hw
Hw Hw
Hw
 
How packet data travel over network
How packet data travel over networkHow packet data travel over network
How packet data travel over network
 
How packet data travel from each network
How packet data travel from each networkHow packet data travel from each network
How packet data travel from each network
 
Data communication and network oral test
Data communication and network oral testData communication and network oral test
Data communication and network oral test
 
Data communication and network oral test
Data communication and network oral testData communication and network oral test
Data communication and network oral test
 

KĂĽrzlich hochgeladen

4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 

KĂĽrzlich hochgeladen (20)

4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Web Programming First Week Summary

  • 1. Web ProgrammingTutorial First Week2011BINUS UNIVERSITY INTERNATIONALRaisa Anjani - 1301027504Anthony Herlambang - 130102758004PAC<br />Web Programming 1st Week<br />After learning about Java language in Object Oriented Programming and Object Technology, now in Web Programming we learn further about how to build website using JSP. JSP (Java Server Pages) is a programming language that gives software developers the capability of generating dynamic website based on HTML, XML, or other document types. It was released in 1999 by Sun Microsystems as the contender of ASP and PHP. JSP is powerful programming language because it conveys all the advantages that Java has, such as: having rich library, simple, object oriented, secure, architecture neutral and portable, high performance, interpreted, threaded, dynamic and many more. <br />For us that have been learning Java previous semester, JSP will be easier to understand rather than ASP or PHP because we already familiar with the concept of object and Java syntax. On the other hand, non-programmers tend to choose PHP for creating dynamic website because of its simplicity compared with JSP (in order to use JSP we should have knowledge in Java language and Object Oriented Programming). Because the PHP users mostly do not have programming backgrounds, they tend not to concern about security. As a result the website becomes vulnerable. While for ASP, it is launched by Microsoft in 1996 with .asp or .aspx extension. Pages with the .aspx extension use compiled ASP.NET which makes them faster and more robust than server-side scripting in ASP. Programmers write most ASP pages using VBScript, Jscript, and PerlScript.<br />That is a brief discussion about PHP and ASP. Now before we get deeper about how to create JSP pages, there are several environment and tools setup that must be fulfilled. This is the list of software that user must have in order to build JSP based website:<br />1.-3111535560 Java Development Kit (JDK)2.16510114300NetBeans IDE 6.9.1 3.1651052070Apache Tomcat <br />JSP pages will be built using NetBeans IDE and run under Apache Tomcat server. JDK from Sun Microsystems will enable us to compile and run Java based application in our computer.<br />Installing JDK (Java Development Kit)<br />Download the latest JDK on http://www.oracle.com/technetwork/java/javase/downloads/index.html <br />Look for Java SE 6 Update 24, and then choose Download JDK.<br />694771-334370<br />Run the installer and follow the steps until the installation is finished.<br />Installing NetBeans and Apache Tomcat<br />Download NetBeans 6.9.1 on http://netbeans.org/downloads/index.html <br />You will see various choices of NetBeans IDE Download Bundles, choose All.<br />After finished downloading, run the installer and select customize.<br />Search for Apache Tomcat 6.0.26 and tick it.<br />Press ok and finish the installation. Now you will have NetBeans and Apache Tomcat installed in your laptop.<br />For more information about installing NetBeans 6.9.1 you may go to this link:<br />http://netbeans.org/community/releases/69/install.html<br />-31750* The latest Apache Tomcat which is version 7.0.11 is not yet compatible for NetBeans 6.9.1, so it is better to install Apache Tomcat from NetBeans 6.9.1 installer which will automatically integrate Tomcat in your NetBeans.<br />Starting and Stopping Apache Tomcat<br />To start Tomcat, first open NetBeans, go to Services tab, and then choose Servers. You will see Apache Tomcat 6.0.26 in the list, right click on it then select Start.<br />To stop Tomcat, first open NetBeans, go to Services tab, and then choose Servers. You will see Apache Tomcat 6.0.26 in the list, right click on it then select Stop.<br />-5905596520*In the server list you may see two different servers which are Apache Tomcat and GlassFish. In Web Programming we use Apache Tomcat server. Their main difference is Apache Tomcat used for general web application whereas GlassFish is used for enterprise application.<br />Testing Apache Tomcat<br />To test whether the server has been run or not:<br />Make sure your Tomcat is running then open your web browser.<br />Type http://localhost:8084/ in the URL bar. If the server is running, the browser will show the page below.<br />When you host your web pages in a server like Apache Tomcat, you can access other data in the different computer using static routing.<br />How to do static routing and connect 2 computers?<br />Connect both computers using crossover cable.<br />*Image from http://www.aboutonlinetips.com/how-to-setup-home-network/<br />*Image from http://dhika.cikul.or.id/crossover-ethernet-cable.html<br />To create cross cable you first create normal configuration (T-568A), then for the second RJ-45 you switch cable 1 with 3 and cable 2 with 6 (T-568B).<br />In both computers open Control Paneletwork and Internetetwork and Sharing Center. Then choose Local Area Connection.<br />Choose properties.<br />Then choose Internet Protocol Version 4 (TCP/IPv4), click on properties.<br />Then select use the following IP address and fill as below to computer 1.<br />For computer2 the configuration is as below.<br />Press OK.<br />Open command prompt and try to ping other computer by typing ping 192.168.0.2; from computer1. If the packet is successfully sent, then the connection is already built.<br />Now you can access computer2’s JSP pages by typing http://192.168.0.2/application name/ on the web browser. <br />NetBeans vs. EditPlus and other text editor<br /> <br />There are some differences in case of coding JSP in the NetBeans IDE and EditPlus or other text editor.<br />In NetBeans when you build a Web Application project, all your needs will be provided by NetBeans automatically. The XML file is one of the examples.<br />NetBeans automatically start Apache Tomcat and link it to your application that uses Tomcat as a server by compiling and running the application.<br />When you code it in EditPlus and other text editor, you have to do all configurations manually. And of course you also have to set up your application in order to connect it to the server.<br />Web Browser<br />Web browser is program that is used for retrieving and presenting information in form of web page that is identified by Uniform Resource Identifier on the World Wide Web. Web page contains hyperlinks that enable users to navigate the browser easily to the related resources.<br />Besides accessing World Wide Web, browser can also used to access information provided by the web server in private networks or file systems such as our own-made HTML page.<br />Web Server<br />A web server is referred to both hardware and software that helps to deliver content that can be accessed through the Internet. Its primary function is to handle request and respond of the client by delivering web pages in form of HTML documents on request of the client (which commonly a web browser). Because you never know when user will visit and use your web application, web server must be up and running all the time.<br />Request and Response<br />*referenced from Java for the Web with Servlets, JSP, and EJB: A Developer's Guide to J2EE Solutions<br />When you type URL in the Address box of your browser, the following things happens:<br />The client browser establish a TCP/IP connection to the server <br />The browser send request to the server<br />The server send respond to the client (web browser)<br />The server closes the connection<br />164084085090<br />*Image from http://www.cs.uregina.ca/Links/class-info/215/Webpage/<br />HTTP *referenced from Java for the Web with Servlets, JSP, and EJB: A Developer's Guide to J2EE Solutions.<br />HTTP is the protocol that allows web servers and browsers to exchange data over the web. It is a request and response protocol. The client requests a file and the server responds to the request. HTTP uses reliable TCP connections—by default on TCP port 80.<br />In HTTP, it's always the client who initiates a transaction by establishing a connection and sending an HTTP request. The server is in no position to contact a client or make a callback connection to the client. Either the client or the server can prematurely terminate a connection. For example, when using a web browser you can click the Stop button on your browser to stop the download process of a file, effectively closing the HTTP connection with the web server.<br />HTTP Requests<br />An HTTP transaction begins with a request from the client browser and ends with a response from the server. An example of an HTTP request is the following:<br />GET index.jsp HTTP/1.1 <br />Host: localhost <br />GET is the request method; index.jsp represents the URI and HTTP/1.1 the Protocol/Version section.<br />HTML<br />In order to get better understanding of JSP, first we will look into HTM. HTML (Hypertext Markup Language) is the basic building blocks for website. It is written in the form of HTML elements consisting of tags that are enclosed in angle brackets <HTML>. HTML uses markup tags to describe web pages. HTML tags normally come in pairs like <BODY> and </BODY>. The first tag is the start tag, the second tag is the end tag (they are also called opening tags and closing tags).<br />W3schools is a website that provides an online HTML tutorial. You may learn the basics of HTML and other web related language such as PHP, ASP, CSS, and many more.<br />Here is the link of w3schools for learning HTML: http://www.w3schools.com/html/default.asp. <br />45593013335<br />To create a HTML documents you simply create new text file, and name it with .html or .htm extension. You may open the file using web browser such as: Google Chrome, Mozilla Firefox, Opera, Safari, Internet Explorer, etc. <br />Browsers are able to read HTML documents and display them as web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page. Here are some of the basic tags to create HTML documents:<br /><html><head><title>My Web Page</title></head><body><h1>Heading1</h1><p>Paragraph</p></body></html><br />All the HTML documents should start with <HTML> tag and end with </HTML>. The head element is a container for all the head elements. Elements inside <head> can include scripts, instruct the browser where to find style sheets, provide meta information, and more. The body is where we declare all our web content.<br />Here, we will briefly discuss 2 basic HTML functionalities: HTML Table and HTML form. The rest of it you may learn it as the lesson goes.<br />HTML Table*referenced from w3schools.com<br />Tables are defined with the <table> tag. A table is divided into rows <tr>, and each row is divided into data cells <td>.tr stands for “table row” and td stands for quot; table data”. <br /><table border=quot; 1quot; ><tr><td>row 1, cell 1</td><td>row 1, cell 2</td></tr><tr><td>row 2, cell 1</td><td>row 2, cell 2</td></tr></table><br />How the HTML code above looks in a browser:<br />row 1, cell 1row 1, cell 2row 2, cell 1row 2, cell 2<br />HTML form*referenced from w3schools.com<br />HTML forms are used to pass data to server. A form can contain input elements, select list, text area, field set, legend, and label elements<br />Input elements:<br />Text fields<br />Checkboxes<br />Radio-buttons <br />Submit buttons <br />Etc.<br />The <form> tag is used to create an HTML form.<br /><form method=quot; getquot; action=quot; html_form_action.aspquot; >Username: <input type=quot; textquot; name=quot; userquot; ><input type=quot; submitquot; value=quot; Submitquot; ></form><br />The method attribute specifies how to send form-data (the form-data is sent to the page specified in the action attribute).The form-data can be sent as URL variables (with method=quot; getquot; ) or as HTTP post (with method=quot; postquot; ).<br />Method specifies the How the HTML code above looks in a browser:<br /> Top of FormBottom of Form<br />The form itself is not visible. Also note that the default width of a text field is 20 characters. *More details implementation of form will be discussed in the exercise.<br />Building your first JSP page<br />Open your NetBeans and choose File New Project. Click on Java Web then choose Web Application. Click next.<br />Fill the project name (in this case MyFirstJSP) and determine your saving location. Click next.<br />Choose Apache Tomcat as the server and Java EE 5 version. Click next.<br />Leave all empty and click finish.<br />Below is your first JSP will look like. You may find your JSP page under directory Application Name/Web Pages or in this case MyFirstJSP/Web Pages. Then you may start to build and modify the JSP page.<br />To compile and run it press Shift+F6.The JSP pages will be shown on your browser like below.<br />-34290395605*For the Java EE Version you may see 2 different versions which are Java EE 5 and J2EE 1.4. Java EE 5 is the newer version of J2EE 1.4. It has more APIs and functionalities than the latest J2EE.*The name of the Java platform for the enterprise has been simplified. Formerly, the platform was known as Java 2 Platform, Enterprise Edition (J2EE), and specific versions had quot; dot numbersquot; such as J2EE 1.4. The quot; 2quot; has been dropped from the name, as has the minor revision number. So the next version of the Java platform for the enterprise is Java Platform, Enterprise Edition 5 (Java EE 5).<br />EXERCISE<br />Now after you understand the basic of HTML and JSP, we will create login page and examine the parameter.<br />Modify My First JSP into a login page that looks like below in the browser:<br />When user press OK button, it will check the username and password. If it is correct it will redirect to welcome page and show Welcome (name), otherwise it will show INVALID.<br />In this example, the valid value for username is “user” and password is “user”.<br />CORRECT PASSWORD<br />Username: user Password: user<br /> <br />WRONG PASSWORD<br />Username: user Password: apple<br />Solution:<br />index.jsp<br />Code:<br /><html> <head> <title>JSP Page</title> </head> <body> <form method=quot; getquot; action=quot; Welcome.jspquot; > Username:<input type=quot; textquot; name=quot; userquot; ><br/> Password:<input type=quot; passwordquot; name=quot; passquot; ><br/> <input type=quot; submitquot; value=quot; Submitquot; > </form> </body></html><br />To create a login form, you use form and input tag in the BODY of index.jsp as shown above and below are the explanation of the form and input attributes.<br />This will be name of this formData will be sent to Welcome.jsp<br /> <form name=quot; inputquot; action=quot; Welcome.jspquot; method=quot; getquot; ><br /> Name: <input type=quot; textquot; name=quot; userquot; ><br/><br /> Password: <input type=quot; passwordquot; name=quot; passquot; ><br/><br /><input type=quot; submitquot; value=quot; Submitquot; ><br /></form><br />27305125730<br />“method=” specify how to send form-data (the form-data is sent to the page specified in the action attribute).The form-data can be sent as URL variables (with method=quot; getquot; ) or as HTTP post (with method=quot; postquot; ).<br />“action=”redirect page to specified path.<br />“type=” specify the type of input that will be shown in the browser. Below are the mostly used types: a. text: create a text field b. password: create a text field which value is hidden from the user c. submit: create a button<br /> “value=” specify the text that will be shown on screen of a specific element (*Text Submit in submit button is caused by value).<br />“name=”the name of the elements that will be used as parameter name. (It is used for retrieving parameter value using getParameter command)<br />Welcome.jsp<br />Code:<br /><html> <head> <title>JSP Page</title> </head> <body> <% String user = request.getParameter(quot; userquot; ); String pass = request.getParameter(quot; passquot; ); if (user.equals(quot; userquot; ) && pass.equals(quot; userquot; )){ out.println(quot; Welcome quot; +user+quot; !quot; ); }else{ out.println(quot; INVALIDquot; ); } %> </body></html><br />In the body of Welcome.jsp we process the data that we receive from index.jsp. Here is the explanation of the logic:<br /> <% symbol is used to start enclosing java code%> symbol is used to marks the end of java code and you may start to code in HTML againJava code that is enclosed by <% %> is called Scriptlet.-17145-447675 In JSP you can print words to the browser by using java code: out.print(); /out.println(); <br />The getParameter method is used to get parameter passed from index.jsp“user” will get the value of the username and “pass” will get the value of the password.<br /><%<br />String user = request.getParameter(quot; userquot; );<br />String pass = request.getParameter(quot; passquot; );<br />if (user.equals(quot; userquot; ) && pass.equals(quot; userquot; )){<br />If the username and password is correct (equals to ”user”) then it will print ”Welcome (the username) !”(In this case the username is user so it will print “Welcome user!”)If username or password wrong then it will print “INVALID”. out.println(quot; Welcome quot; +user+quot; !quot; ); <br /> }else{<br /> out.println(quot; INVALIDquot; );<br />}<br />%><br />POST and GET<br />GET<br /><form method=quot; getquot; action=quot; Welcome.jspquot; ><br /> Username :<input type=quot; textquot; name=quot; userquot; ><br/><br /> Password :<input type=quot; passwordquot; name=quot; passquot; ><br/><br /> <input type=quot; submitquot; value=quot; Submitquot; ><br /></form><br />As we can see, we use form tag to pass data to server then redirect it to Welcome.jsp. GET method is used to simply retrieves the data identified by URL. It will show the parameter passed on the header so user may see it. The URL shows our username and password that we inputted before in the index.jsp<br />POST<br /><form method=quot; postquot; action=quot; Welcome.jspquot; ><br /> Username :<input type=quot; textquot; name=quot; userquot; ><br/><br /> Password :<input type=quot; passwordquot; name=quot; passquot; ><br/><br /> <input type=quot; submitquot; value=quot; Submitquot; ><br /></form><br />The other method that mostly used is POST. POST is the HTTP request method that transfers data (parameters) to the server in the entity body of the request. So, it won’t show our username or password on the URL. It usually used in the login pages where the information passed to server is confidential. Using POST method the parameter will be hidden from the user.<br />Difference between GET and POST:<br />*the table is referenced from w3schools.com<br />GETPOSTThis method appends the form-data to the URL in name/value pairsThis method is useful for form submissions where a user want to bookmark the resultThere is a limit to how much data you can place in a URL (varies between browsers), therefore, you cannot be sure that all of the form-data will be correctly transferredNever use the quot; getquot; method to pass sensitive information! (password or other sensitive information will be visible in the browser's address bar)This method sends the form-data as an HTTP post transactionForm submissions with the quot; postquot; method cannot be bookmarkedThe quot; postquot; method is more robust and secure than quot; getquot; , and quot; postquot; does not have size limitations<br />This explanation about POST and GET will end this tutorial. Hopefully through this tutorial you may get better understanding about the basic of JSP. Deeper explanation about JSP and Servlet will be done on the next session. Thank you.<br />