You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by Naresh Bhatia <NB...@sapient.com> on 2006/10/07 13:36:02 UTC

Use of tag

Since the <tr:document> tag encapsulates the generation of <html>,
<body>, and <head> elements, how do I force generation of some elements
in to <head>. For example, I would like my <script> tags to go to the
<head>. (May be not a good example because it appears that <script> tags
are forced into <head> anyway. However, I don't see that documented in
the tag library docs.)

 

Naresh


Re: Use of tag

Posted by Matthias Wessendorf <ma...@apache.org>.
Naresh,

I was able to include dojo.js into a page


   <script src="#{facesContext.externalContext.requestContextPath}/dojo.js"/>

(w/ facelets, but JSP 2.1 will work too)

However, I was not able to run this:

<script>
	dojo.event.connect(dojo, "loaded", "init");
</script>


So I called init(); on t:doc onload attr.

-Matthias

On 10/8/06, Naresh Bhatia <NB...@sapient.com> wrote:
> You are right, parantheses should go away. But that does not fix the
> issue. The same error still shows up:
>
> javax.servlet.ServletException: Exception in JSP:
> /pages/measure-home2.jsp:21
>
> 18:                 </script>
> 19:             </f:verbatim>
> 20:
> 21:             <h:outputText value="<script type=\"text/javascript\"
> src=\"#{facesContext.externalContext.requestContextPath}/js/dojo/dojo.js
> }\"></script>" escape="false"/>
> 22:
> 23:             <f:verbatim>
> 24:                 <script type="text/javascript">
>
> Naresh
>
> -----Original Message-----
> From: Clemens Schneider [mailto:clemens.schneider@gmail.com]
> Sent: Saturday, October 07, 2006 3:57 PM
> To: adffaces-user@incubator.apache.org
> Subject: Re: Use of <tr:document> tag
>
> mhh, isn't is supposed to be
>
> #{facesContext.externalContext.requestContextPath}
>
>  instead of
>
> #{facesContext.externalContext.requestContextPath()}
>
> ?
>
> -clem
>
>
> Naresh Bhatia wrote:
> > That doesn't work. I am getting this error:
> >
> > javax.servlet.ServletException: /pages/measure-home2.jsp(21,71)
> > Unterminated &lt;h:outputText tag
> >
> > I thought there was an escape missing from src="#{facesContext...\". I
> > changed it to src=\"#{facesContext...\", but now I am getting this
> > error:
> >
> > javax.servlet.ServletException: Exception in JSP:
> > /pages/measure-home2.jsp:21
> >
> > 18:                 </script>
> > 19:             </f:verbatim>
> > 20:
> > 21:             <h:outputText value="<script type=\"text/javascript\"
> >
> src=\"#{facesContext.externalContext.requestContextPath()}/js/dojo/dojo.
> > js}\"></script>" escape="false"/>
> > 22:
> > 23:             <f:verbatim>
> > 24:                 <script type="text/javascript">
> >
> > Naresh
> >
> > -----Original Message-----
> > From: Simon Lessard [mailto:simon.lessard.3@gmail.com]
> > Sent: Saturday, October 07, 2006 1:53 PM
> > To: adffaces-user@incubator.apache.org
> > Subject: Re: Use of <tr:document> tag
> >
> > Try the following:
> >
> > <tr:document>
> >  <f:facet name="metaContainer">
> >    <h:outputText value="<script type=\"text/javascript\" src="#{
> >
> facesContext.externalContext.requestContextPath()}/js/dojo/dojo.js}\"></
> > script>"
> > escape="false"/>
> >   </f:facet>
> > </tr:document>
> >
> >
> > Regards,
> >
> > ~ Simon
> >
> > On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> >
> >> I am running into a minor problem trying to use Adam's example. In
> the
> >> script tag, I need to add the context path in front of the script
> >>
> > path.
> >
> >> Unfortunately the EL expression shown below is not being evaluated:
> >>
> >> <tr:document>
> >>   <f:facet name="metaContainer">
> >>     <f:verbatim>
> >>       <script
> >>         type="text/javascript"
> >>
> >>
> >
> src="#{facesContext.externalContext.requestContextPath()}/js/dojo/dojo.j
> >
> >> s">
> >>         </script>
> >>     </f:verbatim>
> >>   </f:facet>
> >> </tr:document>
> >>
> >> How do I fix this problem?
> >>
> >> Thanks.
> >> Naresh
> >>
> >> -----Original Message-----
> >> From: Adam Winer [mailto:awiner@gmail.com]
> >> Sent: Saturday, October 07, 2006 10:31 AM
> >> To: adffaces-user@incubator.apache.org
> >> Subject: Re: Use of <tr:document> tag
> >>
> >> Use the "metaContainer" facet:
> >>
> >> <tr:document>
> >>   <f:facet name="metaContainer">
> >>     <f:verbatim><script ...../></f:verbatim>
> >>   </f:facet>
> >> </tr:document>
> >>
> >>
> >> On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> >>
> >>> Since the <tr:document> tag encapsulates the generation of <html>,
> >>> <body>, and <head> elements, how do I force generation of some
> >>>
> >> elements
> >>
> >>> in to <head>. For example, I would like my <script> tags to go to
> >>>
> > the
> >
> >>> <head>. (May be not a good example because it appears that <script>
> >>>
> >> tags
> >>
> >>> are forced into <head> anyway. However, I don't see that documented
> >>>
> > in
> >
> >>> the tag library docs.)
> >>>
> >>>
> >>>
> >>> Naresh
> >>>
> >>>
> >>>
> >>>
> >
> >
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

