Share on Google+Share on Google+

Tarunkanti Kar
assignment of variables
1 Answer(s)      8 years ago
Posted in : JSP-Servlet

Ads

View Answers

November 10, 2008 at 4:10 AM


Hi friend,


if you want to pass something from the client (javaScript) to the server (java), you have to submit a form, or use a the name/value query string.

your first should look something like:

<form action="loginPage.jsp">
Enter you value here: <input type="text" name="_value" value="">
Then click the button to Check <input type="Submit" value="Click Me">
</form>

you use that to transfer (or pass if you want) the string value of the _value variable to the loginPage.jsp page on the server.

The loginPage,jsp should something like this:
<%
String value = request.getParameter( "_value" ); // get the parameter passed from the client

WebValidiator webValidiator = new WebValidiator(); // create a validator object

// do validation
if( webValidiator.validate( value ) )
{
response.writeln( value + " is a valid value" );
}
else
{
response.writeln( value + " is not a valid value" );
}
%>

----------------------------

Read for more information.

http://www.roseindia.net/jsp/

Thanks









Related Tutorials/Questions & Answers:
Assignment of variables - JSP-Servlet
Assignment of variables  How to assign a javascript variable value to a java string variable. .... var strName="Tarunkanti Kar"; .... ... I want to access the script variable in java variable please give
assignment of variables - JSP-Servlet
assignment of variables  How to assign a javascript variable value to a java string variable. .... var strName="Tarunkanti Kar"; .... ... I want to access the script variable in java variable please give
Advertisements
Java assignment of variables - JSP-Servlet
Java assignment of variables   .... var strName="Tarunkanti Kar"; .... ... I want to access the script variable in java variable please give the code
Assignment
Assignment  any one can help with a java assignment
assignment
as a constant. (1 mark) ii. Identify and list all the instance variables and the class... variables of the object Sphere. (2 marks) iv. Name the data field in class Circle
Variables
Variables  What are the difference between Static variables, instance variables and local variables
Assignment problem
Assignment problem  hello, I am designing a program partaining job assingment using hungarian algorithm,but i am totally confused, please help me out
Programming Assignment
Programming Assignment  Hey there, We were given an assignment to write a program to read 10 student marks from the keyboard without using an Array (only using switch statements, if statements or loops). As each mark is input
my assignment
...this is my assignment....plz
assignment in OOP1
assignment in OOP1  Filename: CharCount.java Instructions: Ask a user to input a string Program should determine the number of occurrences...: A ? 1 F ? 0 K ? 0 P ? 1 U - 0 Z - 0 B ? 0 G ? 1 L ? 0 Q ? 0 V - 0 C ? 0 H ? 0 M
Java with OOP assignment (Eclipse)
Java with OOP assignment (Eclipse)  How do i control the length of characters in an input? E.g.: Enter your name > Hi * Name too short
Assignment Operators in java 7
to the variable by using any assignment operator. Your variables are placed...Assignment Operators in java 7 In this section you will learn about the Assignment Operators. This is one type of operators. Assignment Operators
java assignment - Java Beginners
java assignment  I got assignment in "design a vehicle class hierarchy in java,write a test program to demonstrate polymorphism".please send me the necessary codings and algorithm.  Hi Friend, Try the following code
Assignment Question on java programming
Assignment Question on java programming  Can somone help me on this . Thx You are required to write a complete Java program for a simple grading system. At the beginning of the system, you need to input number of students
Urgent programming assignment
Urgent programming assignment   Hi, I am an Indian student in USA.I have been able to write all the java codes successfully , however this one is giving me tremors.Any help would be highly appreciated.I am attaching
getting variables
getting variables   how to get variables from servlet program to webservice program
Simple Assignment Operator
Simple Assignment Operator       Assignment operator... lying to the left side of the assignment operator. But, If the value already
Assignment operator in java
Assignment operator in java Assignment operator is very common to almost all... the value to the variable lying on the left side. Java assignment operator... to be assigned to the variable to the left side. Assignment operator is also used
Environment variables
Environment variables  How to set Environment Variables in JAVA 6 n Tomcat 6 CLASSPATH, JAVA_HOME, PATH, & CATALINA variables plzzz plzz help me
Flex Variables
with it. Variables are used to store values for the application. In flex, var statement... is assigned a value using assignment operator (=). myVar = 10; Declaration and assignment of the variable can be done simultaneously
Variables in Java
Variables       Data... variables) Java Primitive Data Types Data Type Description... 0.0d In this section, you will learn about Java variables. A variable
PHP Assignment Operators
Assignment Operator: We  have used the basic assignment operator in our life but a confusion may occur between an "assignment operator"... these are not. In the following examples different types of assignment operators
Java - Declaring variables in for loops
Java - Declaring variables in for loops  Java - Declaring variables in for loops
instance variables - Java Beginners
instance variables  instance variables
Variables In Java
This tutorial demonstrates you about the variables and their types in java
transient variables in java
transient variables in java  hello, What are transient variables in java?   hii, Transient variables are variable that cannot be serialized
Tutorials   
Java Spring Hibernate Struts Training fat image from db fat image from db fat image from db fat image from db unable to get value returned from javascript variable in page How to change image size before adding to mysql using jsp Design a registration.jsp page with input for user registration details Cart Quantity jsp servlet coding issue servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? image pdf marking pdf marking Multiple image upload using JSP Read code from excel sheet and upload into database using JSP Student java about search engine Convert BLOB to PDF and save it to a location how to copy files from remote to local machine using SFTP SSL in java? Like Team viewer Socket and Servert -Jsp how to copy files from remote location to local using java? How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java how to create SOAP based web service in java? how to fetch data from mysql database table and draw a bar chart on that data using in jsp how to create users in LDAP using java? how to authenticate user using TIVOLI api in java? how to create users using IBM Tivoi API in jsp/servelet? Java/J2ee Please explain this code as many packages and classes are unknown to me .! how to download the uploaded folder files using jsp Login Query image is display from path of mysql database please reply the code to store dynamic fields in database? Reloading issue in jsp How to get Button Id ? calling one jap page from another jsp page login login Problem to get connection from DAO class to JDBC Page Loading Time Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below Sending hidden values

Ads

 
Advertisement null

Ads