looping on a list of lists (or accessing custom attributes of a list)

2006-06-03 Thread Luca Passani
Hi guys, here is my big problem today. I have a list the items of two kinds (with and without icons) which gets turned into a list of lists. [x , x, y, x,y, y, y, y,x, x,y] becomes [[x,x],[y],[x],[y,y,y,y],[x],[y]] When I render the list of lists in my JSP, I need to understand which kind

Re: looping on a list of lists (or accessing custom attributes of a list)

2006-06-03 Thread Luca Passani
Martin Cooper wrote: Hmm... ;-) Two suggestions: 1) Instead of extending ArrayList, just encapsulate it. In other words, add a property to LinkWithIconList for the list, so that you can access the list explicitly using ${sub_list.list} or something. This seems like the simplest

Weblogic 9.0 and JSTL 1.1 ${variable} expansion

2006-04-22 Thread Luca Passani
Hello, I'm involved in a distributed project. I develop a web app using Tomcat5, JSTL 1.1, Struts, Java 1.5 (but compiling for 1.4) and when I am done, someone somewhere else re-builds my app for Weblogic 9.0 and integrates with the back-end. Unfortunately, things are not going 100% smooth.

Re: c:set and runtime expressions

2006-04-05 Thread Luca Passani
Tarek Nabil wrote: Thanks a lot Luca for pointing this out. I must say it's completely new information to me. I wonder if it's really accurate and relevant to all containers. For example, in Oracle Containers for Java (OC4J), when you redeploy an application, the OC4J instance is restarted.

Re: c:set and runtime expressions

2006-04-04 Thread Luca Passani
only marginally relevant to this thread, I recently read arguments against using Singletons in web apps: http://wiki.apache.org/tomcat/OutOfMemory Luca Tarek Nabil wrote: Thanks a lot Kris for the explanation. Actually, I'm starting to feel that moving to JSTL 1.0 was not such a wise

Re: Mixing EL and Java expressions

2006-03-22 Thread Luca Passani
Since Martin Cooper is probably still sleeping in his time zone, here is how I fixed the constants problem thanks to him once. You need something called the unstandard tag-lib by Apache: http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/index.html once you have that, you can do

Re: Pagination source code

2005-12-18 Thread Luca Passani
I asked a similar question a few months back. It appears that pagination is considered business-logic by some and view by others. Personally, I found that the following approach worked really well for me (it was a struts application): - I considered pagination part of the business logic - I

Re: JSTL and test for file existence

2005-11-25 Thread Luca Passani
Martin Cooper wrote: I don't believe so, and I'd be rather surprised if there was. Remember that there is no guarantee that there even *is* a file system in a webapp environment, so providing access to such a thing in a standard way doesn't really make sense. Of course, you can always create

random numbers and JSTL

2005-10-24 Thread Luca Passani
is there a JSTL trick to generate a random number? my problem is that I am desperate about disabling a cache and I need to make sure that a certain URL is perceived as different from a browser by adding stuff to the URL: href=http://url.do?d=c:out value=? / I could do this with a

Re: random numbers and JSTL

2005-10-24 Thread Luca Passani
Thanks! I had to turn it inot this for Tomcat4: cache_buster=c:out value=${now.time}/ but it did the job Luca Hassan Schroeder wrote: Luca Passani wrote: is there a JSTL trick to generate a random number? Not random, but for the cache-busting behavior you want, how about

translation from scriptlet

2005-09-09 Thread Luca Passani
How can I translate this: %=(name.length()20 ? name.substring(0,20) : name)% into its JSTL equivalent? Thanks Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: JSTL and Java Constants

2005-08-31 Thread Luca Passani
Martin Cooper wrote: Yes, it will work the same. It works like a charm. You rock. Thanks Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

JSTL, struts and pagination

2005-08-31 Thread Luca Passani
people, what's the elegant way to do pagination with JSTL? I am using struts, my Action generates a LinkedList which a JSP page is supposed to visualize: c:forEach var=item items=${content_list} c:out value=${item.name}/br / /c:forEach I'd like the JSP to recognize long lists and

JSTL and Java Constants

2005-08-30 Thread Luca Passani
Hi there, here is my big problem today. I am using JSTL in some JSPs. SInce this is a struts project, I would like to keep my views totally separated from the Java APIs. For this reason, I need your advice about the most elegant to compare a given object type (an int constant) with the

Re: JSTL and Java Constants

2005-08-30 Thread Luca Passani
Martin Cooper wrote: Take a look at the 'bind' tag in the Jakarta Taglibs Unstandard tag library. See: http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/index.html#bind interesting. Do you have an example of how that should be used? Thanks Luca

Re: JSTL and Java Constants

2005-08-30 Thread Luca Passani
Martin Cooper wrote: and then 'TheConstants' contains a map of all constants in the class, so you can use, for example: ${TheConstants.URL} bang on. That would be cool. I have worked my problem around in my application, but your solution would be better, since it would decouple my

Re: TagSupport vs BodyTagSupport

2005-07-24 Thread Luca Passani
Martin, Rahul thanks a lot to you both for answers in both threads. Very instructive. Unfortunately I have to support both versions of JSPs, so SimpleTag is out of question. I found a neat trick (used in another tag-lib) which prevented me to support two versions of my code while supporting

TagSupport vs BodyTagSupport

2005-07-23 Thread Luca Passani
Hello, I would love to hear about some taglib theory here. My understanding is that, when creating a new tag, I can inherit from either TagSupport or BodyTagSupport depending on whether I need to manipulate the tag content or not. For this reason, most of my tags (WALL library) inherit from

Optimizing tag-lib performance

2005-07-23 Thread Luca Passani
Hello again, I would like to improve the performance of a tag-lib I have created. Some obvious optimizations would be to turn things like: --- out.print( href=\+href+\); //title is optional if (!title.equals()) { out.print( title=\+title+\); } ---

Re: TagSupport vs BodyTagSupport

2005-07-23 Thread Luca Passani
Struts on the Struts mailing lists, rather than here. -- Martin Cooper On 7/23/05, Luca Passani [EMAIL PROTECTED] wrote: Hello, I would love to hear about some taglib theory here. My understanding is that, when creating a new tag, I can inherit from either TagSupport or BodyTagSupport

Re: Integrating Struts with my taglib

2005-07-21 Thread Luca Passani
Martin Cooper wrote: You probably want to look at the way the Struts tags are implemented, and especially the latest code in 'trunk'. The code you want has most likely already been extracted into the RequestUtils and TagUtils classes, outside the tags themselves. ok. Thanks. I'll post here

Integrating Struts with my taglib

2005-07-19 Thread Luca Passani
Hello, I have developed a JSP tag-library to fix mark-ups on mobile phones (WALL). Some people are using it with struts and they request that my anchor tag wall:a integrates with Struts by being able to mimic the behavior of the struts html:link tag:

Re: Integrating Struts with my taglib

2005-07-19 Thread Luca Passani
Martin Cooper wrote: Pointer 1 would be to ask about this on the Struts lists rather than the Taglibs lists, since the Struts taglibs are part of, uh, Struts, not Taglibs. ;-) you are right of course. It's just that I knew that you (one of the major authors behind the Struts taglibs) are

Re: question about integration with log4j

2005-02-01 Thread luca passani
Do you use some tricks to make the compiler remove the debugging info completelly at build time? for ex, making isBebug() return a constant false value? Luca David McReynolds wrote: On the last two struts projects we have adopted the policy of wrapping our log4j info and debug statements