is it possible to use JSTL for an expression like
%=calculateDays(startDate, endDate) % ???
probably not, but I am too new to JSTL to figure it out by myself. Could
someone advise me?
This could be possible through an EL function (introduced in JSP 2.0).
The syntax would be as
Is there any way to do it without specifying the scope?
As in c:out value=${\mydomain.mybean\} (which doesn't work).
I asked this on the list awhile back and surprisingly the answer was no
[short of writing one's own taglib to get it done].
See
Hello, What is the JSTL syntax to lookup a value if the name of one's value
has a dot in, and if one wants the lookup to honor the standard scoping
lookup order rules (first page-scope, then request-scope, then
session-scope, then application-scope) ?
For example, if a value with the name a.b
Does c:out value=${['a.b']}/ work?
Good guess but, no, that gives me a JasperException.
Brian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
It appears you do not have ${list.headers}set up properly. As written, you
must have an object named list and that object must have a public
getHeaders() method that returns an array, a list or other collection.
I have the following JSP:
c:forEach items=${list.headers} var=header
thc:out
Set the escapeXml attribute to false.
c:out value=${foo} escapeXml=false /
The JSTL taglibs (c:out) re-write html tags into GT so the actual text
prints out. Is there any way to disable this?
-
To unsubscribe, e-mail:
This is a followup to a recent post to this group.
The snippet below imports a page and stores it into variable x if variable x
is more than 5 five minutes old. This makes the page load fast for the
great majority of hits.
However, if traffic to the site is slow, let's say a steady one hit
So I'd like to set one cookie, the format of which is open to suggestion,
read it in a Struts Action, do whatever with the value, and then use some
JSTL tags to decide whether or not to display a given section.
Having never done anything of the sort before, either 0010001000 or
This snippet prints out up-to-date information but it is slow ...
c:import url=channel.jsp
c:param name=rssUrl value=http://www.slowurl.rss; /
/c:import
This snippet makes it fast but stale...
c:import url=channel.jsp var=x scope=application
c:param name=rssUrl value=http://www.slowurl.rss;
Correction -- I meant to include an c:if clause around the fast but stale
way.
c:if test=${empty applicationScope.x}
c:import url=channel.jsp var=x scope=application
c:param name=rssUrl value=http://www.slowurl.rss; /
/c:import
/c:if
c:out value=${applicationScope.x} escapeXml=false /
Thanks.
You could create a Date object and compare the time property of this
object against the current time; Hans has shown how to do this in previous
messages.
It might be easier to use the Cache Taglib, which isn't part of JSTL but
does exactly what you're looking for.
Thanks, Shawn. I found
11 matches
Mail list logo