You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Koon Yue Lam <ki...@gmail.com> on 2005/10/20 04:02:12 UTC

Strange Struts tld problem

Hi,

Assume I have 2 jsp(s), header.jsp and content.jsp

In header.jsp, I have:
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/element.tld" prefix="element" %>

In content.jsp, I include header.jsp like the following:
<%@ include file="../common/Header.jsp" %>

The problem is, when I surf to content.jsp, all HTML tags can't be rendered,
they just don't show up. Every HTML tag which using Struts-HTML havn't show
up ....

but if I put those <%@ taglib uri=XXX statement in content.jsp, everything
work fine.

In web.xml, I already declare all tag lib and the URI are all correct

I also try using JSP include and toogle between absolute and relative path,
no luck at all

Any help would be appreciated

thanks

Re: Strange Struts tld problem

Posted by Koon Yue Lam <ki...@gmail.com>.
sorry, the include in my first mail was wrong, it should be:
<%@ include file="../common/header.jsp" %>

and it still can't locate those tld

On 10/20/05, Wendy Smoak <ja...@wendysmoak.com> wrote:
>
> From: "Koon Yue Lam" <ki...@gmail.com>
>
> > Assume I have 2 jsp(s), header.jsp and content.jsp
> >
> > In content.jsp, I include header.jsp like the following:
> > <%@ include file="../common/Header.jsp" %>
>
> The include isn't working. Possibly because your file is named 'header.jsp
> '
> and you're including 'Header.jsp', (watch the case!) or possibly because
> it
> isn't where you think it is relative to content.jsp.
>
> In addition, unless you're on Servlet 2.2, you don't need to put the tlds
> under WEB-INF and map them in web.xml. Just use the URIs such as
> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
> and the tld file that's in struts.jar will be used.
>
> --
> Wendy Smoak
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: TLD file placement

Posted by pa...@firstenergycorp.com.
Fantastic.

Thank you so much!


David



                                                                           
             "Wendy Smoak"                                                 
             <java@wendysmoak.                                             
             com>                                                       To 
                                       "Struts Users Mailing List"         
             10/20/2005 09:45          <us...@struts.apache.org>            
             AM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: TLD file placement              
               "Struts Users                                               
               Mailing List"                                               
             <user@struts.apac                                             
                  he.org>                                                  
                                                                           
                                                                           




From: <pa...@firstenergycorp.com>

> Sorry if I'm asking a basic question but I didn't know that you can just
> use the tld files in the jar. You said "unless you're on Servlet 2.2..."
> Does that mean that after Servlet 2.2 you can just use the tld files in
> the
> jar file?

Yes.  http://wiki.wsmoak.net/cgi-bin/wiki.pl?WebXmlNoTaglib

> If so, do I need to do anything special to tell Struts to look there or
is
> it enough to just take out the tld mappings from the web.xml file?

Nothing special.  Use the correct URI, remove the tld files from under
WEB-INF, remove <taglib> from web.xml, and it Just Works.  One less thing
to
maintain. :)

--
Wendy



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


-----------------------------------------
The information contained in this message is intended only for the
personal and confidential use of the recipient(s) named above. If the
reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately, and delete the original message.




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: TLD file placement

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: <pa...@firstenergycorp.com>

> Sorry if I'm asking a basic question but I didn't know that you can just
> use the tld files in the jar. You said "unless you're on Servlet 2.2..."
> Does that mean that after Servlet 2.2 you can just use the tld files in 
> the
> jar file?

Yes.  http://wiki.wsmoak.net/cgi-bin/wiki.pl?WebXmlNoTaglib

> If so, do I need to do anything special to tell Struts to look there or is
> it enough to just take out the tld mappings from the web.xml file?

Nothing special.  Use the correct URI, remove the tld files from under 
WEB-INF, remove <taglib> from web.xml, and it Just Works.  One less thing to 
maintain. :)

-- 
Wendy 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


TLD file placement

Posted by pa...@firstenergycorp.com.
Wendy,

I'm curious about your comment about Servlet 2.2 and placement of tld
files.

Sorry if I'm asking a basic question but I didn't know that you can just
use the tld files in the jar. You said "unless you're on Servlet 2.2..."
Does that mean that after Servlet 2.2 you can just use the tld files in the
jar file?

If so, do I need to do anything special to tell Struts to look there or is
it enough to just take out the tld mappings from the web.xml file?

Thanks!

David



                                                                           
             "Wendy Smoak"                                                 
             <java@wendysmoak.                                             
             com>                                                       To 
                                       "Struts Users Mailing List"         
             10/19/2005 10:35          <us...@struts.apache.org>            
             PM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: Strange Struts tld problem      
               "Struts Users                                               
               Mailing List"                                               
             <user@struts.apac                                             
                  he.org>                                                  
                                                                           
                                                                           




From: "Koon Yue Lam" <ki...@gmail.com>

> Assume I have 2 jsp(s), header.jsp and content.jsp
>
> In content.jsp, I include header.jsp like the following:
> <%@ include file="../common/Header.jsp" %>

The include isn't working.  Possibly because your file is named
'header.jsp'
and you're including 'Header.jsp', (watch the case!) or possibly because it

isn't where you think it is relative to content.jsp.

In addition, unless you're on Servlet 2.2, you don't need to put the tlds
under WEB-INF and map them in web.xml.  Just use the URIs such as
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
and the tld file that's in struts.jar will be used.

--
Wendy Smoak





-----------------------------------------
The information contained in this message is intended only for the
personal and confidential use of the recipient(s) named above. If the
reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately, and delete the original message.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Strange Struts tld problem

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Koon Yue Lam" <ki...@gmail.com>

> Assume I have 2 jsp(s), header.jsp and content.jsp
>
> In content.jsp, I include header.jsp like the following:
> <%@ include file="../common/Header.jsp" %>

The include isn't working.  Possibly because your file is named 'header.jsp' 
and you're including 'Header.jsp', (watch the case!) or possibly because it 
isn't where you think it is relative to content.jsp.

In addition, unless you're on Servlet 2.2, you don't need to put the tlds 
under WEB-INF and map them in web.xml.  Just use the URIs such as
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
and the tld file that's in struts.jar will be used.

-- 
Wendy Smoak 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org