Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing value from a JSP to an iframe

 
Ankit Gandhi
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ankit Gandhi:
The session is prevalent in sequenceReports.jsp but not present in availReports.jsp.


How do you know this?
 
Ankit Gandhi
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic