aspose file tools
The moose likes Portals and Portlets and the fly likes Passing value from a JSP to an iframe Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Reply Bookmark "Passing value from a JSP to an iframe" Watch "Passing value from a JSP to an iframe" New topic
Author

Passing value from a JSP to an iframe

Ankit Gandhi
Greenhorn

Joined: Nov 03, 2006
Posts: 27
How can we pass a session variable from one JSP which is in a portletSession, to another JSP which we are calling from an IFRAME present in the same JSP.


E.g. "sequenceReports.jsp" has an IFRAME which is defined as �

<IFRAME name="avlReportssource" id="avlReportssource" height= "400" width= "300" marginheight="3" frameborder="0" src='<%= renderResponse.encodeURL(renderRequest.getContextPath() + "/jsp/ebip/ebipadmin/reportadmin/reports/availReports.jsp") %>'>
</IFRAME>

Here we are using �availReports.jsp� to populate the IFRAME.

We have a variable in the session, which we want to use in availReports.jsp. In which way can this be done?

We have tried getting the session variable through request object in availReports.jsp, but didn�t get any results. The session is prevalent in sequenceReports.jsp but not present in availReports.jsp.
[ November 05, 2006: Message edited by: Bear Bibeault ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14669
    
  11

I've never tried it, but I'm wondering if you could append the parameters to the uri, like availReports.jsp?name=bob&age=21.
You get the required parameters from the session and pass them as request parameters.


[My Blog]
All roads lead to JavaRanch
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56150
    
  13

Originally posted by Ankit Gandhi:
The session is prevalent in sequenceReports.jsp but not present in availReports.jsp.


How do you know this?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Ankit Gandhi
Greenhorn

Joined: Nov 03, 2006
Posts: 27
i have already tried to pass the parameters by using availReports.jsp?name=bob&age=21 thing.
But this did not yield any value in availReports.jsp.
It returned a null value.

We are using Struts Portlets framework, where we had stored the value of a variable in the Portlet session. when we tried retrieving the variable value through the session, it gave us nothing. This proves that the session is not present in availReports.jsp
[ November 05, 2006: Message edited by: Ankit Gandhi ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56150
    
  13

Since this is a portlets question, I've moved it accordingly. Please be sure to ask questions in the appropriate forum.
[ November 05, 2006: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Passing value from a JSP to an iframe
 
Similar Threads
Dynamic change the iframe height
JSP Invoking another JSP in Iframe
Passing variable value from a JSP file to another JSP file embedded within the first
Writing HTML to IFrame - very urgent
iFrame related topic