Solved

Unable to pass parameters using session in jsp

Posted on 2011-02-16
4
486 Views
Last Modified: 2012-05-11
I have two .jsp's.

In first jsp, i have String []
and used <A></A> to open second jsp in which .swf is embedded.

so , i am able to pass this cmd(String arrays) from firstjsp to second jsp, from there i can see my .swf opening in second jsp by passing this cmd using flashvars.

Now, when i colse secondjsp window, trying to agian click on <A>Commands Help</A> from firstjsp,i see showing blank window for secondjsp.


I have two .jsp's.

In first jsp, i have String []
<%
	String []cmd = (String [])request.getAttribute("cmd_list");
	
%>
and used <A>Commands Help</A> to open second jsp in which .swf is embedded.

so , i am able to pass this cmd(String arrays) from firstjsp to second jsp, from there i can see my .swf opening in second jsp by passing this cmd using 

flashvars.

Now, when i colse secondjsp window, trying to agian click on <A>Commands Help</A> from firstjsp,
i see showing blank window for secondjsp.

code in first .jsp:
--------------

<%
	String []cmd = (String [])request.getAttribute("cmd_list");
	session.setAttribute("cmdlist",cmd);
	String urlEnc = response.encodeURL("/second.jsp");
%>

	<A HREF="javascript:var w = window.open('','IpfrHelp','resizable=yes,scrollbars=yes,height=700,width=718'); w.location.href='<%=urlEnc%>'; void 

1;">Commands Help</A></TR>

code in second .jsp:
--------------

<%
    
     String[] cmdlist={};
     StringBuffer strData = new StringBuffer();
     String separator = ",";

      cmdlist = (String [])session.getAttribute("cmdlist");
      if(cmdlist.length>0)
		{
			strData.append(cmdlist[0]);
			for(int i=1;i<cmdlist.length;i++)
			{
				strData.append(separator);
				strData.append(cmdlist[i]);
			}
		}
%>
<script type="text/javascript">
            var swfVersionStr = "0";
            var xiSwfUrlStr = "";
            var flashvars = {};
            flashvars.strData = "<%= strData %>";
	    swfobject.embedSWF(
                "/flexapp/E2EView/CmdHelpViewRedesign.swf ", "flashContent",
                "700", "700",
                swfVersionStr, xiSwfUrlStr,
                flashvars, params, attributes);
</script>

the first .jsp control comes from some .jsp <-- .cgi, when i close these first and second .jsp's and start opening from .cgi page , it is working well. Not 

showing any blank screen.

Open in new window

0
Comment
Question by:Alpita
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 27

Expert Comment

by:rrz
ID: 34910526
I am just a JSP expert. I don't know about the flash code. Maybe I will be able to help you.
Please look at the page source in the browser. Show us both sources. One for the page that works and the other for the page that is blank.
0
 

Author Comment

by:Alpita
ID: 34912652
Thanks for your information. I solved my problem. I see some code related to session in second jsp page.
session.invalidate();
Once i comment that code, it is working fine.
0
 
LVL 27

Accepted Solution

by:
rrz earned 500 total points
ID: 34912690
Ok, you can accept your comment as the solution.
0
 

Author Closing Comment

by:Alpita
ID: 34931512
Thanks.It is working now.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 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