RE: Use of tag

Posted by Naresh Bhatia <NB...@sapient.com>.
You are right, parantheses should go away. But that does not fix the
issue. The same error still shows up:

javax.servlet.ServletException: Exception in JSP:
/pages/measure-home2.jsp:21

18:                 </script>
19:             </f:verbatim>
20: 
21:             <h:outputText value="<script type=\"text/javascript\"
src=\"#{facesContext.externalContext.requestContextPath}/js/dojo/dojo.js
}\"></script>" escape="false"/>
22: 
23:             <f:verbatim>
24:                 <script type="text/javascript">

Naresh

-----Original Message-----
From: Clemens Schneider [mailto:clemens.schneider@gmail.com] 
Sent: Saturday, October 07, 2006 3:57 PM
To: adffaces-user@incubator.apache.org
Subject: Re: Use of <tr:document> tag

mhh, isn't is supposed to be

#{facesContext.externalContext.requestContextPath}

 instead of

#{facesContext.externalContext.requestContextPath()}

?

-clem 


Naresh Bhatia wrote:
> That doesn't work. I am getting this error:
>
> javax.servlet.ServletException: /pages/measure-home2.jsp(21,71)
> Unterminated &lt;h:outputText tag
>
> I thought there was an escape missing from src="#{facesContext...\". I
> changed it to src=\"#{facesContext...\", but now I am getting this
> error:
>
> javax.servlet.ServletException: Exception in JSP:
> /pages/measure-home2.jsp:21
>
> 18:                 </script>
> 19:             </f:verbatim>
> 20: 
> 21:             <h:outputText value="<script type=\"text/javascript\"
>
src=\"#{facesContext.externalContext.requestContextPath()}/js/dojo/dojo.
> js}\"></script>" escape="false"/>
> 22: 
> 23:             <f:verbatim>
> 24:                 <script type="text/javascript">
>
> Naresh
>
> -----Original Message-----
> From: Simon Lessard [mailto:simon.lessard.3@gmail.com] 
> Sent: Saturday, October 07, 2006 1:53 PM
> To: adffaces-user@incubator.apache.org
> Subject: Re: Use of <tr:document> tag
>
> Try the following:
>
> <tr:document>
>  <f:facet name="metaContainer">
>    <h:outputText value="<script type=\"text/javascript\" src="#{
>
facesContext.externalContext.requestContextPath()}/js/dojo/dojo.js}\"></
> script>"
> escape="false"/>
>   </f:facet>
> </tr:document>
>
>
> Regards,
>
> ~ Simon
>
> On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>   
>> I am running into a minor problem trying to use Adam's example. In
the
>> script tag, I need to add the context path in front of the script
>>     
> path.
>   
>> Unfortunately the EL expression shown below is not being evaluated:
>>
>> <tr:document>
>>   <f:facet name="metaContainer">
>>     <f:verbatim>
>>       <script
>>         type="text/javascript"
>>
>>     
>
src="#{facesContext.externalContext.requestContextPath()}/js/dojo/dojo.j
>   
>> s">
>>         </script>
>>     </f:verbatim>
>>   </f:facet>
>> </tr:document>
>>
>> How do I fix this problem?
>>
>> Thanks.
>> Naresh
>>
>> -----Original Message-----
>> From: Adam Winer [mailto:awiner@gmail.com]
>> Sent: Saturday, October 07, 2006 10:31 AM
>> To: adffaces-user@incubator.apache.org
>> Subject: Re: Use of <tr:document> tag
>>
>> Use the "metaContainer" facet:
>>
>> <tr:document>
>>   <f:facet name="metaContainer">
>>     <f:verbatim><script ...../></f:verbatim>
>>   </f:facet>
>> </tr:document>
>>
>>
>> On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>>     
>>> Since the <tr:document> tag encapsulates the generation of <html>,
>>> <body>, and <head> elements, how do I force generation of some
>>>       
>> elements
>>     
>>> in to <head>. For example, I would like my <script> tags to go to
>>>       
> the
>   
>>> <head>. (May be not a good example because it appears that <script>
>>>       
>> tags
>>     
>>> are forced into <head> anyway. However, I don't see that documented
>>>       
> in
>   
>>> the tag library docs.)
>>>
>>>
>>>
>>> Naresh
>>>
>>>
>>>
>>>       
>
>   

