You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by RAJAGOPAL Deepak <RD...@COVANSYS.com> on 2002/08/06 18:01:48 UTC

WSAD and JSTL

Hi,
Im trying to use JSTL (I tried both 1.0 and 1.1?) with WebSphere Studio
Application Developer .

My web.xml is as under
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app id="WebApp">
	<display-name>TestIsolationWeb</display-name>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>
	<taglib>
	
<taglib-uri>http://jakarta.apache.org/taglibs/dbtags</taglib-uri>
		<taglib-location>dbtags.tld</taglib-location>
	</taglib>
	<taglib>
        <taglib-uri>coret</taglib-uri>
        <taglib-location>c.tld</taglib-location>
    </taglib>
</web-app>



and in my jsp I have 
<%@ taglib uri="http://jakarta.apache.org/taglibs/dbtags" prefix="sql" %>
<%@ taglib uri="coret" prefix="c" %>

The web.xml seems to be fine and I do have the tld in the right place(the
dbtags tld works fine
and the reason the taglib-location merely refers to c.tld is that wsad seems
to assume the WEB-INF)
and the jars have been introduced into the WEB-INF/lib directory

but then the taglib tag for the core in my jsp gives me 
JspTranslate: Unable to open taglibrary coret:JSPG0111E:Unable to open the
tag library descriptor:Operation timed out:no further information

please note that the coret rather than the standard uri pointing withing
java.sun.com was added after
I got the error (because this error rather confused me) in case it was
actually trying for some reason to 
open a connection to the uri(So far as I know the uri pointing within
java.sun.com is there merely
to make it unique) and failing .

Any help at all would be really appreciated .


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Root Element Error

Posted by Shawn Bayern <ba...@essentially.net>.
On Wed, 7 Aug 2002, Ben Ramsey wrote:

> > The easiest way to lump 'empty' and 'null' together is with the
> > JSTL EL's 'empty' keyword, as in
> > ${empty param.foo}
> 
> So, I would use that like this?:
> 
> <c:if test="${empty param.foo}">
>   Body content.
> </c:if>

Sure - as in

 <c:if test="${empty param.name}">
   You must enter your name!
 </c:if>

"JSTL in Action" has a large section devoted to form validation of this
type.

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


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Root Element Error

Posted by Ben Ramsey <be...@eureka-interactive.com>.
> The easiest way to lump 'empty' and 'null' together is with the
> JSTL EL's 'empty' keyword, as in
> ${empty param.foo}

So, I would use that like this?:

<c:if test="${empty param.foo}">
  Body content.
</c:if>


Ben Ramsey
Technical Director
EUREKA! Interactive, Inc.
770-642-0390
www.eureka-interactive.com



-----Original Message-----
From: Shawn Bayern [mailto:bayern@essentially.net]
Sent: Wednesday, August 07, 2002 10:50 AM
To: Tag Libraries Users List
Subject: RE: Root Element Error


On Wed, 7 Aug 2002, Ben Ramsey wrote:

> In ASP I can check the length of a form parameter or a querystring
> parameter to check whether or not it contains any data.  If the
> parameter doesn't exist, or if it does exist but doesn't contain any
> data, then it just returns a length of zero, thus I can tell whether
> anything has been passed through.
> 
> It looks to me that, in JSP, if the parameter does exist but doesn't
> contain any data, then it's simply empty but not null.  However, if it
> doesn't exist, then it's null.
> 
> How can I check for this in JSP?  Using JSTL?

The easiest way to lump 'empty' and 'null' together is with the JSTL EL's
'empty' keyword, as in

  ${empty param.foo}

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



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Root Element Error

Posted by Shawn Bayern <ba...@essentially.net>.
On Wed, 7 Aug 2002, Ben Ramsey wrote:

> In ASP I can check the length of a form parameter or a querystring
> parameter to check whether or not it contains any data.  If the
> parameter doesn't exist, or if it does exist but doesn't contain any
> data, then it just returns a length of zero, thus I can tell whether
> anything has been passed through.
> 
> It looks to me that, in JSP, if the parameter does exist but doesn't
> contain any data, then it's simply empty but not null.  However, if it
> doesn't exist, then it's null.
> 
> How can I check for this in JSP?  Using JSTL?

The easiest way to lump 'empty' and 'null' together is with the JSTL EL's
'empty' keyword, as in

  ${empty param.foo}

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


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Root Element Error

Posted by Ben Ramsey <be...@eureka-interactive.com>.
Alright.  Nevermind what I said... I am completely stupid.  All is working
well.  I'm not quite sure where that error came from because I'm not getting
it anymore.  I figured out why the page wouldn't display, though: I had
forgotten to include the proper querystring, and, because of this, it didn't
know what page to include in the include statement.

I do have a new question along these lines...

In ASP I can check the length of a form parameter or a querystring parameter
to check whether or not it contains any data.  If the parameter doesn't
exist, or if it does exist but doesn't contain any data, then it just
returns a length of zero, thus I can tell whether anything has been passed
through.

It looks to me that, in JSP, if the parameter does exist but doesn't contain
any data, then it's simply empty but not null.  However, if it doesn't
exist, then it's null.

How can I check for this in JSP?  Using JSTL?

Ben Ramsey
Technical Director
EUREKA! Interactive, Inc.
770-642-0390
www.eureka-interactive.com



-----Original Message-----
From: Shawn Bayern [mailto:bayern@essentially.net]
Sent: Tuesday, August 06, 2002 6:36 PM
To: Tag Libraries Users List
Subject: Re: Root Element Error


