Find JSP which set attribute with pageContext.setAttribute

I have this statement in JSP

  String mode = (String)pageContext.findAttribute(IParameterName.POPUPMODE);

Open in new window

and I need to find where it is set?

How should I do that? Where should I look for using eclipse?
Who is Participating?

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

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.

findAttribute() will search for the attribute in page scope, session scope and application scope in that order. It will take the one it finds first.

It could be that the value is set on the jsp somewhere using a <c:set> or maybe its done through a custom tag handler.

I would suggest searching for uses of IParameterName.POPUPMODE in your project/workspace.

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
KPaxAuthor Commented:
I have this statement in JSP (it is not my code, I am rewriting someone else code):

String mode = (String)pageContext.findAttribute(IParameterName.POPUPMODE);
POPUPMODE contains value (during debug where I am right now) value: EDIT

In eclipse I used 'File Search' -> 'POPUPMODE' which indeed found another JSP where I found statement (shorted for brevity):
String gnEditPopup = "popWindow('"+RequestUtility.getSiteURL(s1Request)+"?NEXT_PAGE="+I .... .... + IParameterName.POPUPMODE +"=" +I ....  user) +"</a>)"; 

Open in new window

and then in IParameterName java class I found 'POPUPMODE' constant which indeed has a value 'EDIT'.

and I found
<input type="hidden" name="<%=IParameterName.POPUPMODE%>" value="<%=mode%>">

Open in new window

I haven't found explicit 'pageContext.setAttribute'.

Now my question is how certain I can be that I found right place where 'POPUPMODE' attribute was set and what would be more elegant - smarter way to get this instead of searching through files with file search/text search?
did you search for pageContext.setAttribute("EDIT", .....? Someone could have skipped using the constant.
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

KPaxAuthor Commented:
In whole project there are only 11 occurrences of "pageContext.setAttribute" and none of them is even remotely associated with EDIT or POPUPMODE
KPaxAuthor Commented:
I guess this would be the right place where it is set (shortened for the sake of brevity)?

String gnEditPopup = "popWindow('"+RequestUtility.getSiteURL(...)+"?NEXT_PAGE="+...."&"+ IParameterName.POPUPMODE +"=" +IConstants.EDIT + ....DetailsUtility.buildAdminEditPageInfo(...)+"','gn_popup', 600, 400);";

Open in new window

+ IParameterName.POPUPMODE +"=" +IConstants.EDIT +
maybe. You could try and set it to a different value and see if it comes up.
Although I always thought query string parameters were request parameters rather than attributes.
PageContext.findAttribute() should not be able to find query string parameters.
Would be interested to see if it works.
KPaxAuthor Commented:
I found that parameter there and I think that is the right place where it is set.
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

From novice to tech pro — start learning today.