Solved

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

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

<c:out value="readMe"/>

--------------------------------------------------
the code above fails.
---------------------------------------------------
0
Comment
Question by:bcisystems
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Suggestion on WebSite Template Sites 6 124
replace a word with other 1 54
hibernate example using maven 12 111
glassfish admin console 1 53
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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.
Suggested Courses

751 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