Feel free to post a sample page; that might help.  I don't suspect the
problem is a real XML document is required; I don't know of any mode in
Tomcat that causes it to operate like this (and it would indeed be
noncompliant against the JSP 1.2 standard -- you are certainly allowed to
continue using the non-XML syntax).  I suspect the problem is with the
intermediate, automatically generated XML view of your JSP page, which is
fed through a SAX processor in order to be validated.  It's hard to say
what's causing the problem, though, without seeing a full page and the
full stack trace.  Also, are you sure you're using the released version of
4.0.4?

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

On Tue, 6 Aug 2002, Ben Ramsey wrote:

> Well, I was finally able to get Tomcat 4.0.4 installed on my Cobalt RaQ4,
> thanks to some help from the Cobalt Developers' Mailing List (check the
July
> and August 2002 archives if you want to see the conversation:
> http://list.cobalt.com/pipermail/cobalt-developers/ ... look for messages
> titled "Installing Tomcat 4x on a Linux machine")!
>
> Now, I can successfully run JSPs on my server that contain Java code
> fragments, but when I try to use any JSP tags, I get the following error:
>
>
> Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
> --------------------------------------------------------------------------
--
> ----
> type Exception report
>
> message Internal Server Error
>
> description The server encountered an internal error (Internal Server
Error)
> that prevented it from fulfilling this request.
>
> exception
>
> javax.servlet.ServletException: Error on line 1 of document  : The root
> element is required in a well-formed document. Nested exception: The root
> element is required in a well-formed document.
>
>
> Now, I know what this means: it's trying to force me to create JSP pages
> containing tags as well-formed XML pages; it wants me to use the
<jsp:root>
> tag, I think.  This is all fine and dandy, but the earlier version of
Tomcat
> I was using (3.2.3) didn't make this requirement of my code, and now I
have
> to completely recode all my pages.
>
> Is this a requirement of the JSP container, and/or is there a setting that
I
> can modify to make Tomcat more lenient on this... or do I have something
> configured wrong somewhere?
>
> Thanks.
>
> Ben Ramsey
> Technical Director
> EUREKA! Interactive, Inc.
> 770-642-0390
> www.eureka-interactive.com
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Root Element Error

Posted by Shawn Bayern <ba...@essentially.net>.
Feel free to post a sample page; that might help.  I don't suspect the
problem is a real XML document is required; I don't know of any mode in
Tomcat that causes it to operate like this (and it would indeed be
noncompliant against the JSP 1.2 standard -- you are certainly allowed to
continue using the non-XML syntax).  I suspect the problem is with the
intermediate, automatically generated XML view of your JSP page, which is
fed through a SAX processor in order to be validated.  It's hard to say
what's causing the problem, though, without seeing a full page and the
full stack trace.  Also, are you sure you're using the released version of
4.0.4?

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

On Tue, 6 Aug 2002, Ben Ramsey wrote:

> Well, I was finally able to get Tomcat 4.0.4 installed on my Cobalt RaQ4,
> thanks to some help from the Cobalt Developers' Mailing List (check the July
> and August 2002 archives if you want to see the conversation:
> http://list.cobalt.com/pipermail/cobalt-developers/ ... look for messages
> titled "Installing Tomcat 4x on a Linux machine")!
> 
> Now, I can successfully run JSPs on my server that contain Java code
> fragments, but when I try to use any JSP tags, I get the following error:
> 
> 
> Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
> ----------------------------------------------------------------------------
> ----
> type Exception report
> 
> message Internal Server Error
> 
> description The server encountered an internal error (Internal Server Error)
> that prevented it from fulfilling this request.
> 
> exception
> 
> javax.servlet.ServletException: Error on line 1 of document  : The root
> element is required in a well-formed document. Nested exception: The root
> element is required in a well-formed document.
> 
> 
> Now, I know what this means: it's trying to force me to create JSP pages
> containing tags as well-formed XML pages; it wants me to use the <jsp:root>
> tag, I think.  This is all fine and dandy, but the earlier version of Tomcat
> I was using (3.2.3) didn't make this requirement of my code, and now I have
> to completely recode all my pages.
> 
> Is this a requirement of the JSP container, and/or is there a setting that I
> can modify to make Tomcat more lenient on this... or do I have something
> configured wrong somewhere?
> 
> Thanks.
> 
> Ben Ramsey
> Technical Director
> EUREKA! Interactive, Inc.
> 770-642-0390
> www.eureka-interactive.com
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Root Element Error

Posted by Ben Ramsey <be...@eureka-interactive.com>.
Well, I was finally able to get Tomcat 4.0.4 installed on my Cobalt RaQ4,
thanks to some help from the Cobalt Developers' Mailing List (check the July
and August 2002 archives if you want to see the conversation:
http://list.cobalt.com/pipermail/cobalt-developers/ ... look for messages
titled "Installing Tomcat 4x on a Linux machine")!

Now, I can successfully run JSPs on my server that contain Java code
fragments, but when I try to use any JSP tags, I get the following error:


Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
----------------------------------------------------------------------------
----
type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server Error)
that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error on line 1 of document  : The root
element is required in a well-formed document. Nested exception: The root
element is required in a well-formed document.


Now, I know what this means: it's trying to force me to create JSP pages
containing tags as well-formed XML pages; it wants me to use the <jsp:root>
tag, I think.  This is all fine and dandy, but the earlier version of Tomcat
I was using (3.2.3) didn't make this requirement of my code, and now I have
to completely recode all my pages.

Is this a requirement of the JSP container, and/or is there a setting that I
can modify to make Tomcat more lenient on this... or do I have something
configured wrong somewhere?

Thanks.

Ben Ramsey
Technical Director
EUREKA! Interactive, Inc.
770-642-0390
www.eureka-interactive.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>