Simple question, taglibs on eclipse-specific

2003-10-18 Thread Manos Papantoniou
I have a relatively basic question, and I expect someone who has been using
taglibs with eclipse to be able to answer it. I have very recently started
using eclipse, JSP and taglibs so please excuse me if you find this question
trivial. I have looked in the archives and couldn't find the answer, I
suppose this is too basic for most people to ask, but since I can't solve it
for a few hours... here is the problem:

I am using eclipse 2.1, with tomcat 5.0.12beta and the Lomboz plugin on a
windows machine. Java version is

java version "1.4.2_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)

I created a Lomboz J2EE project, and then a web module inside the project.
Simple JSP pages created in the module are deployed fine (when I say simple
I mean without taglibs). Also, the JSP 2.0 Expresion Language works fine (I
had to change the web.xml definition for that, since the one that is
automatically created by lomboz refers to the older style 2.3 but we want
2.4 for the EL to work), so my web.xml starts like that:


http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd">

Now I have tried to add a taglib statement in the first line of the jsp page
and the eclipse editor flags it as an error. The statement is:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>

as the taglibs readme states:

USING THE STANDARD TAG LIBRARY

To use this distribution with your own web applications, simply copy the JAR
files in the 'lib' directory (jstl.jar and standard.jar) to your
application's
WEB-INF/lib directory (add the other dependencies as well if your runtime
does not already provide them). Then, import JSTL into your pages with the
following directives:

  CORE LIBRARY
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>

I have followed the readme instructions that come with taglibs (the precise
taglibs file I downloaded is jakarta-taglibs-20031006.zip). I copied the 2
libraries from the
jakarta-taglibs-20031006\jakarta-taglibs-standard-1.1.0-B1\lib folder,
jstl.jar and standard.jar to the WEB-INF\lib folder of my project, but still
the error is there. I have tried changing the uri to all variations,
removing the "/jsp" part, including the _rt in the end and everything. I
have tried adding the required libraries (.jar files) to the eclipse Project
Properties / Java Build Path / Libraries, since I think this is probably
some internal eclipse configuration issue, and by doing it through the IDE
it would generate the required dependencied internally, but the error is
still there.

Can anyone who uses taglibs with eclipse tell me how do you configure the
libraries? I cannot use the taglibs at all if I don't solve this, I have
spend several hours looking on the net, on the eclipse site, and the taglibs
archive but I cannot find this anywhere, everybody refers to more complex
problems. Can someone please help?

Thanks




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: break in c:forEach

2003-10-18 Thread Jason Lea
If you just want the first item in the collection you might be able to use:



	



this should iterate over only the first item and then end (i hope).
Or else you might try this, without the iteration


which should get item at index 0 from the array or list..

Balakrishnan, Vijay wrote:

Hi,

I want to use a break in a c:forEach as follows:

c:forEach items="${lecContacts}" var="lecContactFirst" varStatus="status">
 	
 		
 			
/>
 		
 		
			
 			
 		
  

I don't want to use  flag if that is possible.

Thanks in advance,
Vijay
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
Jason Lea


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: break in c:forEach

2003-10-18 Thread Shawn Bayern
On Fri, 17 Oct 2003, Balakrishnan, Vijay wrote:

> I want to use a break in a c:forEach as follows:
>
> 
>   
>   
> 
>   
>   
>   
>   
>   
>   
>
> I don't want to use flag if that is possible.

Because such a "break" was impossible to implement on JSP 1.2, JSTL 1.0
doesn't implement it.  (To my knowledge, there are no plans to implement
it in the future.)  Note that in your example, it's not necessary;
${status.first} will be true for only the first element in your loop, so
it would be clearer just to turn the  tag into a  tag and be
done with it.

But in the general case, you'll need to use a flag.

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]