Solved

how to transfer value from one jsp page to second jsp page

Posted on 2010-09-08
12
451 Views
Last Modified: 2013-11-24
i have one value called titleValue  at one jsp page called titleValue..i need to show this value at second jsp page.. could you please tell me how to show this value at second page or how to x:out $titleValue at second page?

this is my code at first page :
<x:set select="title" var="titleValue" scope="session"/>
<x:out select="$titleValue"/>

Open in new window

0
Comment
Question by:elaltaico
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +4
12 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 250 total points
ID: 33625012
when you submit the values to the jsp, you can retrieve the values from request object.
check these links
http://www.webmasterworld.com/forum91/896.htm
An example application http://java.sun.com/products/jsp/html/jspbasics.fm2.html
0
 
LVL 11

Assisted Solution

by:Manish
Manish earned 250 total points
ID: 33625025
As you are setting it to session,
I think you can directly get it
<x:out select="$titleValue"/>
0
 

Author Comment

by:elaltaico
ID: 33625073
karanw it works. but there is a big problem . problem is I am getting them from rss feeds and when i click one rss it goes to other page but shows last titleValue of the rssFeed not the selected one ... Let me descrbe it with the code:

[code]
 <div class="row" onclick="location.href='http://77.92.154.132:8080/WebApplication5/web/detail.jsp'">
               <table id="feed" cellspacing="0" cellpadding="2" class="haberon">
                   <tbody>
                       <tr>
                           <td valign="top" class="kresim">
                   <img src=" <x:out select="image" /> "></td>
                       <td valign="top" style="vertical-align: top;">
                           <h2><x:out select="title" /></h2>
                           <x:set select="title" var="titleValue" scope="session"/>
                           <x:out select="$titleValue"/>
                                                       <x:out select="description" escapeXml="false"/>
                       </td>
                       </tr>
                       </tbody>
               </table>
                 </div>
[/code]

Unfortunately, it shows the last itemValue of the rss feed. How I can show the SELECTED itemValue of the rss feed?
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 16

Expert Comment

by:Valeri
ID: 33625237
Set it only when you need the change, not every time you click on rss.
0
 
LVL 11

Expert Comment

by:Manish
ID: 33625243
which is SELECTED itemValue?
0
 

Author Comment

by:elaltaico
ID: 33625522
I meant there are 4 rss feeds in one page as you can see them from there : http://77.92.154.132:8080/WebApplication5/web/Gundem.jsp . When the user clicks one rss feed line, I want user to get selected or "clicked" title,description,image and show it at next page. I can show title description image at next page but unfortunately when I click one of them at previous page, I can get latest rss feeds's description,image and title. Could you please tell me how to fix that error?

Cheers
0
 
LVL 11

Expert Comment

by:Manish
ID: 33625896
Are you able to pass any one value?
you can pass same way other value.
example
http://77.92.154.132:8080/WebApplication5/web/detail.jsp?titleValue=value
then on other jsp
use request.getParameter or requestScope.titleValue to get the value
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33625914
@elaltaico: Did you checked the link i had posted in my first reply? it has an example of how to do it.
0
 
LVL 4

Expert Comment

by:msk_apk
ID: 33626067
simply

in the first jsp page,

<% request.setAttribute("titleValue","Name of the Title")%>;

in the second jsp page

<% request.getAttribute("titleValue") %>

what ever tages you are using they are also does the same in the background. it is enough to set the scope as request because as long as you do jsp:include, no new Request object will be created.  When you do redirect then only new request object will be created.
0
 
LVL 3

Expert Comment

by:ss_p
ID: 33638713
wat is the value returing from the rss feed. you have to make sure the value for titleValue from the rss feed should be set as selected value.
0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 37158223
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 136
Is Applet the way to go for my drag and drop system? 8 51
Coding for the first time 9 103
Firefox and firebub 5 29
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question