This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSP and the fly likes display a jsp in a popup window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "display a jsp in a popup window" Watch "display a jsp in a popup window" New topic

display a jsp in a popup window

Komal Amaresh
Ranch Hand

Joined: Oct 06, 2008
Posts: 67

I want to display a jsp an a popup on clicking a hyperlink.
I' am setting the values using a bean and storing the values in a list and setting the attribute in a servlet, in the session.
I' am then calling this servlet on action on the form by which I' am retrieving the attributes in the DisplayData.jsp.
The initial page is the index.jsp which needs no action on which I have displayed the hyperlink.

the js code is as follows

The link is set as

This is throwing a null pointer exception.
I' am unable to understand the null pointer exception.


Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

It means something is null that is being dereferenced. Without further information it's impossible to guess what the issue is.

I suspect it also means that you have Java code in your JSPs? Poor practice if so.

[Asking smart questions] [About Bear] [Books by Bear]
Komal Amaresh
Ranch Hand

Joined: Oct 06, 2008
Posts: 67
I' ve got it. There was no need to call a servlet at the first instance.
I just wanted to try a pop up. I had static data in the model, therefore. Further, I just had to pass the list to jsp by calling an instance pf the model. the attribute set was returning null as I was returning the action to servlet from the jsp.
This is my opinion. I hope I' am right. There were values in the list i had set as the attribute. But the error displayed was in the loop I was running in the jsp and at the requestdispatcher i had forwarded to the jsp.

Please let me know if I' am right.

I agree. Here's the link:
subject: display a jsp in a popup window
It's not a secret anymore!