Hi, I wrote a html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD>
<TITLE>p442.html</TITLE> </HEAD> <BODY> <P><strong>When you buying a car what is most important to you?</strong></P> <FORM METHOD="POST" ACTION="p442Jstl.jsp"> <INPUT TYPE="RADIO" NAME="btn1" VALUE="Performance"> Performance <BR> <INPUT TYPE="RADIO" NAME="btn1" VALUE="Safety"> Safety<BR> <input type="RADIO" Name="btn1" value="Maintance"> Maintance<br> <input type="submit" value="submit">
</FORM>
</BODY> </HTML> and I wrote a jsp
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <html><body> <% String Pref = (String)request.getParameter("btn1"); %> <c:if test="${pref eq "Performance"}"> Now you can stop even if you do drive insanely fast </c:if> <c:if test="${pref =="Safety"}" > Our breaks won't look up no matter how bad drive you are </c:if> <c:if test="${pref == "Maintance"}"> No Problem you won't have to service these breaks </c:if> </body></html>
while runing this code in Tomcat 5.0 I am geting this error org.apache.jasper.JasperException: /p442Jstl.jsp(5,34) equal symbol expected.
Can anybody explain me where I did wrong? Thanks Jyothi
Jeroen Wenting
Ranch Hand
Joined: Oct 12, 2000
Posts: 5093
posted
0
instead of 'eq' use ==. In JSTL that's acceptable to compare Strings, the compiler will translate it into a call to equals() for you.
42
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.