WRITE a simple JSP

Ads
 

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

Ads









Related Tutorials/Questions & Answers:
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  
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
Advertisements
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
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.
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
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 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
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
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 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 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 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
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
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
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
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     ... illustrate an elaborate example on JSP Write XML. To understand the example we make use... dynamic XML using JSP. JSP technology is basically used for building HTML pages
written in jsp file
written in jsp file  how to create and write in a jsp file through simple core java code
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
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
Hibernate JSP
In this section, you will learn about Hibernate with JSP using simple pagination example
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   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
JSP
the following links: http://www.roseindia.net/jsp/simple-jsp-example/UsingBeansAndPageScope.shtml http://www.roseindia.net/jsp/simple-jsp-example/UsingBeanScopeRequest.shtml http://www.roseindia.net/jsp/simple-jsp-example

Ads