• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 956
  • 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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