Redirecting the output of an expression to a variable

Redirecting the output of an expression to a variable

View Answers

April 21, 2009 at 10:27 AM

Hi Friend,

Use the following code in your 'variable.jsp' file:

<%
String name= request.getParameter("param1");
application.setAttribute("variable",name);
response.sendRedirect("get.jsp");
%>

Create another jsp file 'get.jsp' to get the output:

<% String j=(String)application.getAttribute("variable");
out.println("Value of the variable:"+j);
%>

Thanks









Related Tutorials/Questions & Answers:
Redirecting the output of an expression to a variable - JSP-Servlet
Redirecting the output of an expression to a variable  I want to redirect the output of to a variable defined in variable.jsp. What is the syntax...' file: Create another jsp file 'get.jsp' to get the output: Thanks
Redirecting the console output into a file in Java
Redirecting the console output into a file in Java  Hi, i coded a program that read specific lines from a text file. It's working well. Now i want to redirect the output of the console to a text file. i used your tutorial
Advertisements
output variable
output variable  if i want to print output of three variables when i wrote the code e.g SYStem.out.PRINTln(answer + answer1 + answer 2) only output of answer is getting printed out? can you help
ModuleNotFoundError: No module named 'single-variable-expression-parser-ALIEZZAT'
ModuleNotFoundError: No module named 'single-variable-expression-parser...: ModuleNotFoundError: No module named 'single-variable-expression-parser-ALIEZZAT...-variable-expression-parser-ALIEZZAT python with following command: pip install
output
output  Sir,I am experiencing some problems with the output of this program.I got some useful help this website,but the output of the program isn't producing what it should.let me explain the output below is what happen when
Expression tag
;Expression tag is used to display output of any data on the generated page. The data placed in Expression tag prints on the output stream and automatically converts... for printing output equivalent to out.println().Thus, an expression tag contains
Redirecting and forwarding to views
In this section, you will learn about redirecting and forwarding views through prefixes
PHP Expression
PHP Expressions: In every language expression plays a vital role, in PHP whatever you write is an expression (almost anything). Anything has a value is an expression and this is the easiest way to define and understand expression
JSP Variable in Javascript
that takes the defined variable from the jsp expression and display the message from... variable from the jsp expression "HelloWorld". The expression <%=str%> is used to insert the jsp variable values directly into the output
Display "Hello JSP" using Jsp expression
Display "Hello JSP"  using Jsp expression In this section, We will simply output "Hello JSP"  in a web browser using Jsp expression. JSP expressions insert values directly into the output. The syntax
Local Variable and Instant Variable
Local Variable and Instant Variable  difference between Local Variable and Instant Variable   Difference between local variable and instance variable Instance variable is declared within a class but not within
verfication of user login and then redirecting it to user defined page
verfication of user login and then redirecting it to user defined page  hi, i have a login page that..calls the servlet..and i have used redirect...,the html page calls teh servlet..but..the servlet.is not redirecting to a user defined
<c: out> For Simple Calculation and Output
is to display the output to the user. It works like expression tag in jsp <%= ---%>...<c: out> For Simple Calculation and Output  ...: It specify the expression which needs to be evaluated.  default: We can
Regular expression
Regular expression  how i write a regular expression for a pattern which present in between
Regular expression
Regular expression  I have the regular expression : var x=/(^\d+$)/ which allows only numbers. It does not accept character, decimals. However it accepts zero. I want an expression that takes numbers(no decimals)except zero
Hibernate Expression
In this section we will discuss Hibernate Expression
Converting jsp variable to java variable
Converting jsp variable to java variable  Hi how to convert java script variable to java variable on same jsp page
Pointer a variable
Pointer a variable  hii, Pointer is a variable or not ?   hello,ADS_TO_REPLACE_1 Yes, a pointer is a variable
Java variable
Java variable   To what value is a variable of the String type automatically initialized
Passing variable
Passing variable  How to pass variable to HTTP object in HTMl or PHP
Output of flex
Output of flex  hi....... please provide the name of the output file. What is the output of flex applications? please rply ASAP........ Thanks
triangle output
triangle output  program to get the following output
final variable
final variable  Please give some easiest and understanding example program for final variable
environment variable
environment variable  what are the environment variable is need to run j2ee application in eclipse could you explain the details
input output
Input And Output       Introduction The Java I/O means Java Input/Output and is a part... used for writes byte to output stream. It implements a buffered output
Redirecting Page
A regular expression contains another regular expression - PHP
A regular expression contains another regular expression   Please explain how it works in PHP... RegEX1 = "a.*b"; RegEx2 = "a1.*b"; Thanks
environment variable
environment variable  what is environment variable in java?   Environment variables are used by the Operating System to pass configuration information to applications
Regular Expression for removing XML Tags
Regular Expression for removing XML Tags  Hi, Good Afternoon.I want a Regular expression in java which is removing the XML Tags in the specified Text String like, String txt="<Hello>How are you"; I want output of this txt
triangle output
triangle output  program to get the following output: * *   Hi Friend, Please specify the pattern properly.ADS_TO_REPLACE_1 Thanks
Static Variable
Static Variable  What is the basic use of introducing static variable... that a certain object/variable is resident in memory and accessed each time an instance..., it means that the static variable is shared among all instances of the class
What is the output if....
What is the output if....  Here is my code. what is the output...;When we put 50 as a lower limit value, output comes: (adsbygoogle... violation. After the catch block When we put 150 as a lower limit value, output
What will be the Output?
What will be the Output?  int[] number = {5,3,6,10,1} int temp; for (int i=0; inumbers[j]) { temp=numbers[i]; numbers[i]=numbers[j] number[j]=temp
output of the program
output of the program  public static int sum(List list) { int sum = 0; for ( Iterator iter = list.iterator(); iter.hasNext(); ) { int i = ((Integer)iter.next()).intValue(); sum += i; } return sum
arithmetic expression tree
arithmetic expression tree  how to create the java code randomly for arithmetic expression tree
regular expression for special characters
regular expression for special characters  How to find out regular expression for special characters
xml output
xml output  generate an xml output in the following format <FileCount> <DOC>AA <RTF>BB <PDF>CC <Total>DD where AA=total number of .DOC files found BB=total number of .RTF files found,etc
output error
output error  this is my program import java.io.*; public class separate { public static void main(String[] args)throws IOException...]; for (k=0;k } } if i enter "my name" as the input the output
what is the output?
what is the output?  public class MyAr{ public static void main(String argv[]) { int[] i=new int[5]; System.out.println(i[5]); } }   It gives ArrayIndexOutOfBoundsException as you haven't add element to array. Correct
what will the output
= (Parent) sonu; p.play(); What will be the output of above section of code
Application Variable
anyone show a simple sample code of storing the connection data in a variable so
javascript regular expression
javascript regular expression  i need a regular expression code for JavaScript
Expression Language execution in notepad
Expression Language execution in notepad  how to execute expression language in notepad for java i am using apache tomcat server4.0.
Cron Expression for Cron Triggers
Cron Expression for Cron Triggers  Need a cron expression that should trigger after or before n days(will be changing) of first saturday of every month
How to create variable in TensorFlow?
How to create variable in TensorFlow?  Hi, How to create variable... variable, you have to create the TensorFlow variable to use it with TensorFlow graph. Then tf.variable() method is used to create variable in TensorFlow
Java Redirect output to file
Java Redirect output to file This section illustrates you how to redirect the output to the file. It may be comfortable to a programmer if they are able... for future reference. Here we are going to discuss about redirecting console outputs
how to assign javascript variable value to a jsp variable
how to assign javascript variable value to a jsp variable  how to assign javascript variable value to a jsp variable
JSP Create Variable
JSP Create Variable          JSP Create Variable is used to create a variable in jsp. The scriptlets include a java code to be written as <%! %>
regular expression for phone number
regular expression for phone number  Hi, i need the regular expression code for phone number in PHP. Thanks.   PHP - regular expression code for phone number \+?([0-9]{2})-?([0-9]{3})-?([0-9]{6,7
Instance variable in java
Instance variable in java In this section you will learn about Instance variable in java. In java all variable must be declared before they are used. The basic form of variable declaration is : type identifier = value; The type

Ads