Re: Use of tag

Posted by Clemens Schneider <cl...@gmail.com>.
mhh, isn't is supposed to be

#{facesContext.externalContext.requestContextPath}

 instead of

#{facesContext.externalContext.requestContextPath()}

?

-clem 


Naresh Bhatia wrote:
> That doesn't work. I am getting this error:
>
> javax.servlet.ServletException: /pages/measure-home2.jsp(21,71)
> Unterminated &lt;h:outputText tag
>
> I thought there was an escape missing from src="#{facesContext...\". I
> changed it to src=\"#{facesContext...\", but now I am getting this
> error:
>
> javax.servlet.ServletException: Exception in JSP:
> /pages/measure-home2.jsp:21
>
> 18:                 </script>
> 19:             </f:verbatim>
> 20: 
> 21:             <h:outputText value="<script type=\"text/javascript\"
> src=\"#{facesContext.externalContext.requestContextPath()}/js/dojo/dojo.
> js}\"></script>" escape="false"/>
> 22: 
> 23:             <f:verbatim>
> 24:                 <script type="text/javascript">
>
> Naresh
>
> -----Original Message-----
> From: Simon Lessard [mailto:simon.lessard.3@gmail.com] 
> Sent: Saturday, October 07, 2006 1:53 PM
> To: adffaces-user@incubator.apache.org
> Subject: Re: Use of <tr:document> tag
>
> Try the following:
>
> <tr:document>
>  <f:facet name="metaContainer">
>    <h:outputText value="<script type=\"text/javascript\" src="#{
> facesContext.externalContext.requestContextPath()}/js/dojo/dojo.js}\"></
> script>"
> escape="false"/>
>   </f:facet>
> </tr:document>
>
>
> Regards,
>
> ~ Simon
>
> On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>   
>> I am running into a minor problem trying to use Adam's example. In the
>> script tag, I need to add the context path in front of the script
>>     
> path.
>   
>> Unfortunately the EL expression shown below is not being evaluated:
>>
>> <tr:document>
>>   <f:facet name="metaContainer">
>>     <f:verbatim>
>>       <script
>>         type="text/javascript"
>>
>>     
> src="#{facesContext.externalContext.requestContextPath()}/js/dojo/dojo.j
>   
>> s">
>>         </script>
>>     </f:verbatim>
>>   </f:facet>
>> </tr:document>
>>
>> How do I fix this problem?
>>
>> Thanks.
>> Naresh
>>
>> -----Original Message-----
>> From: Adam Winer [mailto:awiner@gmail.com]
>> Sent: Saturday, October 07, 2006 10:31 AM
>> To: adffaces-user@incubator.apache.org
>> Subject: Re: Use of <tr:document> tag
>>
>> Use the "metaContainer" facet:
>>
>> <tr:document>
>>   <f:facet name="metaContainer">
>>     <f:verbatim><script ...../></f:verbatim>
>>   </f:facet>
>> </tr:document>
>>
>>
>> On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>>     
>>> Since the <tr:document> tag encapsulates the generation of <html>,
>>> <body>, and <head> elements, how do I force generation of some
>>>       
>> elements
>>     
>>> in to <head>. For example, I would like my <script> tags to go to
>>>       
> the
>   
>>> <head>. (May be not a good example because it appears that <script>
>>>       
>> tags
>>     
>>> are forced into <head> anyway. However, I don't see that documented
>>>       
> in
>   
>>> the tag library docs.)
>>>
>>>
>>>
>>> Naresh
>>>
>>>
>>>
>>>       
>
>   

RE: Use of tag

Posted by Naresh Bhatia <NB...@sapient.com>.
That doesn't work. I am getting this error:

