VisualBuilder
  Home > Jsp > Tutorials > Example Time! - Java Web Component Tutorial
Tell a friend
Link to us
Total Members
      Members: 84606
     
Sitemap Forum Chat
Home
Java Web Component Tutorial Home
1 . Basics to the web
2 . URI and URL
3 . Contents of Request and Response
4 . When a Servlet is invoked
5 . Servlet Execution Flow
6 . Example Time!
7 . Servlet Execution Flow
8 . Keep Coming Back for more updates.
 
Jsp Group Home
Jsp Discussion (71)
Jsp Members (18673)
Jsp Resources
Jsp Source Code (172)
Jsp Articles (3)
Jsp Blogs
Jsp Jobs
Jsp Components (10)
Jsp Books
Jsp Websites (13)
Jsp News (12)
Jsp Q & A (79)
- Jsp Ask Question
- Jsp Questions
- Jsp Unanswered Questions
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Grails Tutorial
Hibernate Tutorial
Java 1.6 Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Service-Oriented Architecture (SOA) Using Java Web Services Tutorial
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (432 )
Source Code (3217 )
Articles (11 )
Components (1589 )
News (880 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise


Jsp webcomponent Tutorial
 Example Time!
  << Prev: Servlet Execution Flow Next: Servlet Execution Flow >>

Example Time!




Now enough of theory and let us get along with some examples from whatever we have learned so far,

The example shows how a HttpServletRequest is used to analyse the incoming request.

Following is a code snippet of Info.html,

 

<HTML>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">

<h4> <p> Enter Your User Data </p></h4>

<h5> <p> And Enter GO ! to know all about you and your session info </p> </h5>

<form action="../com/cit/servlet/Info" method="post">            

            <p> First Name: <input type="text" size="20" name="n1" > </p>

            <p>            Last Name: <Input type="Text" size="20" name="n2" > </p>

            <p>            Password:   <Input type="password" size="20" name="pw" > </p>

            <p><input type="submit" name="button" value="GO !"></p>

</form>

</BODY>

</HTML>


 example form

 


 


Info.html should look as shown above.

 

Servlet output will look something like this,

 


 




To run the servlet you should create the folders under webapps and copy the files as follows,

\ cit \ jsp\ info.html

\ cit \ WEB-INF \ web.xml

\ cit \ WEB-INF \ classes \ com \ cit \ servlet \ InfoServlet.class

 

Pay close attention to how the information in info.html was obtained by the servlet, by using the method,req.getParameter(?paramName?),and returned back to the client. Also observe how servlet gets important client information,like header,session information.





  << Prev: Servlet Execution Flow Next: Servlet Execution Flow >>
Jsp Webcomponent Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
 
LINKS
stamps by fax
EV SSL Certificates
Video Surveillance
VoIP Internettelefonie
Gift to Pakistan
 
ADVERTISEMENT
 
PARTNER LIST

More
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising