Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-09-08
12
Medium Priority
?
455 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:
Gurvinder Pal Singh earned 1000 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 1000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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:Gurvinder Pal Singh
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

926 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