Solved

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

Posted on 2010-09-08
12
448 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

863 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

28 Experts available now in Live!

Get 1:1 Help Now