Expression Language error

Hi,

I am facing a funny problem with Expression Language in JSP specs 2.0. Whenever I write any statement using EL , the entire string gets printed as HTML output.

For e.g. If I write something like, say,

<HTML>

<BODY>

the result of 2*2 is : ${2*2}

</BODY>

</HTML>

I get the output as:the result of 2*2 is : ${2*2}

Please help me with the problem.

Thanks in advance

Dinesh

[459 byte] By [dinesh_shetyea] at [2007-11-27 11:46:26]
# 1

Yes .. You're writing it as HTML.

Use the <c:out> tag.

BalusCa at 2007-7-29 18:07:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi BalusC,

I appreciate your interest.

Do you mean that whilst writing any EL we have to use

<c:out>

${2*2}

</c:out>

please reply.

Dinesh

dinesh_shetyea at 2007-7-29 18:07:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

I recommend you to start off with a JSTL tutorial.

http://www.google.com/search?q=jstl+tutorial

BalusCa at 2007-7-29 18:07:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

Hi BalusC ,

Thanks a lot. The <c:out> tag works.

I will start with the JSTL tutorial that u have recommended.

Regards

Dinesh

dinesh_shetyea at 2007-7-29 18:07:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

>I am facing a funny problem with Expression Language in JSP specs 2.0.

>Whenever I write any statement using EL , the entire string gets printed as

>HTML output.

Take another look at the JSP2.0 spec. Specifically section 3.3.2

-

The default mode for JSP pages in a Web Application delivered using a

web.xml using the Servlet 2.3 or earlier format is to ignore EL expressions; this

provides for backward compatibility.

Check your web.xml file that it declares itself as version 2.4 or greater.

Full details in this forum post (reply #6)

http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0

evnafetsa at 2007-7-29 18:07:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...