javax.servlet.ServletException: /pages/measure-home2.jsp(21,71)
Unterminated &lt;h:outputText tag

I thought there was an escape missing from src="#{facesContext...\". I
changed it to src=\"#{facesContext...\", but now I am getting this
error:

javax.servlet.ServletException: Exception in JSP:
/pages/measure-home2.jsp:21

18:                 </script>
19:             </f:verbatim>
20: 
21:             <h:outputText value="<script type=\"text/javascript\"
src=\"#{facesContext.externalContext.requestContextPath()}/js/dojo/dojo.
js}\"></script>" escape="false"/>
22: 
23:             <f:verbatim>
24:                 <script type="text/javascript">

Naresh

-----Original Message-----
From: Simon Lessard [mailto:simon.lessard.3@gmail.com] 
Sent: Saturday, October 07, 2006 1:53 PM
To: adffaces-user@incubator.apache.org
Subject: Re: Use of <tr:document> tag

Try the following:

<tr:document>
 <f:facet name="metaContainer">
   <h:outputText value="<script type=\"text/javascript\" src="#{
facesContext.externalContext.requestContextPath()}/js/dojo/dojo.js}\"></
script>"
escape="false"/>
  </f:facet>
</tr:document>


Regards,

~ Simon

On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>
> I am running into a minor problem trying to use Adam's example. In the
> script tag, I need to add the context path in front of the script
path.
> Unfortunately the EL expression shown below is not being evaluated:
>
> <tr:document>
>   <f:facet name="metaContainer">
>     <f:verbatim>
>       <script
>         type="text/javascript"
>
src="#{facesContext.externalContext.requestContextPath()}/js/dojo/dojo.j
> s">
>         </script>
>     </f:verbatim>
>   </f:facet>
> </tr:document>
>
> How do I fix this problem?
>
> Thanks.
> Naresh
>
> -----Original Message-----
> From: Adam Winer [mailto:awiner@gmail.com]
> Sent: Saturday, October 07, 2006 10:31 AM
> To: adffaces-user@incubator.apache.org
> Subject: Re: Use of <tr:document> tag
>
> Use the "metaContainer" facet:
>
> <tr:document>
>   <f:facet name="metaContainer">
>     <f:verbatim><script ...../></f:verbatim>
>   </f:facet>
> </tr:document>
>
>
> On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> >
> > Since the <tr:document> tag encapsulates the generation of <html>,
> > <body>, and <head> elements, how do I force generation of some
> elements
> > in to <head>. For example, I would like my <script> tags to go to
the
> > <head>. (May be not a good example because it appears that <script>
> tags
> > are forced into <head> anyway. However, I don't see that documented
in
> > the tag library docs.)
> >
> >
> >
> > Naresh
> >
> >
> >
>

Re: Use of tag

Posted by Simon Lessard <si...@gmail.com>.
Try the following:

<tr:document>
 <f:facet name="metaContainer">
   <h:outputText value="<script type=\"text/javascript\" src="#{
facesContext.externalContext.requestContextPath()}/js/dojo/dojo.js}\"></script>"
escape="false"/>
  </f:facet>
</tr:document>


Regards,

~ Simon

On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>
> I am running into a minor problem trying to use Adam's example. In the
> script tag, I need to add the context path in front of the script path.
> Unfortunately the EL expression shown below is not being evaluated:
>
> <tr:document>
>   <f:facet name="metaContainer">
>     <f:verbatim>
>       <script
>         type="text/javascript"
> src="#{facesContext.externalContext.requestContextPath()}/js/dojo/dojo.j
> s">
>         </script>
>     </f:verbatim>
>   </f:facet>
> </tr:document>
>
> How do I fix this problem?
>
> Thanks.
> Naresh
>
> -----Original Message-----
> From: Adam Winer [mailto:awiner@gmail.com]
> Sent: Saturday, October 07, 2006 10:31 AM
> To: adffaces-user@incubator.apache.org
> Subject: Re: Use of <tr:document> tag
>
> Use the "metaContainer" facet:
>
> <tr:document>
>   <f:facet name="metaContainer">
>     <f:verbatim><script ...../></f:verbatim>
>   </f:facet>
> </tr:document>
>
>
> On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> >
> > Since the <tr:document> tag encapsulates the generation of <html>,
> > <body>, and <head> elements, how do I force generation of some
> elements
> > in to <head>. For example, I would like my <script> tags to go to the
> > <head>. (May be not a good example because it appears that <script>
> tags
> > are forced into <head> anyway. However, I don't see that documented in
> > the tag library docs.)
> >
> >
> >
> > Naresh
> >
> >
> >
>

