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 Jack Lauman <jl...@nwcascades.com> on 2004/11/06 18:21:55 UTC
taglib question
I have a custom taglib with a hard coded URL. I've added a
'context-param' entry to move it the web.xml file. Is
'getServletConfig().getInitParameter' the corect thing to use here or is
there a better alternative?
Original line:
// out.println("<A
HREF='http://www.domainname.com/util/viewDate.jsp?id=" + id + "&date=" +
year + fmtMonth + fmtDate + "'>" + i + "</A>");
Modified line:
out.println("<A HREF=" +
getServletConfig().getInitParameter("baseJbossUrl") +
"/viewDate.jsp?id=" + id + "&date=" + year + fmtMonth + fmtDate + "'>" +
i + "</A>");
Thanks,
Jack
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: taglib question
Posted by Steve Lewis <sm...@lordjoe.com>.
It might be a good thing to put in the session allowing you to say
${JBossBaseURL} or write a short custom function and say
${myfunc:{JBossBaseURL} ()}
Both allow the page to access the data without hard coding in the page
where the data comes from
At 09:21 AM 11/6/2004, you wrote:
>I have a custom taglib with a hard coded URL. I've added a
>'context-param' entry to move it the web.xml file. Is
>'getServletConfig().getInitParameter' the corect thing to use here or is
>there a better alternative?
>
>Original line:
>// out.println("<A HREF='http://www.domainname.com/util/viewDate.jsp?id="
>+ id + "&date=" + year + fmtMonth + fmtDate + "'>" + i + "</A>");
>
>Modified line:
>out.println("<A HREF=" +
>getServletConfig().getInitParameter("baseJbossUrl") + "/viewDate.jsp?id="
>+ id + "&date=" + year + fmtMonth + fmtDate + "'>" + i + "</A>");
>
>Thanks,
>
>Jack
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: taglib question
Posted by "::SammyRulez::" <sa...@gmail.com>.
if 'util' is the neame of the context calling
'request.getContextPath()' will return
'http://www.domainname.com/util'
SammyRulez
On Mon, 08 Nov 2004 09:23:44 -0800, Jack Lauman <jl...@nwcascades.com> wrote:
> The app is likely to be deployed up to 100 times under different domain
> names. The context 'util' in the example is what determines which app
> the users sees.
>
> All of the static content of the site(s) is served by apache 2.0.52.
> All of the dynamic content is provided by JBoss 3.2.6/Tomcat 5.0.28.
>
> Do you think 'request.getContextPath()' would work in a situation like this?
>
> Thanks,
>
> Jack
>
>
>
> ::SammyRulez:: wrote:
>
> >request.getContextPath().. so you don't need any param to update when
> >you deploy/move an application
> >
> >SammyRulez
> >
> >
> >On Sat, 06 Nov 2004 09:21:55 -0800, Jack Lauman <jl...@nwcascades.com> wrote:
> >
> >
> >>I have a custom taglib with a hard coded URL. I've added a
> >>'context-param' entry to move it the web.xml file. Is
> >>'getServletConfig().getInitParameter' the corect thing to use here or is
> >>there a better alternative?
> >>
> >>Original line:
> >>// out.println("<A
> >>HREF='http://www.domainname.com/util/viewDate.jsp?id=" + id + "&date=" +
> >>year + fmtMonth + fmtDate + "'>" + i + "</A>");
> >>
> >>Modified line:
> >>out.println("<A HREF=" +
> >>getServletConfig().getInitParameter("baseJbossUrl") +
> >>"/viewDate.jsp?id=" + id + "&date=" + year + fmtMonth + fmtDate + "'>" +
> >>i + "</A>");
> >>
> >>Thanks,
> >>
> >>Jack
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> >>
> >>
> >>
> >>
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
>
>
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
--
::SammyRulez::
http://sammyrulez.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: taglib question
Posted by Jack Lauman <jl...@nwcascades.com>.
The app is likely to be deployed up to 100 times under different domain
names. The context 'util' in the example is what determines which app
the users sees.
All of the static content of the site(s) is served by apache 2.0.52.
All of the dynamic content is provided by JBoss 3.2.6/Tomcat 5.0.28.
Do you think 'request.getContextPath()' would work in a situation like this?
Thanks,
Jack
::SammyRulez:: wrote:
>request.getContextPath().. so you don't need any param to update when
>you deploy/move an application
>
>SammyRulez
>
>
>On Sat, 06 Nov 2004 09:21:55 -0800, Jack Lauman <jl...@nwcascades.com> wrote:
>
>
>>I have a custom taglib with a hard coded URL. I've added a
>>'context-param' entry to move it the web.xml file. Is
>>'getServletConfig().getInitParameter' the corect thing to use here or is
>>there a better alternative?
>>
>>Original line:
>>// out.println("<A
>>HREF='http://www.domainname.com/util/viewDate.jsp?id=" + id + "&date=" +
>>year + fmtMonth + fmtDate + "'>" + i + "</A>");
>>
>>Modified line:
>>out.println("<A HREF=" +
>>getServletConfig().getInitParameter("baseJbossUrl") +
>>"/viewDate.jsp?id=" + id + "&date=" + year + fmtMonth + fmtDate + "'>" +
>>i + "</A>");
>>
>>Thanks,
>>
>>Jack
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>>
>>
>>
>>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: taglib question
Posted by "::SammyRulez::" <sa...@gmail.com>.
request.getContextPath().. so you don't need any param to update when
you deploy/move an application
SammyRulez
On Sat, 06 Nov 2004 09:21:55 -0800, Jack Lauman <jl...@nwcascades.com> wrote:
> I have a custom taglib with a hard coded URL. I've added a
> 'context-param' entry to move it the web.xml file. Is
> 'getServletConfig().getInitParameter' the corect thing to use here or is
> there a better alternative?
>
> Original line:
> // out.println("<A
> HREF='http://www.domainname.com/util/viewDate.jsp?id=" + id + "&date=" +
> year + fmtMonth + fmtDate + "'>" + i + "</A>");
>
> Modified line:
> out.println("<A HREF=" +
> getServletConfig().getInitParameter("baseJbossUrl") +
> "/viewDate.jsp?id=" + id + "&date=" + year + fmtMonth + fmtDate + "'>" +
> i + "</A>");
>
> Thanks,
>
> Jack
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
--
::SammyRulez::
http://sammyrulez.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org