assignment of variables



Share on Google+Share on Google+

Tarunkanti Kar
assignment of variables
1 Answer(s)      9 years ago
Posted in : JSP-Servlet
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">

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" );
response.writeln( value + " is not a valid value" );


Read for more information.



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
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  any one can help with a java 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  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
my assignment
...this is my assignment....plz
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
assignment in OOP1
assignment in OOP1  Filename: 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
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 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
getting variables
getting variables   how to get variables from servlet program to webservice program
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
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
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
Simple Assignment Operator
Simple Assignment Operator       Assignment operator... lying to the left side of the assignment operator. But, If the value already
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
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
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
Java Substituting Variables
Java Substituting Variables  Java Substituting Variables
Static & Instance variables in java
Static & Instance variables in java  What are the Difference between Static & Instance variables in java
What are local variables?
What are local variables?   hi, What are local variables? thanks... a block of syntax like methods. Local variables should be initialised before accessing them. For details related to Local Variables