Solved

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

Posted on 2010-09-08
12
443 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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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 26

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
wordlen challenge 3 47
wordappend challenge 8 85
Java and GPO 11 47
Java DateChooser? 2 9
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

706 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

17 Experts available now in Live!

Get 1:1 Help Now