tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <d...@cornell.edu>
Subject Re: Tomcat 6 + Jstl
Date Wed, 30 May 2007 14:38:20 GMT
True .... sreq has to be the name of an attribute of pageContext, 
request, session, or servletContext.

-David

Pid wrote:

> David Smith wrote:
>
>> Try this instead:
>>
>> ${(sreq.vrs eq 0) and (empty sreq.query) and (empty sreq.ilettera)}
>
>
> Assuming that 'sreq' is a valid object...
>
>> Your use of the el expressions needs some refinement.  Specifically 
>> you don't call methods like you would in a jsp:expression tag or in 
>> generic java.
>>
>> someBean.getSomething() is replaced with someBean.something
>>
>> Also you don't need to test for equivalence to "".  The empty 
>> operator does this and null testing very well.
>>
>> --David
>>
>> Manca Davide wrote:
>>
>>> I don't understand the reason I'm getting these 2 errrors.
>>>
>>>
>>>
>>> org.apache.jasper.JasperException: <h3>Validation error messages from
>>> TagLibraryValidator for c in 
>>> /cgi/cocktails/browse/listing.cgi</h3><p>9:
>>> tag = 'if' / attribute = 'test': An error occurred while parsing custom
>>> action attribute "test" with value "${(sreq.getVrs()==0) &&
>>> (sreq.getQuery().equals(""))&&(sreq.getIlettera().equals(""))}":
>>> Encountered "(", expected one of [".", ">", "gt", "<", "lt", "==", 
>>> "eq",
>>> "<=", "le", ">=", "ge", "!=", "ne", ")", "[", "+", "-", "*", "/", 
>>> "div",
>>> "%", "mod", "and", "&&", "or", "||"]</p><p>54: tag = 'when'
/ attribute
>>> = 'test': An error occurred while parsing custom action attribute 
>>> "test"
>>> with value "${((sreq.getVrs()==0) &&
>>> (status.index>0))||(sreq.getVrs()>0)||(!sreq.getQuery().equals(""))||(!s

>>>
>>> req.getIlettera().equals("")) }": Encountered "(", expected one of 
>>> [".",
>>> ">", "gt", "<", "lt", "==", "eq", "<=", "le", ">=", "ge", "!=", "ne",
>>> ")", "[", "+", "-", "*", "/", "div", "%", "mod", "and", "&&", "or",
>>> "||"]</p>
>>>
>>>
>>>
>>>
>>>
>>> and
>>>
>>>
>>>
>>>
>>>
>>> org.apache.jasper.JasperException: Unable to compile class for JSP:
>>> An error occurred at line: 80 in the jsp file: /cgi/commons/listing.cgi
>>> Syntax error, insert "while ( Expression ) ;" to complete
>>> BlockStatements
>>> <c:choose>
>>> <c:when test="${sbean.TotProgrammi>0}">
>>> <table cellpadding="0" width="100%" cellspacing="0"
>>> border="0"><tr><td><div id="box-tit"><div id="data">
>>> <%=htgiorni.get(fmt3.format(new java.util.Date(yyyy+"/"+mm+"/"+gg)))%>
>>> <%=fmt2.format(new java.util.Date(yyyy+"/"+mm+"/"+gg))%>
>>> <%=htmesi.get(fmt4.format(new
>>> java.util.Date(yyyy+"/"+mm+"/"+gg)))%></div><%if
>>> (!oraCheck.equals("-2")){%><div id="box-ora">&nbsp; cambia fascia
>>> oraria<table cellpadding="0" cellspacing="0" border="0"
>>> id="cambia-ora"><tr><td><%if (Integer.parseInt(ora) >= 2)
{%><a
>>> href="?day=<%=fmt.format(new
>>> java.util.Date(yyyy+"/"+mm+"/"+gg))%>&hour=<%=Integer.parseInt(ora)-2%>&

>>>
>>> type=<%=request.getParameter("type")%>&chtype=<%=request.getParameter("c

>>>
>>> htype")%>&channel=<%=request.getParameter("channel")%>&tipo=2"><%}%><img

>>>
>>> src="/guida_tv/images/freccia_indietro.gif" alt="indietro"
>>> border="0"/><%if (Integer.parseInt(ora) >= 2)
>>> {%></a><%}%></td><td>&nbsp;<%=ora%>.00-<%=orapiudue%>.00&nbsp;</td><td><

>>>
>>> %if (Integer.parseInt(ora) < 22) {if (Integer.parseInt(ora) >= 21) 
>>> {%><a
>>> href="?day=<%=fmt.format(new
>>> java.util.Date(yyyy+"/"+mm+"/"+gg))%>&hour=<%=Integer.parseInt(ora)+1%>&

>>>
>>> type=<%=request.getParameter("type")%>&chtype=<%=request.getParameter("c

>>>
>>> htype")%>&channel=<%=request.getParameter("channel")%>&tipo=2"><%}
else
>>> {%><a href="?day=<%=fmt.format(new
>>> java.util.Date(yyyy+"/"+mm+"/"+gg))%>&hour=<%=Integer.parseInt(ora)+2%>&

>>>
>>> type=<%=request.getParameter("type")%>&chtype=<%=request.getParameter("c

>>>
>>> htype")%>&channel=<%=request.getParameter("channel")%>&tipo=2"><%}%><%}%

>>>
>>>  
>>>
>>>> <img src="/guida_tv/images/freccia_avanti.gif" alt="avanti"
>>>>   
>>>
>>> border="0"/><%if (Integer.parseInt(ora) < 22)
>>> {%></a><%}%></td></tr></table></div></div><%}%></td></tr></table><br><!-

>>>
>>> -/data e fascia oraria --><%}%>
>>> </c:when>
>>> </c:choose>
>>> <%
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Thank you
>>>
>>>
>>>  
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message