Solved

Request object from parent to child jsp

Posted on 2009-05-13
11
834 Views
Last Modified: 2012-06-22
How to forward Request object from parent to child in jsp ... I'm using window.open

Tried all kind of options but with no result :)
0
Comment
Question by:pradeepp12
  • 7
  • 4
11 Comments
 
LVL 12

Expert Comment

by:Gibu George
ID: 24376193
Is it like you are having a set of fields in a form in the parent window which you want to submit to the popup window?

OR

is it like you want are setting something in the request as an attributein parent window(jsp)  which you want to use in the popup(jsp)?
0
 
LVL 2

Author Comment

by:pradeepp12
ID: 24376237
No.

Actually i have some objects(java beans) already in the request parameter of the parent jsp. Now i want all those Objects in my Child window so that i can use ${requestScope.mybean.value}  and display the result in the child window

thanks
0
 
LVL 12

Expert Comment

by:Gibu George
ID: 24376286
You will not be able to get it directly as the popup is a new window and hence a new request object is created.
0
 
LVL 2

Author Comment

by:pradeepp12
ID: 24376348
Any suggestion that you may have for this problem ? Is there any other way that i can pass these objects to the child window?
0
 
LVL 12

Assisted Solution

by:Gibu George
Gibu George earned 500 total points
ID: 24376382
you cannot pass the bean objects through request. one way is to pass it through session, but I wouldn't suggest that. But if you the bean itsel you can pass it as session attribute but make sure that after your need you remove it from session.
0
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.

 
LVL 12

Expert Comment

by:Gibu George
ID: 24376405
If you can get the bean object using the fields in the parent window you can get that. Other wise if you just want one or two values in the bean you pass those as parameters appended to URL, to the popup window
0
 
LVL 2

Author Comment

by:pradeepp12
ID: 24376489
"If you can get the bean object using the fields in the parent window", I didn't get this part? Can i have code snippet ?

AND

you have any code snippet for passing object through session in window.open ?

Thanks a lot
0
 
LVL 12

Accepted Solution

by:
Gibu George earned 500 total points
ID: 24376548
>you have any code snippet for passing object through session in window.open

in parent window

session.setAttribute("<bean name>",<beanobject>);

in popup

session.getAttribute("<bean name>") and cast it to bean objects type
0
 
LVL 12

Expert Comment

by:Gibu George
ID: 24376597
> If you can get the bean object using the fields in the parent window

say you have thje employee details in the current page like name, empid etc. and your bean like

public class EmployeeBean{

private String name;
private String id;
...
...
also you have getters and setters.
}
then when you open the popup, if the number of parameters is less and will not exceed the max url length then you can pass it them as query string and in the popup get the values from request and create a new object of the Employee and set the values



0
 
LVL 12

Assisted Solution

by:Gibu George
Gibu George earned 500 total points
ID: 24376607
also if you are using session make sure that you do this

session.setAttribute("<bean name>",null);
so that it will not be available in the sesion nolonger
0
 
LVL 2

Author Comment

by:pradeepp12
ID: 24376681
Thank you so much for all the replies....

as  suggested, I will use session and will make sure that i will make it null after i use it..

Thanks once again
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

Suggested Solutions

Title # Comments Views Activity
String format issue 13 90
Struts tiles for layout structure along with Angular JS. 4 152
Set up Wildfly 10 8 362
Java Exception example issues 11 84
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

23 Experts available now in Live!

Get 1:1 Help Now