Reputation: 429
One of my jsp has a function in declaration
<%!
public String performLogic(String state) throws Exception {
String resposeXML = "";
resposeXML = GetRequestViaXML(pageContext);
}
%>
This performLogic function need to call a GetRequestViaXML function by passing pagecontext as parameter,So this pagecontext will be used to get all attributes which are set previously in jsp's .
I cannot modify parameters of performlogic nor GetRequestViaXML.
Is it is possible to get the page context inside declaration part of jsp like
pageContext.setAttribute("AppName","IVR");
pageContext.setAttribute("TransactionName","Billing");
Upvotes: 4
Views: 1159
Reputation: 17839
You can access pageContext
Object inside your declaration only if you pass it as parameter:
public String performLogic(String state, PageContext pc) throws Exception {
pc.setAttribute("AppName","IVR");
......
}
Upvotes: 2