Solved

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

Posted on 2010-09-08
12
449 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
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse package explorer vs project explorer view 2 121
Java Timer (static) 9 43
nextBoolean(double p) for Random class 3 40
web services creation SOAP vs REST 5 37
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now