Re: Use of tag

Posted by Matthias Wessendorf <ma...@apache.org>.
docment creates these elements <html>, <body>, and <head>,

the trh is the other way to do that.

I'd prefer document w/ the facet,

M

On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> Thanks Adam. I just found the <trh:html>, <trh:head> and <trh:body>
> tags. Any advantage of using these vs. the "metaContainer" facet?
>
> Naresh
>
> -----Original Message-----
> From: Adam Winer [mailto:awiner@gmail.com]
> Sent: Saturday, October 07, 2006 10:31 AM
> To: adffaces-user@incubator.apache.org
> Subject: Re: Use of <tr:document> tag
>
> Use the "metaContainer" facet:
>
> <tr:document>
>   <f:facet name="metaContainer">
>     <f:verbatim><script ...../></f:verbatim>
>   </f:facet>
> </tr:document>
>
>
> On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> >
> > Since the <tr:document> tag encapsulates the generation of <html>,
> > <body>, and <head> elements, how do I force generation of some
> elements
> > in to <head>. For example, I would like my <script> tags to go to the
> > <head>. (May be not a good example because it appears that <script>
> tags
> > are forced into <head> anyway. However, I don't see that documented in
> > the tag library docs.)
> >
> >
> >
> > Naresh
> >
> >
> >
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

RE: Use of tag

Posted by Naresh Bhatia <NB...@sapient.com>.
I am running into a minor problem trying to use Adam's example. In the
script tag, I need to add the context path in front of the script path.
Unfortunately the EL expression shown below is not being evaluated:

<tr:document>
  <f:facet name="metaContainer">
    <f:verbatim>
      <script
        type="text/javascript"
src="#{facesContext.externalContext.requestContextPath()}/js/dojo/dojo.j
s">
        </script>
    </f:verbatim>
  </f:facet>
</tr:document>

How do I fix this problem?

Thanks.
Naresh

-----Original Message-----
From: Adam Winer [mailto:awiner@gmail.com] 
Sent: Saturday, October 07, 2006 10:31 AM
To: adffaces-user@incubator.apache.org
Subject: Re: Use of <tr:document> tag

Use the "metaContainer" facet:

<tr:document>
  <f:facet name="metaContainer">
    <f:verbatim><script ...../></f:verbatim>
  </f:facet>
</tr:document>


On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>
> Since the <tr:document> tag encapsulates the generation of <html>,
> <body>, and <head> elements, how do I force generation of some
elements
> in to <head>. For example, I would like my <script> tags to go to the
> <head>. (May be not a good example because it appears that <script>
tags
> are forced into <head> anyway. However, I don't see that documented in
> the tag library docs.)
>
>
>
> Naresh
>
>
>

RE: Use of tag

Posted by Naresh Bhatia <NB...@sapient.com>.
Thanks Adam. I just found the <trh:html>, <trh:head> and <trh:body>
tags. Any advantage of using these vs. the "metaContainer" facet?

Naresh

-----Original Message-----
From: Adam Winer [mailto:awiner@gmail.com] 
Sent: Saturday, October 07, 2006 10:31 AM
To: adffaces-user@incubator.apache.org
Subject: Re: Use of <tr:document> tag

Use the "metaContainer" facet:

<tr:document>
  <f:facet name="metaContainer">
    <f:verbatim><script ...../></f:verbatim>
  </f:facet>
</tr:document>


On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>
> Since the <tr:document> tag encapsulates the generation of <html>,
> <body>, and <head> elements, how do I force generation of some
elements
> in to <head>. For example, I would like my <script> tags to go to the
> <head>. (May be not a good example because it appears that <script>
tags
> are forced into <head> anyway. However, I don't see that documented in
> the tag library docs.)
>
>
>
> Naresh
>
>
>

Re: Use of tag

Posted by Adam Winer <aw...@gmail.com>.
Use the "metaContainer" facet:

<tr:document>
  <f:facet name="metaContainer">
    <f:verbatim><script ...../></f:verbatim>
  </f:facet>
</tr:document>


On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>
> Since the <tr:document> tag encapsulates the generation of <html>,
> <body>, and <head> elements, how do I force generation of some elements
> in to <head>. For example, I would like my <script> tags to go to the
> <head>. (May be not a good example because it appears that <script> tags
> are forced into <head> anyway. However, I don't see that documented in
> the tag library docs.)
>
>
>
> Naresh
>
>
>