WRITE a simple JSP

WRITE a simple JSP

Write a JSP that accepts a string parameter from the browser and simply displays it back in the HTML response

View Answers

November 30, 2010 at 5:47 PM

Hi Friend,

Try the following code:

1)form.jsp:

<html>
<form name="form" method="get" action="display.html">
Enter Message: <input type="text" name="msg">
<input type="submit" value="submit">
</form>
</html>

2)display.html:

<script type="text/javascript">
function getParameter(name){
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec(window.location.href);
  if( results == null )
  return "";
  else
  return results[1];
}
var value = getParameter("msg");
document.writeln("You have entered: "+value);
</script>

Thanks









Related Tutorials/Questions & Answers:
WRITE a simple JSP
WRITE a simple JSP  Write a JSP that accepts a string parameter from the browser and simply displays it back in the HTML response   Hi Friend, Try the following code:ADS_TO_REPLACE_1 1)form.jsp: <html> <form
Simple JSP program example
page. Write a simple JSP program and then add following code in the page: <...Simple JSP program example  Hi, How to make simple jsp program... with the simple JSP example program. Give me simple jsp program example. Thanks  
Advertisements
write a jsp parser
write a jsp parser  I want figure out the variable used in a particular jsp and put it in a xml.I can do it manually but there are whote lot of a jsp to figure out .So can anyone can tell me a option to build a jsp parser
How to write a simple java applet
How to write a simple java applet   Hi, how can i write a simple java applet, displaying text in specific colors and font style. For example, the output will be something like : Name in red color Age in blue color Nationality
Simple JSP program
Simple JSP program  create a simple jsp page in which number is to be entered by user in jsp page and submit button clicked.If number entered is greater then 100,then message box "no is greater" elseif less "no is lesser
write Div in jsp page - JSP-Servlet
write Div in jsp page  How can i write Div class in jsp page?  Hi Viral Sonawala tag is a html tag, perform the same function in jsp as used in html. Example: This is a header This is a paragraph
write xml file with jsp useBean - JSP-Servlet
write xml file with jsp useBean  how to write into xml files with jsp.. the code for writing is in a class.. pls help me to solve this..thanx...\. Read for more information, http://www.roseindia.net/jsp/jdo
can we write a method in JSP - JSP-Servlet
can we write a method in JSP  Hi All, In my web application I want to call another second jsp file. I can do it by redirecting my first jsp file to second jsp file, but I can't come back to the same place(instruction
Help me to write this simple java frame program
Help me to write this simple java frame program   I want to write a Java program for.... To create a frame with 4 text fields;name,street,city and pin;with suitable labels. Also add a button "OK". After enter values
How to write first JSP Hello World example?
How to write first JSP Hello World example?  Hi, How to make first simple JSP program which prints simple Hello World example? I want to learn..., For making a simple JSP page you will have to make first helloworld.jsp.
Simple clarification - JSP-Servlet
Simple clarification  Respected Sir/Madam, Thanks for your immediate response..Sorry for troubling you again and again. So,you told... way to do so with JSP's? Whether it is conceptually right or wrong? Please
How to write jsp/servlet code to integrate LINKDIN?
How to write jsp/servlet code to integrate LINKDIN?  How integrate linkdin api's in java codding
write simple java code - Java Beginners
write simple java code  Write a program that creates a simple calculator .The user enters two numbers in the text fields, Number 1 and Number 2. There are 4 buttons, labeled with ?Add?, ?Substract?, ?Multiply? and ?Divide
How to write javascripts - JSP-Servlet
How to write javascripts  Dear sir, How to write a java scripts? I have a one table in that i have a radio button and soon..And also i have a submit button.If i didnt select any radio button and click on a submit button
How to write javascripts - JSP-Servlet
How to write javascripts  Dear sir, I got u r code ,thanks for posting me ,but i have a problem.In a table if no of rows are present then its works fine,when their is only a single row then if i select that row
How to write .properties file from jsp
it in my jsp but Iam unble to modify/write the .properties file and Iam not getting... to implement/write .properties file from jsp. Regards, Venkatesh Gurram.ADS...How to write .properties file from jsp  Hi i new to java i stuck here
How i write a function/method in jsp?
How i write a function/method in jsp?  How write the function/method in jsp? Using that method i can retrieve the value coming from database. give me example plz. Actually i want to show the list of user detail
upload a file and write it in JSP using servlet
upload a file and write it in JSP using servlet  Hello, I'm facing a problem here. I want to upload a file through abc.jsp and write the contents of file using a servlet in xyz.jsp. It is supposed to be a excel file which
HOW WRITE GREEK CHARACTERS INTO MYSQL BY JSP ?
HOW WRITE GREEK CHARACTERS INTO MYSQL BY JSP ?  HALLOW TO ALL ! I'M USING MYSQL5.5 , TOMCAT7 & JSP. IN MY BROWSER I'M SEEING GREEK CHARS BECAUSE...){} COULD PLEASE HELP ME SOMEBODY WITH THAT ? JUST A SIMPLE EXAMPLE THAT WORK
simple code to write an read and write the login detail to a xml file using javascript ( username and password )
simple code to write an read and write the login detail to a xml file using javascript ( username and password )  pls can nyone give me a code to write and read the login details (username and password )into a xml file using
pls provide steps to write ejb3.0 simple application in eclipse - EJB
pls provide steps to write ejb3.0 simple application in eclipse   hi, pls provide steps to create simple ejb3.0 application in eclipse .And also how to create entity bean ,session bean in ejb3.0
how to write a jsp form using html
how to write a jsp form using html  hi, i have written the code as below... but it is showing error. please help me how to resolve it. .html file...; </form> <p></body> </html> .jsp file <
write to file from servlet - JSP-Servlet
write to file from servlet  Hi, I have a jsp file where I input... right data on the web site. I am also trying to write this data to file... JSP Page //<
Write a JSP program to display the grade of a student by accepting the marks of five subjects.
Write a JSP program to display the grade of a student by accepting the marks of five subjects.  Write a JSP program to display the grade of a student by accepting the marks of five subjects
simple bank application - JSP-Servlet
simple bank application  hi i got ur codings...But if we register a new user it is not updating in the database...so plz snd me the database also.... Thank you
Simple problem to solve - JSP-Servlet
Simple problem to solve  Respected Sir/Madam, I am R.Ragavendran.. Thanks for your kind and timely help for the program I have asked earlier. Its working in a fantastic way. My heartiest solute to Roseindia team
Simple problem to solve - JSP-Servlet
Simple problem to solve  Respected Sir/Madam, I am R.Ragavendran.. Thanks for your kind and timely help for the program I have asked earlier. Its working in a fantastic way. My heartiest solute to Roseindia team
How to run a simple jsp page in tomcat???
How to run a simple jsp page in tomcat???  i am trying to run a simple jsp page in tomcat,i am having web.xml also in WEB-INF folder. but it is giving me this error below....please help me to solve it. my jsp page code is given
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import="com.itextpdf.text.,com.itextpdf.text.pdf.,java.io.*;"%> </head>... to open the pdf file when i execute the jsp page
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import="com.itextpdf.text.,com.itextpdf.text.pdf.,java.io.*;"%> </head>... to open the pdf file when i execute the jsp page
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import="com.itextpdf.text.,com.itextpdf.text.pdf.,java.io.*;"%> </head>... to open the pdf file when i execute the jsp page
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import="com.itextpdf.text.,com.itextpdf.text.pdf.,java.io.*;"%> </head>... to open the pdf file when i execute the jsp page
Simple Bank Application in JSP
Simple Bank Application in JSP       In this section, we have developed a simple bank application in jsp . In this application user can Update the User Profile, Cash
data retrival from database throw simple jsp..
data retrival from database throw simple jsp..  We can retrieve the the data from data base simple jsp page: Jsp Page:retrive.jsp <% Connection conn = null; ResultSet rs = null
Simple Program Very Urgent.. - JSP-Servlet
Simple Program Very Urgent..  Respected Sir/Madam, I am R.Ragavendran.. Thanks for your superb reply. I find a simple problem which i have tried my... information. http://www.roseindia.net/jsp/popup-window-using-ajax
Simple problem Very Urgent - JSP-Servlet
Simple problem Very Urgent  Respected SDir/Madam, I am R.ragavendran.. Thanks for your superb reply. I got the coding. But I find a simple problem which i hava tried my level best to solve. A pop up window is opening
Write a program using JSP that enables any student to change his/her address.
Write a program using JSP that enables any student to change his/her address.  Write a program using JSP that enables any student to change his/her address
how to write the coding for converting the database data for example population into any type of graph using jsp and servlets?//
jsp and servlets pls help me out how to write the coding for converting the database data for example population into any type of graph using jsp and servlet...coding for converting the database data  how to write the coding
JSP Write XML
JSP Write XML     ... The Tutorial illustrate an elaborate example on JSP Write XML. To understand... dynamic XML using JSP. JSP technology is basically used for building HTML pages
JSP Simple Examples
JSP Simple Examples Index 1. Creating a String In jsp we create a string as we does.... Try catch in jsp In try block we write those code which can throw
simple web appllication to insert, update or display from database - JSP-Servlet
simple web appllication to insert, update or display from database  hello sir i am using netbeans 5.5 ide with tomcat and oracle 9 i as database... database content on jsp page. please send complete code. thank you mani saurabh
I need jsp code for how to write text field value into property file.
I need jsp code for how to write text field value into property file.  Hi , I need to set the text field value into property file using jsp code. Example : Username : Valar , I have entered the value "Valar" in the text field
JSP Simple Examples
of ?jsp_precompile. This we will write in the URL.  ... Objects EL is the JSP 2.0 Expression Language Interpreter from... Conditional Content on a JSP Page We make use of the condition
jsp
jsp  how to write a servlet and jsp program for user login form
jsp
jsp  how to write a servlet and jsp program for user login form
jsp
jsp  how to write hindi in jsp and store in database as unicode
jsp
jsp  write a code for jsp file generator to generate a jsp page automatically taking html page as input
jsp
jsp   what is the basic necessities reguired for running jsp using JDBC bridge?? and how to write a jsp code to access the detail present in microsoft access pls send link regarding above
session realtime usage program simple jsp program or servlet ,which understands me importance of session
session realtime usage program simple jsp program or servlet ,which understands... like client state storage scope.,but jsp or servlet realtime simple session related program whether it may be loginpage or anything must simple understanding
Simple Calculator Application In Java Script
the basics of JavaScript and create your first JavaScript program. What is simple Calculator The objective of this project is  learn how to write a simple... Simple Calculator Application In Java Script  

Ads