Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 950
  • Last Modified:

How to read a scriptlet variable in a core (c:out) jsp tag

<%
String readMe = "Hi Experts";
%>

<c:out value="readMe"/>

--------------------------------------------------
the code above fails.
---------------------------------------------------
0
bcisystems
Asked:
bcisystems
  • 2
1 Solution
 
rrzCommented:
Try it this way.
<%
String readMe = "Hi Experts";
%>

<c:out value="<%=readMe%>"/>
0
 
rrzCommented:
Try this code too.
<%
  String scriptingVariable = "Hello";
  pageContext.setAttribute("scopedVariable", scriptingVariable);
%>
<c:out value="${scopedVariable}" /> everybody !
Or simply just use EL in your text
${scopedVariable} my name is rrz.

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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