Solved

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

Posted on 2010-09-13
2
930 Views
Last Modified: 2013-11-24
<%
String readMe = "Hi Experts";
%>

<c:out value="readMe"/>

--------------------------------------------------
the code above fails.
---------------------------------------------------
0
Comment
Question by:bcisystems
  • 2
2 Comments
 
LVL 27

Expert Comment

by:rrz
ID: 33668336
Try it this way.
<%
String readMe = "Hi Experts";
%>

<c:out value="<%=readMe%>"/>
0
 
LVL 27

Accepted Solution

by:
rrz earned 500 total points
ID: 33668379
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
wordappend challenge 8 222
custom annotations 9 47
servlet  URL Rewriting 1 50
ejb wildfly example 2 71
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question