• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1265
  • Last Modified:

how to pass an EL variable into a scriptlet?

hi,

i am setting a variable with EL syntax as mentioned below.
<c:set var ="_p0"><%=PolicyQuery.getINSURED_ADDRESS_LINE1(0)%></c:set>

am trying to call this scriptlet method like this:
<%=PolicyQuery.getSingleQuotDoubleQuotEncoding(_p0)%> --this line is throwing error.

_p0 passed in this method is set with EL , how can i get that in SCRIPTLET ?
0
mali_ini
Asked:
mali_ini
1 Solution
 
Eternal_StudentCommented:
I think you are setting the variable incorrectly, try this:

<c:set var ="_p0" value="<%=PolicyQuery.getINSURED_ADDRESS_LINE1(0)%>"/>
0
 
TimYatesCommented:
that shouldn't make any difference (afaik)
0
 
mali_iniAuthor Commented:
i m getting an error saying _p0 cannot be resolved, how can i resolve this?
0
 
rrzCommented:
You can use  
<c:set var ="_p0"><%=PolicyQuery.getINSURED_ADDRESS_LINE1(0)%></c:set>
<%
  String _p0 = (String)pageContext.getAttribute("_p0");   // I assumed String, but you have to use your correct type
%>
<%=PolicyQuery.getSingleQuotDoubleQuotEncoding(_p0)%>

Where do you want to use EL ?    rrz
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now