Services | Updates | Contact
Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML
How To Stop Spam
I imagine you have seen, heard about, or already know what spam is. But just in case you don?t, it is unsolicited and un
 
SOA and Web Services
SOA and Web Services Tutorials in this site helps you learn more about service-oriented architecture (SOA) and web ser
 
More Tutorials...


    Loan Information     Struts     Open Source

Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

 
 
JSP

 
Comments
 
 

 

Retrieving the data posted to a JSP file from HTML file

                          

Now I will show you how to retrieve the data posted from a HTML file in a JSP page. Consider an html page that prompts the user to enter his/her name, let's call it getname.htm. Here is the code of the html file: 

 

 

 

 

 

<html>
<head>
<title>
Enter your name</title>
</head>
<body>

<p>&nbsp;</p>

<form method=
"POST" action="showname.jsp">

<p><font color=
"#800000" size="5">Enter your name:</font><input type
=
"text" name="username" size="20"></p>

<p><input type=
"submit" value="Submit" name="B1"></p>
</form>
</body>
</html>

 

The target of form is "showname.jsp", which displays the name entered by the user. To retrieve the value entered by the user we uses the

request.getParameter("username");

code.

Here is the code of "showname.jsp" file:

<%@page contentType="text/html" %>

<!--

http://www.roseindia.net/jsp

-->

<html>

<body>

<p><font size="6">Welcome :&nbsp; <%=request.getParam
eter("username")%></font></p>

</body>

</html>

 

 

Execute the example.

  Download the  code

                          

Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

9 comments so far (post your own) View All Comments Latest 10 Comments:

Pl Sir Could you tell me How to Transfer files.. using JSP??

Posted by Tushar on Monday, 02.25.08 @ 19:43pm | #49972

Thanks For Your Tut.
Its, Really Help Me To Build My JSP Project

Posted by Abhishek on Sunday, 02.17.08 @ 07:31am | #48710

u r tutorials r good!..keep up t good job!

Posted by mahesh on Tuesday, 01.29.08 @ 21:54pm | #46515

I want to get my attached file. Wat is the syntax?

Posted by senthil on Sunday, 10.7.07 @ 11:55am | #32306

can u give me the detail to retrieve infn from an jsp output html file

Posted by gimsy on Saturday, 09.29.07 @ 18:46pm | #30482

we cant execute the above mentioned code

Posted by sy on Wednesday, 07.18.07 @ 17:52pm | #21504

please give me the answer

Posted by harika on Monday, 07.2.07 @ 10:33am | #20566

Its very easy to learn ,Thank u for giving goo oppertunities...

Posted by sireesha on Friday, 06.29.07 @ 11:34am | #20367

its very nice

Posted by sushil lamoria on Thursday, 04.12.07 @ 18:07pm | #13977

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.