JSP Popup page

Hi - I have a jsp page and I had a link when some one clicks on that link
it should open a pop up page.
so I wrote the code as below

<li ><a href="#" onClick="MyWindow=window.open('jsp/addProcess.jsp','MyWindow',width=600,height=300); return false;">Click Here</a></li>

This looks good but i had two problems

1) I don't like calling another JSP, it's like opening another page. instead can I have a simple nice popup (without new jsp page) i mean something like a pop up window what you use for alert box
2) How to send the data from the main jsp page to popup window

Thanks,
shragiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mccarlIT Business Systems Analyst / Software DeveloperCommented:
1) I don't like calling another JSP
I think it will be the only way to do what you are trying to do. You are telling the browser that it should open a new window, and so it will have to make a request to know what content to display in that new window. How else would it know what to display without giving it the location of another page.

What, in particular, do you not like about what you have already got?


2) How to send the data from the main jsp page to popup window
You could do it by appending query parameters to the URL, so something like this...

<li ><a href="#" onClick="MyWindow=window.open('jsp/addProcess.jsp?data=SomeDataGoesHere&moreData=MoreDataHere','MyWindow',width=600,height=300); return false;">Click Here</a></li>

You can then access those parameters from within the popup's jsp page.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mark OlsenSr. DeveloperCommented:
If the data from the main page is static you could have the contents of the popup within a hidden element then use the Featherlight jQuery plugin to open an alert style box with the popup contents.

Featherlight can also be used to open a "lightbox" (alert box with the page below shadowed) to a JSP page if there is server side processing required.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.