Online Hibernate Training just in Rs. 1000

One week online training in Hibernate ORM framework. Learn Hibernate Framework and enhance your skills. Best Online Hibernate training at 90% discount. Join Now!! Offer is valid Only for limited Period!!! Online Training Big Data and Hadoop Training Java Training  
 

Redirecting the output of an expression to a variable

Ads

 
 

Share on Google+Share on Google+

soni
Redirecting the output of an expression to a variable
1 Answer(s)      8 years ago
Posted in : JSP-Servlet
Ads
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

Ads









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
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
Redirecting and forwarding to views
In this section, you will learn about redirecting and forwarding views through prefixes
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
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
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
JSP Variable in Javascript
that takes the defined variable from the jsp expression and display the message from... to insert the jsp variable values directly into the output. This  will display... JSP Variable in Javascript   
<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
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
Regular expression
Regular expression  how i write a regular expression for a pattern which present in between
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
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
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
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
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
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, Yes, a pointer is a variable
Java variable
Java variable   To what value is a variable of the String type automatically initialized
triangle output
triangle output  program to get the following output: * *   Hi Friend, Please specify the pattern properly. Thanks
Passing variable
Passing variable  How to pass variable to HTTP object in HTMl or PHP
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
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: Entering... as a lower limit value, output comes: Entering the try block. Exiting the try block
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
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
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