You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Wegner <ma...@yahoo.com> on 2005/01/25 23:53:36 UTC
PlugIn and the base URL
In have a Struts PlugIn that needs to determine the URL for the containing
web application (http://localhost:8080/BlahBlahBlah/). I am unable to
find a way to determine this information. Any ideas?
Thanks.
--Marty
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by Hubert Rabago <hr...@gmail.com>.
I'm not entirely sure, but I think Struts itself has some code that
goes through some length to get information like this. Could be in
the Struts ActionServlet object. I don't have time to check right
now, though.
On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
<fz...@omnytex.com> wrote:
> I seem to remember trying to solve this problem myself and coming to the
> conclusion that there was no way to do it independent of a request. I
> wound up just sticking it in my application config file that gets read
> in the plugin anyway. Can anyone prove me wrong? :)
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
>
> Martin Wegner wrote:
> > In have a Struts PlugIn that needs to determine the URL for the containing
> > web application (http://localhost:8080/BlahBlahBlah/). I am unable to
> > find a way to determine this information. Any ideas?
> >
> > Thanks.
> >
> >
> > --Marty
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
> >
> > .
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by Craig McClanahan <cr...@gmail.com>.
On Tue, 25 Jan 2005 21:05:30 -0800 (PST), Martin Wegner
<ma...@yahoo.com> wrote:
> Jack,
>
> That tells me where the JAR files are stored which is cool. But what I am
> looking for a valid URL (of which there may be many) to access my given
> web application. This info has to come from the container which may be
> the problem. I don't see anything in the container standard which
> provides this info.
You can calculate what you need from an HttpServletRequest (scheme +
serverName + serverPort + contextPath), but there is no way to
determine this information in a PlugIn's init() method, which is in
turn called from a servlet's init() method.
>
> Any other ideas?
>
> --Marty
>
Craig
> --- Dakota Jack <da...@gmail.com> wrote:
>
> > Not sure what you want. Does this help?
> >
> > package whatever;
> >
> > import java.io.File;
> > import java.net.URL;
> >
> > public final class Classpath {
> > public static final String SLASH = File.separator;
> > public static final String HERE =
> > Classpath.class.getClassLoader().getResource("whatever" + SLASH +
> >
> > "Classpath.class").getFile();
> > }
> >
> >
> > On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner
> > <ma...@yahoo.com> wrote:
> > >
> > > As far as I can tell the attributes offer no insight. I have yet to
> > find
> > > a way to get to the container from within a PlugIn. But I will keep
> > > looking. Using an initParam is not an option in this application.
> > >
> > > --Marty
> > >
> > > --- "Frank W. Zammetti" <fz...@omnytex.com> wrote:
> > >
> > > > The OP was looking for a way to construct the entire path. I too
> > got as
> > > >
> > > > far as ServletContext, but I'm not sure what in it would give you
> > that,
> > > > or even all the pieces to constuct it... Maybe getAttribute()? I'm
> > not
> > > > sure what it will return, although you can use getAttributeNames()
> > to
> > > > see. The Javadocs indicates the attributes are container-specific
> > > > though, so I'm not sure he'd want to use that anyway.
> > > >
> > > > This is just a matter of curiosity for me at this point, I long ago
> > > > solved this problem another way. I'd like to know how to do it
> > though.
> > > >
> > > > --
> > > > Frank W. Zammetti
> > > > Founder and Chief Software Architect
> > > > Omnytex Technologies
> > > > http://www.omnytex.com
> > > >
> > > >
> > > > Jim Barrows wrote:
> > > > > On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
> > > > > <fz...@omnytex.com> wrote:
> > > > >
> > > > >>I seem to remember trying to solve this problem myself and coming
> > to
> > > > the
> > > > >>conclusion that there was no way to do it independent of a
> > request. I
> > > > >>wound up just sticking it in my application config file that gets
> > read
> > > > >>in the plugin anyway. Can anyone prove me wrong? :)
> > > > >
> > > > >
> > > > > Your looking for the application context correct?
> > > > > In the init you are passed the ActionServlet, which inherits from
> > > > > HttpServlet, which will give you the ServletContext. IIRC you can
> > get
> > > > > the context from there.
> > > > >
> > > > >
> > > > >>--
> > > > >>Frank W. Zammetti
> > > > >>Founder and Chief Software Architect
> > > > >>Omnytex Technologies
> > > > >>http://www.omnytex.com
> > > > >>
> > > > >>Martin Wegner wrote:
> > > > >>
> > > > >>>In have a Struts PlugIn that needs to determine the URL for the
> > > > containing
> > > > >>>web application (http://localhost:8080/BlahBlahBlah/). I am
> > unable
> > > > to
> > > > >>>find a way to determine this information. Any ideas?
> > > > >>>
> > > > >>>Thanks.
> > > > >>>
> > > > >>>
> > > > >>>--Marty
> > > > >>>
> > > > >>>
> > > >
> > >>>---------------------------------------------------------------------
> > > > >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > >>>For additional commands, e-mail: user-help@struts.apache.org
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>.
> > > > >>>
> > > > >>
> > > >
> > >>---------------------------------------------------------------------
> > > > >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > >>For additional commands, e-mail: user-help@struts.apache.org
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > > >
> > > >
> > > > --
> > > > Frank W. Zammetti
> > > > Founder and Chief Software Architect
> > > > Omnytex Technologies
> > > > http://www.omnytex.com
> > > >
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > ------------------------------
> >
> > "You can lead a horse to water but you cannot make it float on its
> > back."
> >
> > ~Dakota Jack~
> >
> > "You can't wake a person who is pretending to be asleep."
> >
> > ~Native Proverb~
> >
> > "Each man is good in His sight. It is not necessary for eagles to be
> > crows."
> >
> > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
> >
> > -----------------------------------------------
> >
> > "This message may contain confidential and/or privileged information.
> > If you are not the addressee or authorized to receive this for the
> > addressee, you must not use, copy, disclose, or take any action based
> > on this message or any information herein. If you have received this
> > message in error, please advise the sender immediately by reply e-mail
> > and delete this message. Thank you for your cooperation."
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by Martin Wegner <ma...@yahoo.com>.
I need to find the URL of my web app at start up. I need it as soon as
possible in the boot process. So Listerners and Plug Ins are the only two
ways I know of that allow me to hook into the startup of the app. Is
there another mechanism available?
--Marty
--- Larry Meadors <la...@gmail.com> wrote:
> <dave-thomas-voice>why does it have to be a plugin?</dave-thomas-voice>
>
>
> On Tue, 25 Jan 2005 22:18:20 -0800 (PST), Martin Wegner
> <ma...@yahoo.com> wrote:
> >
> > I am looking for the:
> >
> > http://blahblahblah.com:8080/AppName/
> >
> > As Craig said I can get that if I have a Request object. But from a
> > PlugIn I don't have that. I can think of some ugly hacks but nothing
> > clean.
> >
> >
> > --Marty
> >
> > --- Dakota Jack <da...@gmail.com> wrote:
> >
> > > Do you want the URL or the Internet Protocol address? I have some
> > > ideas on the latter.
> > >
> > > Jack
> > >
> > >
> > > On Tue, 25 Jan 2005 21:05:30 -0800 (PST), Martin Wegner
> > > <ma...@yahoo.com> wrote:
> > > > Jack,
> > > >
> > > > That tells me where the JAR files are stored which is cool. But
> what
> > > I am
> > > > looking for a valid URL (of which there may be many) to access my
> > > given
> > > > web application. This info has to come from the container which
> may
> > > be
> > > > the problem. I don't see anything in the container standard which
> > > > provides this info.
> > > >
> > > > Any other ideas?
> > > >
> > > > --Marty
> > > >
> > > > --- Dakota Jack <da...@gmail.com> wrote:
> > > >
> > > > > Not sure what you want. Does this help?
> > > > >
> > > > > package whatever;
> > > > >
> > > > > import java.io.File;
> > > > > import java.net.URL;
> > > > >
> > > > > public final class Classpath {
> > > > > public static final String SLASH = File.separator;
> > > > > public static final String HERE =
> > > > > Classpath.class.getClassLoader().getResource("whatever" + SLASH
> +
> > > > >
> > > > > "Classpath.class").getFile();
> > > > > }
> > > > >
> > > > >
> > > > > On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner
> > > > > <ma...@yahoo.com> wrote:
> > > > > >
> > > > > > As far as I can tell the attributes offer no insight. I have
> yet
> > > to
> > > > > find
> > > > > > a way to get to the container from within a PlugIn. But I
> will
> > > keep
> > > > > > looking. Using an initParam is not an option in this
> application.
> > > > > >
> > > > > > --Marty
> > > > > >
> > > > > > --- "Frank W. Zammetti" <fz...@omnytex.com> wrote:
> > > > > >
> > > > > > > The OP was looking for a way to construct the entire path.
> I
> > > too
> > > > > got as
> > > > > > >
> > > > > > > far as ServletContext, but I'm not sure what in it would
> give
> > > you
> > > > > that,
> > > > > > > or even all the pieces to constuct it... Maybe
> getAttribute()?
> > > I'm
> > > > > not
> > > > > > > sure what it will return, although you can use
> > > getAttributeNames()
> > > > > to
> > > > > > > see. The Javadocs indicates the attributes are
> > > container-specific
> > > > > > > though, so I'm not sure he'd want to use that anyway.
> > > > > > >
> > > > > > > This is just a matter of curiosity for me at this point, I
> long
> > > ago
> > > > > > > solved this problem another way. I'd like to know how to do
> it
> > > > > though.
> > > > > > >
> > > > > > > --
> > > > > > > Frank W. Zammetti
> > > > > > > Founder and Chief Software Architect
> > > > > > > Omnytex Technologies
> > > > > > > http://www.omnytex.com
> > > > > > >
> > > > > > >
> > > > > > > Jim Barrows wrote:
> > > > > > > > On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
> > > > > > > > <fz...@omnytex.com> wrote:
> > > > > > > >
> > > > > > > >>I seem to remember trying to solve this problem myself and
> > > coming
> > > > > to
> > > > > > > the
> > > > > > > >>conclusion that there was no way to do it independent of a
> > > > > request. I
> > > > > > > >>wound up just sticking it in my application config file
> that
> > > gets
> > > > > read
> > > > > > > >>in the plugin anyway. Can anyone prove me wrong? :)
> > > > > > > >
> > > > > > > >
> > > > > > > > Your looking for the application context correct?
> > > > > > > > In the init you are passed the ActionServlet, which
> inherits
> > > from
> > > > > > > > HttpServlet, which will give you the ServletContext. IIRC
> you
> > > can
> > > > > get
> > > > > > > > the context from there.
> > > > > > > >
> > > > > > > >
> > > > > > > >>--
> > > > > > > >>Frank W. Zammetti
> > > > > > > >>Founder and Chief Software Architect
> > > > > > > >>Omnytex Technologies
> > > > > > > >>http://www.omnytex.com
> > > > > > > >>
> > > > > > > >>Martin Wegner wrote:
> > > > > > > >>
> > > > > > > >>>In have a Struts PlugIn that needs to determine the URL
> for
> > > the
> > > > > > > containing
> > > > > > > >>>web application (http://localhost:8080/BlahBlahBlah/). I
> am
> > > > > unable
> > > > > > > to
> > > > > > > >>>find a way to determine this information. Any ideas?
> > > > > > > >>>
> > > > > > > >>>Thanks.
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>--Marty
> > > > > > > >>>
> > > > > > > >>>
> > > > > > >
> > > > >
> > >
> >>>---------------------------------------------------------------------
> > > > > > > >>>To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > > > > > > >>>For additional commands, e-mail:
> user-help@struts.apache.org
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>.
> > > > > > > >>>
> > > > > > > >>
> > > > > > >
> > > > >
> > >
> >>---------------------------------------------------------------------
> > > > > > > >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > > > >>For additional commands, e-mail:
> user-help@struts.apache.org
> > > > > > > >>
> > > > > > > >>
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Frank W. Zammetti
> > > > > > > Founder and Chief Software Architect
> > > > > > > Omnytex Technologies
> > > > > > > http://www.omnytex.com
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > ------------------------------
> > > > >
> > > > > "You can lead a horse to water but you cannot make it float on
> its
> > > > > back."
> > > > >
> > > > > ~Dakota Jack~
> > > > >
> > > > > "You can't wake a person who is pretending to be asleep."
> > > > >
> > > > > ~Native Proverb~
> > > > >
> > > > > "Each man is good in His sight. It is not necessary for eagles
> to be
> > > > > crows."
> > > > >
> > > > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
> > > > >
> > > > > -----------------------------------------------
> > > > >
> > > > > "This message may contain confidential and/or privileged
> > > information.
> > > > > If you are not the addressee or authorized to receive this for
> the
> > > > > addressee, you must not use, copy, disclose, or take any action
> > > based
> > > > > on this message or any information herein. If you have received
> this
> > > > > message in error, please advise the sender immediately by reply
> > > e-mail
> > > > > and delete this message. Thank you for your cooperation."
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > >
> > > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > ------------------------------
> > >
> > > "You can lead a horse to water but you cannot make it float on its
> > > back."
> > >
> > > ~Dakota Jack~
> > >
> > > "You can't wake a person who is pretending to be asleep."
> > >
> > > ~Native Proverb~
> > >
> > > "Each man is good in His sight. It is not necessary for eagles to be
> > > crows."
> > >
> > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
> > >
> > > -----------------------------------------------
> > >
> > > "This message may contain confidential and/or privileged
> information.
> > > If you are not the addressee or authorized to receive this for the
> > > addressee, you must not use, copy, disclose, or take any action
> based
> > > on this message or any information herein. If you have received this
> > > message in error, please advise the sender immediately by reply
> e-mail
> > > and delete this message. Thank you for your cooperation."
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by Larry Meadors <la...@gmail.com>.
<dave-thomas-voice>why does it have to be a plugin?</dave-thomas-voice>
On Tue, 25 Jan 2005 22:18:20 -0800 (PST), Martin Wegner
<ma...@yahoo.com> wrote:
>
> I am looking for the:
>
> http://blahblahblah.com:8080/AppName/
>
> As Craig said I can get that if I have a Request object. But from a
> PlugIn I don't have that. I can think of some ugly hacks but nothing
> clean.
>
>
> --Marty
>
> --- Dakota Jack <da...@gmail.com> wrote:
>
> > Do you want the URL or the Internet Protocol address? I have some
> > ideas on the latter.
> >
> > Jack
> >
> >
> > On Tue, 25 Jan 2005 21:05:30 -0800 (PST), Martin Wegner
> > <ma...@yahoo.com> wrote:
> > > Jack,
> > >
> > > That tells me where the JAR files are stored which is cool. But what
> > I am
> > > looking for a valid URL (of which there may be many) to access my
> > given
> > > web application. This info has to come from the container which may
> > be
> > > the problem. I don't see anything in the container standard which
> > > provides this info.
> > >
> > > Any other ideas?
> > >
> > > --Marty
> > >
> > > --- Dakota Jack <da...@gmail.com> wrote:
> > >
> > > > Not sure what you want. Does this help?
> > > >
> > > > package whatever;
> > > >
> > > > import java.io.File;
> > > > import java.net.URL;
> > > >
> > > > public final class Classpath {
> > > > public static final String SLASH = File.separator;
> > > > public static final String HERE =
> > > > Classpath.class.getClassLoader().getResource("whatever" + SLASH +
> > > >
> > > > "Classpath.class").getFile();
> > > > }
> > > >
> > > >
> > > > On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner
> > > > <ma...@yahoo.com> wrote:
> > > > >
> > > > > As far as I can tell the attributes offer no insight. I have yet
> > to
> > > > find
> > > > > a way to get to the container from within a PlugIn. But I will
> > keep
> > > > > looking. Using an initParam is not an option in this application.
> > > > >
> > > > > --Marty
> > > > >
> > > > > --- "Frank W. Zammetti" <fz...@omnytex.com> wrote:
> > > > >
> > > > > > The OP was looking for a way to construct the entire path. I
> > too
> > > > got as
> > > > > >
> > > > > > far as ServletContext, but I'm not sure what in it would give
> > you
> > > > that,
> > > > > > or even all the pieces to constuct it... Maybe getAttribute()?
> > I'm
> > > > not
> > > > > > sure what it will return, although you can use
> > getAttributeNames()
> > > > to
> > > > > > see. The Javadocs indicates the attributes are
> > container-specific
> > > > > > though, so I'm not sure he'd want to use that anyway.
> > > > > >
> > > > > > This is just a matter of curiosity for me at this point, I long
> > ago
> > > > > > solved this problem another way. I'd like to know how to do it
> > > > though.
> > > > > >
> > > > > > --
> > > > > > Frank W. Zammetti
> > > > > > Founder and Chief Software Architect
> > > > > > Omnytex Technologies
> > > > > > http://www.omnytex.com
> > > > > >
> > > > > >
> > > > > > Jim Barrows wrote:
> > > > > > > On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
> > > > > > > <fz...@omnytex.com> wrote:
> > > > > > >
> > > > > > >>I seem to remember trying to solve this problem myself and
> > coming
> > > > to
> > > > > > the
> > > > > > >>conclusion that there was no way to do it independent of a
> > > > request. I
> > > > > > >>wound up just sticking it in my application config file that
> > gets
> > > > read
> > > > > > >>in the plugin anyway. Can anyone prove me wrong? :)
> > > > > > >
> > > > > > >
> > > > > > > Your looking for the application context correct?
> > > > > > > In the init you are passed the ActionServlet, which inherits
> > from
> > > > > > > HttpServlet, which will give you the ServletContext. IIRC you
> > can
> > > > get
> > > > > > > the context from there.
> > > > > > >
> > > > > > >
> > > > > > >>--
> > > > > > >>Frank W. Zammetti
> > > > > > >>Founder and Chief Software Architect
> > > > > > >>Omnytex Technologies
> > > > > > >>http://www.omnytex.com
> > > > > > >>
> > > > > > >>Martin Wegner wrote:
> > > > > > >>
> > > > > > >>>In have a Struts PlugIn that needs to determine the URL for
> > the
> > > > > > containing
> > > > > > >>>web application (http://localhost:8080/BlahBlahBlah/). I am
> > > > unable
> > > > > > to
> > > > > > >>>find a way to determine this information. Any ideas?
> > > > > > >>>
> > > > > > >>>Thanks.
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>--Marty
> > > > > > >>>
> > > > > > >>>
> > > > > >
> > > >
> > >>>---------------------------------------------------------------------
> > > > > > >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > > >>>For additional commands, e-mail: user-help@struts.apache.org
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>.
> > > > > > >>>
> > > > > > >>
> > > > > >
> > > >
> > >>---------------------------------------------------------------------
> > > > > > >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > > >>For additional commands, e-mail: user-help@struts.apache.org
> > > > > > >>
> > > > > > >>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > > --
> > > > > > Frank W. Zammetti
> > > > > > Founder and Chief Software Architect
> > > > > > Omnytex Technologies
> > > > > > http://www.omnytex.com
> > > > > >
> > > > > >
> > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > ------------------------------
> > > >
> > > > "You can lead a horse to water but you cannot make it float on its
> > > > back."
> > > >
> > > > ~Dakota Jack~
> > > >
> > > > "You can't wake a person who is pretending to be asleep."
> > > >
> > > > ~Native Proverb~
> > > >
> > > > "Each man is good in His sight. It is not necessary for eagles to be
> > > > crows."
> > > >
> > > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
> > > >
> > > > -----------------------------------------------
> > > >
> > > > "This message may contain confidential and/or privileged
> > information.
> > > > If you are not the addressee or authorized to receive this for the
> > > > addressee, you must not use, copy, disclose, or take any action
> > based
> > > > on this message or any information herein. If you have received this
> > > > message in error, please advise the sender immediately by reply
> > e-mail
> > > > and delete this message. Thank you for your cooperation."
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > ------------------------------
> >
> > "You can lead a horse to water but you cannot make it float on its
> > back."
> >
> > ~Dakota Jack~
> >
> > "You can't wake a person who is pretending to be asleep."
> >
> > ~Native Proverb~
> >
> > "Each man is good in His sight. It is not necessary for eagles to be
> > crows."
> >
> > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
> >
> > -----------------------------------------------
> >
> > "This message may contain confidential and/or privileged information.
> > If you are not the addressee or authorized to receive this for the
> > addressee, you must not use, copy, disclose, or take any action based
> > on this message or any information herein. If you have received this
> > message in error, please advise the sender immediately by reply e-mail
> > and delete this message. Thank you for your cooperation."
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by Martin Wegner <ma...@yahoo.com>.
I am looking for the:
http://blahblahblah.com:8080/AppName/
As Craig said I can get that if I have a Request object. But from a
PlugIn I don't have that. I can think of some ugly hacks but nothing
clean.
--Marty
--- Dakota Jack <da...@gmail.com> wrote:
> Do you want the URL or the Internet Protocol address? I have some
> ideas on the latter.
>
> Jack
>
>
> On Tue, 25 Jan 2005 21:05:30 -0800 (PST), Martin Wegner
> <ma...@yahoo.com> wrote:
> > Jack,
> >
> > That tells me where the JAR files are stored which is cool. But what
> I am
> > looking for a valid URL (of which there may be many) to access my
> given
> > web application. This info has to come from the container which may
> be
> > the problem. I don't see anything in the container standard which
> > provides this info.
> >
> > Any other ideas?
> >
> > --Marty
> >
> > --- Dakota Jack <da...@gmail.com> wrote:
> >
> > > Not sure what you want. Does this help?
> > >
> > > package whatever;
> > >
> > > import java.io.File;
> > > import java.net.URL;
> > >
> > > public final class Classpath {
> > > public static final String SLASH = File.separator;
> > > public static final String HERE =
> > > Classpath.class.getClassLoader().getResource("whatever" + SLASH +
> > >
> > > "Classpath.class").getFile();
> > > }
> > >
> > >
> > > On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner
> > > <ma...@yahoo.com> wrote:
> > > >
> > > > As far as I can tell the attributes offer no insight. I have yet
> to
> > > find
> > > > a way to get to the container from within a PlugIn. But I will
> keep
> > > > looking. Using an initParam is not an option in this application.
> > > >
> > > > --Marty
> > > >
> > > > --- "Frank W. Zammetti" <fz...@omnytex.com> wrote:
> > > >
> > > > > The OP was looking for a way to construct the entire path. I
> too
> > > got as
> > > > >
> > > > > far as ServletContext, but I'm not sure what in it would give
> you
> > > that,
> > > > > or even all the pieces to constuct it... Maybe getAttribute()?
> I'm
> > > not
> > > > > sure what it will return, although you can use
> getAttributeNames()
> > > to
> > > > > see. The Javadocs indicates the attributes are
> container-specific
> > > > > though, so I'm not sure he'd want to use that anyway.
> > > > >
> > > > > This is just a matter of curiosity for me at this point, I long
> ago
> > > > > solved this problem another way. I'd like to know how to do it
> > > though.
> > > > >
> > > > > --
> > > > > Frank W. Zammetti
> > > > > Founder and Chief Software Architect
> > > > > Omnytex Technologies
> > > > > http://www.omnytex.com
> > > > >
> > > > >
> > > > > Jim Barrows wrote:
> > > > > > On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
> > > > > > <fz...@omnytex.com> wrote:
> > > > > >
> > > > > >>I seem to remember trying to solve this problem myself and
> coming
> > > to
> > > > > the
> > > > > >>conclusion that there was no way to do it independent of a
> > > request. I
> > > > > >>wound up just sticking it in my application config file that
> gets
> > > read
> > > > > >>in the plugin anyway. Can anyone prove me wrong? :)
> > > > > >
> > > > > >
> > > > > > Your looking for the application context correct?
> > > > > > In the init you are passed the ActionServlet, which inherits
> from
> > > > > > HttpServlet, which will give you the ServletContext. IIRC you
> can
> > > get
> > > > > > the context from there.
> > > > > >
> > > > > >
> > > > > >>--
> > > > > >>Frank W. Zammetti
> > > > > >>Founder and Chief Software Architect
> > > > > >>Omnytex Technologies
> > > > > >>http://www.omnytex.com
> > > > > >>
> > > > > >>Martin Wegner wrote:
> > > > > >>
> > > > > >>>In have a Struts PlugIn that needs to determine the URL for
> the
> > > > > containing
> > > > > >>>web application (http://localhost:8080/BlahBlahBlah/). I am
> > > unable
> > > > > to
> > > > > >>>find a way to determine this information. Any ideas?
> > > > > >>>
> > > > > >>>Thanks.
> > > > > >>>
> > > > > >>>
> > > > > >>>--Marty
> > > > > >>>
> > > > > >>>
> > > > >
> > >
> >>>---------------------------------------------------------------------
> > > > > >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > >>>For additional commands, e-mail: user-help@struts.apache.org
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>>.
> > > > > >>>
> > > > > >>
> > > > >
> > >
> >>---------------------------------------------------------------------
> > > > > >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > >>For additional commands, e-mail: user-help@struts.apache.org
> > > > > >>
> > > > > >>
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > > --
> > > > > Frank W. Zammetti
> > > > > Founder and Chief Software Architect
> > > > > Omnytex Technologies
> > > > > http://www.omnytex.com
> > > > >
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > >
> > > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > ------------------------------
> > >
> > > "You can lead a horse to water but you cannot make it float on its
> > > back."
> > >
> > > ~Dakota Jack~
> > >
> > > "You can't wake a person who is pretending to be asleep."
> > >
> > > ~Native Proverb~
> > >
> > > "Each man is good in His sight. It is not necessary for eagles to be
> > > crows."
> > >
> > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
> > >
> > > -----------------------------------------------
> > >
> > > "This message may contain confidential and/or privileged
> information.
> > > If you are not the addressee or authorized to receive this for the
> > > addressee, you must not use, copy, disclose, or take any action
> based
> > > on this message or any information herein. If you have received this
> > > message in error, please advise the sender immediately by reply
> e-mail
> > > and delete this message. Thank you for your cooperation."
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> ------------------------------
>
> "You can lead a horse to water but you cannot make it float on its
> back."
>
> ~Dakota Jack~
>
> "You can't wake a person who is pretending to be asleep."
>
> ~Native Proverb~
>
> "Each man is good in His sight. It is not necessary for eagles to be
> crows."
>
> ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
>
> -----------------------------------------------
>
> "This message may contain confidential and/or privileged information.
> If you are not the addressee or authorized to receive this for the
> addressee, you must not use, copy, disclose, or take any action based
> on this message or any information herein. If you have received this
> message in error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your cooperation."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by Dakota Jack <da...@gmail.com>.
Do you want the URL or the Internet Protocol address? I have some
ideas on the latter.
Jack
On Tue, 25 Jan 2005 21:05:30 -0800 (PST), Martin Wegner
<ma...@yahoo.com> wrote:
> Jack,
>
> That tells me where the JAR files are stored which is cool. But what I am
> looking for a valid URL (of which there may be many) to access my given
> web application. This info has to come from the container which may be
> the problem. I don't see anything in the container standard which
> provides this info.
>
> Any other ideas?
>
> --Marty
>
> --- Dakota Jack <da...@gmail.com> wrote:
>
> > Not sure what you want. Does this help?
> >
> > package whatever;
> >
> > import java.io.File;
> > import java.net.URL;
> >
> > public final class Classpath {
> > public static final String SLASH = File.separator;
> > public static final String HERE =
> > Classpath.class.getClassLoader().getResource("whatever" + SLASH +
> >
> > "Classpath.class").getFile();
> > }
> >
> >
> > On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner
> > <ma...@yahoo.com> wrote:
> > >
> > > As far as I can tell the attributes offer no insight. I have yet to
> > find
> > > a way to get to the container from within a PlugIn. But I will keep
> > > looking. Using an initParam is not an option in this application.
> > >
> > > --Marty
> > >
> > > --- "Frank W. Zammetti" <fz...@omnytex.com> wrote:
> > >
> > > > The OP was looking for a way to construct the entire path. I too
> > got as
> > > >
> > > > far as ServletContext, but I'm not sure what in it would give you
> > that,
> > > > or even all the pieces to constuct it... Maybe getAttribute()? I'm
> > not
> > > > sure what it will return, although you can use getAttributeNames()
> > to
> > > > see. The Javadocs indicates the attributes are container-specific
> > > > though, so I'm not sure he'd want to use that anyway.
> > > >
> > > > This is just a matter of curiosity for me at this point, I long ago
> > > > solved this problem another way. I'd like to know how to do it
> > though.
> > > >
> > > > --
> > > > Frank W. Zammetti
> > > > Founder and Chief Software Architect
> > > > Omnytex Technologies
> > > > http://www.omnytex.com
> > > >
> > > >
> > > > Jim Barrows wrote:
> > > > > On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
> > > > > <fz...@omnytex.com> wrote:
> > > > >
> > > > >>I seem to remember trying to solve this problem myself and coming
> > to
> > > > the
> > > > >>conclusion that there was no way to do it independent of a
> > request. I
> > > > >>wound up just sticking it in my application config file that gets
> > read
> > > > >>in the plugin anyway. Can anyone prove me wrong? :)
> > > > >
> > > > >
> > > > > Your looking for the application context correct?
> > > > > In the init you are passed the ActionServlet, which inherits from
> > > > > HttpServlet, which will give you the ServletContext. IIRC you can
> > get
> > > > > the context from there.
> > > > >
> > > > >
> > > > >>--
> > > > >>Frank W. Zammetti
> > > > >>Founder and Chief Software Architect
> > > > >>Omnytex Technologies
> > > > >>http://www.omnytex.com
> > > > >>
> > > > >>Martin Wegner wrote:
> > > > >>
> > > > >>>In have a Struts PlugIn that needs to determine the URL for the
> > > > containing
> > > > >>>web application (http://localhost:8080/BlahBlahBlah/). I am
> > unable
> > > > to
> > > > >>>find a way to determine this information. Any ideas?
> > > > >>>
> > > > >>>Thanks.
> > > > >>>
> > > > >>>
> > > > >>>--Marty
> > > > >>>
> > > > >>>
> > > >
> > >>>---------------------------------------------------------------------
> > > > >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > >>>For additional commands, e-mail: user-help@struts.apache.org
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>.
> > > > >>>
> > > > >>
> > > >
> > >>---------------------------------------------------------------------
> > > > >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > >>For additional commands, e-mail: user-help@struts.apache.org
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > > >
> > > >
> > > > --
> > > > Frank W. Zammetti
> > > > Founder and Chief Software Architect
> > > > Omnytex Technologies
> > > > http://www.omnytex.com
> > > >
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > ------------------------------
> >
> > "You can lead a horse to water but you cannot make it float on its
> > back."
> >
> > ~Dakota Jack~
> >
> > "You can't wake a person who is pretending to be asleep."
> >
> > ~Native Proverb~
> >
> > "Each man is good in His sight. It is not necessary for eagles to be
> > crows."
> >
> > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
> >
> > -----------------------------------------------
> >
> > "This message may contain confidential and/or privileged information.
> > If you are not the addressee or authorized to receive this for the
> > addressee, you must not use, copy, disclose, or take any action based
> > on this message or any information herein. If you have received this
> > message in error, please advise the sender immediately by reply e-mail
> > and delete this message. Thank you for your cooperation."
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
------------------------------
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
"You can't wake a person who is pretending to be asleep."
~Native Proverb~
"Each man is good in His sight. It is not necessary for eagles to be crows."
~Hunkesni (Sitting Bull), Hunkpapa Sioux~
-----------------------------------------------
"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
That is actually useful, but I don't think it's what the OP was looking
for... I think he literally wants the complete URL to the current
webapp's root. That's what I was looking for way back when too.
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Dakota Jack wrote:
> Not sure what you want. Does this help?
>
> package whatever;
>
> import java.io.File;
> import java.net.URL;
>
> public final class Classpath {
> public static final String SLASH = File.separator;
> public static final String HERE =
> Classpath.class.getClassLoader().getResource("whatever" + SLASH +
>
> "Classpath.class").getFile();
> }
>
>
> On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner
> <ma...@yahoo.com> wrote:
>
>>As far as I can tell the attributes offer no insight. I have yet to find
>>a way to get to the container from within a PlugIn. But I will keep
>>looking. Using an initParam is not an option in this application.
>>
>>--Marty
>>
>>--- "Frank W. Zammetti" <fz...@omnytex.com> wrote:
>>
>>
>>>The OP was looking for a way to construct the entire path. I too got as
>>>
>>>far as ServletContext, but I'm not sure what in it would give you that,
>>>or even all the pieces to constuct it... Maybe getAttribute()? I'm not
>>>sure what it will return, although you can use getAttributeNames() to
>>>see. The Javadocs indicates the attributes are container-specific
>>>though, so I'm not sure he'd want to use that anyway.
>>>
>>>This is just a matter of curiosity for me at this point, I long ago
>>>solved this problem another way. I'd like to know how to do it though.
>>>
>>>--
>>>Frank W. Zammetti
>>>Founder and Chief Software Architect
>>>Omnytex Technologies
>>>http://www.omnytex.com
>>>
>>>
>>>Jim Barrows wrote:
>>>
>>>>On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
>>>><fz...@omnytex.com> wrote:
>>>>
>>>>
>>>>>I seem to remember trying to solve this problem myself and coming to
>>>
>>>the
>>>
>>>>>conclusion that there was no way to do it independent of a request. I
>>>>>wound up just sticking it in my application config file that gets read
>>>>>in the plugin anyway. Can anyone prove me wrong? :)
>>>>
>>>>
>>>>Your looking for the application context correct?
>>>>In the init you are passed the ActionServlet, which inherits from
>>>>HttpServlet, which will give you the ServletContext. IIRC you can get
>>>>the context from there.
>>>>
>>>>
>>>>
>>>>>--
>>>>>Frank W. Zammetti
>>>>>Founder and Chief Software Architect
>>>>>Omnytex Technologies
>>>>>http://www.omnytex.com
>>>>>
>>>>>Martin Wegner wrote:
>>>>>
>>>>>
>>>>>>In have a Struts PlugIn that needs to determine the URL for the
>>>
>>>containing
>>>
>>>>>>web application (http://localhost:8080/BlahBlahBlah/). I am unable
>>>
>>>to
>>>
>>>>>>find a way to determine this information. Any ideas?
>>>>>>
>>>>>>Thanks.
>>>>>>
>>>>>>
>>>>>>--Marty
>>>>>>
>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>>For additional commands, e-mail: user-help@struts.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>.
>>>>>>
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>--
>>>Frank W. Zammetti
>>>Founder and Chief Software Architect
>>>Omnytex Technologies
>>>http://www.omnytex.com
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by Martin Wegner <ma...@yahoo.com>.
Jack,
That tells me where the JAR files are stored which is cool. But what I am
looking for a valid URL (of which there may be many) to access my given
web application. This info has to come from the container which may be
the problem. I don't see anything in the container standard which
provides this info.
Any other ideas?
--Marty
--- Dakota Jack <da...@gmail.com> wrote:
> Not sure what you want. Does this help?
>
> package whatever;
>
> import java.io.File;
> import java.net.URL;
>
> public final class Classpath {
> public static final String SLASH = File.separator;
> public static final String HERE =
> Classpath.class.getClassLoader().getResource("whatever" + SLASH +
>
> "Classpath.class").getFile();
> }
>
>
> On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner
> <ma...@yahoo.com> wrote:
> >
> > As far as I can tell the attributes offer no insight. I have yet to
> find
> > a way to get to the container from within a PlugIn. But I will keep
> > looking. Using an initParam is not an option in this application.
> >
> > --Marty
> >
> > --- "Frank W. Zammetti" <fz...@omnytex.com> wrote:
> >
> > > The OP was looking for a way to construct the entire path. I too
> got as
> > >
> > > far as ServletContext, but I'm not sure what in it would give you
> that,
> > > or even all the pieces to constuct it... Maybe getAttribute()? I'm
> not
> > > sure what it will return, although you can use getAttributeNames()
> to
> > > see. The Javadocs indicates the attributes are container-specific
> > > though, so I'm not sure he'd want to use that anyway.
> > >
> > > This is just a matter of curiosity for me at this point, I long ago
> > > solved this problem another way. I'd like to know how to do it
> though.
> > >
> > > --
> > > Frank W. Zammetti
> > > Founder and Chief Software Architect
> > > Omnytex Technologies
> > > http://www.omnytex.com
> > >
> > >
> > > Jim Barrows wrote:
> > > > On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
> > > > <fz...@omnytex.com> wrote:
> > > >
> > > >>I seem to remember trying to solve this problem myself and coming
> to
> > > the
> > > >>conclusion that there was no way to do it independent of a
> request. I
> > > >>wound up just sticking it in my application config file that gets
> read
> > > >>in the plugin anyway. Can anyone prove me wrong? :)
> > > >
> > > >
> > > > Your looking for the application context correct?
> > > > In the init you are passed the ActionServlet, which inherits from
> > > > HttpServlet, which will give you the ServletContext. IIRC you can
> get
> > > > the context from there.
> > > >
> > > >
> > > >>--
> > > >>Frank W. Zammetti
> > > >>Founder and Chief Software Architect
> > > >>Omnytex Technologies
> > > >>http://www.omnytex.com
> > > >>
> > > >>Martin Wegner wrote:
> > > >>
> > > >>>In have a Struts PlugIn that needs to determine the URL for the
> > > containing
> > > >>>web application (http://localhost:8080/BlahBlahBlah/). I am
> unable
> > > to
> > > >>>find a way to determine this information. Any ideas?
> > > >>>
> > > >>>Thanks.
> > > >>>
> > > >>>
> > > >>>--Marty
> > > >>>
> > > >>>
> > >
> >>>---------------------------------------------------------------------
> > > >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > >>>For additional commands, e-mail: user-help@struts.apache.org
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>>.
> > > >>>
> > > >>
> > >
> >>---------------------------------------------------------------------
> > > >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > >>For additional commands, e-mail: user-help@struts.apache.org
> > > >>
> > > >>
> > > >
> > > >
> > > >
> > >
> > > --
> > > Frank W. Zammetti
> > > Founder and Chief Software Architect
> > > Omnytex Technologies
> > > http://www.omnytex.com
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> ------------------------------
>
> "You can lead a horse to water but you cannot make it float on its
> back."
>
> ~Dakota Jack~
>
> "You can't wake a person who is pretending to be asleep."
>
> ~Native Proverb~
>
> "Each man is good in His sight. It is not necessary for eagles to be
> crows."
>
> ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
>
> -----------------------------------------------
>
> "This message may contain confidential and/or privileged information.
> If you are not the addressee or authorized to receive this for the
> addressee, you must not use, copy, disclose, or take any action based
> on this message or any information herein. If you have received this
> message in error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your cooperation."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by Dakota Jack <da...@gmail.com>.
Not sure what you want. Does this help?
package whatever;
import java.io.File;
import java.net.URL;
public final class Classpath {
public static final String SLASH = File.separator;
public static final String HERE =
Classpath.class.getClassLoader().getResource("whatever" + SLASH +
"Classpath.class").getFile();
}
On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner
<ma...@yahoo.com> wrote:
>
> As far as I can tell the attributes offer no insight. I have yet to find
> a way to get to the container from within a PlugIn. But I will keep
> looking. Using an initParam is not an option in this application.
>
> --Marty
>
> --- "Frank W. Zammetti" <fz...@omnytex.com> wrote:
>
> > The OP was looking for a way to construct the entire path. I too got as
> >
> > far as ServletContext, but I'm not sure what in it would give you that,
> > or even all the pieces to constuct it... Maybe getAttribute()? I'm not
> > sure what it will return, although you can use getAttributeNames() to
> > see. The Javadocs indicates the attributes are container-specific
> > though, so I'm not sure he'd want to use that anyway.
> >
> > This is just a matter of curiosity for me at this point, I long ago
> > solved this problem another way. I'd like to know how to do it though.
> >
> > --
> > Frank W. Zammetti
> > Founder and Chief Software Architect
> > Omnytex Technologies
> > http://www.omnytex.com
> >
> >
> > Jim Barrows wrote:
> > > On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
> > > <fz...@omnytex.com> wrote:
> > >
> > >>I seem to remember trying to solve this problem myself and coming to
> > the
> > >>conclusion that there was no way to do it independent of a request. I
> > >>wound up just sticking it in my application config file that gets read
> > >>in the plugin anyway. Can anyone prove me wrong? :)
> > >
> > >
> > > Your looking for the application context correct?
> > > In the init you are passed the ActionServlet, which inherits from
> > > HttpServlet, which will give you the ServletContext. IIRC you can get
> > > the context from there.
> > >
> > >
> > >>--
> > >>Frank W. Zammetti
> > >>Founder and Chief Software Architect
> > >>Omnytex Technologies
> > >>http://www.omnytex.com
> > >>
> > >>Martin Wegner wrote:
> > >>
> > >>>In have a Struts PlugIn that needs to determine the URL for the
> > containing
> > >>>web application (http://localhost:8080/BlahBlahBlah/). I am unable
> > to
> > >>>find a way to determine this information. Any ideas?
> > >>>
> > >>>Thanks.
> > >>>
> > >>>
> > >>>--Marty
> > >>>
> > >>>
> > >>>---------------------------------------------------------------------
> > >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >>>For additional commands, e-mail: user-help@struts.apache.org
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>.
> > >>>
> > >>
> > >>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >>For additional commands, e-mail: user-help@struts.apache.org
> > >>
> > >>
> > >
> > >
> > >
> >
> > --
> > Frank W. Zammetti
> > Founder and Chief Software Architect
> > Omnytex Technologies
> > http://www.omnytex.com
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
------------------------------
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
"You can't wake a person who is pretending to be asleep."
~Native Proverb~
"Each man is good in His sight. It is not necessary for eagles to be crows."
~Hunkesni (Sitting Bull), Hunkpapa Sioux~
-----------------------------------------------
"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by Martin Wegner <ma...@yahoo.com>.
As far as I can tell the attributes offer no insight. I have yet to find
a way to get to the container from within a PlugIn. But I will keep
looking. Using an initParam is not an option in this application.
--Marty
--- "Frank W. Zammetti" <fz...@omnytex.com> wrote:
> The OP was looking for a way to construct the entire path. I too got as
>
> far as ServletContext, but I'm not sure what in it would give you that,
> or even all the pieces to constuct it... Maybe getAttribute()? I'm not
> sure what it will return, although you can use getAttributeNames() to
> see. The Javadocs indicates the attributes are container-specific
> though, so I'm not sure he'd want to use that anyway.
>
> This is just a matter of curiosity for me at this point, I long ago
> solved this problem another way. I'd like to know how to do it though.
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
>
>
> Jim Barrows wrote:
> > On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
> > <fz...@omnytex.com> wrote:
> >
> >>I seem to remember trying to solve this problem myself and coming to
> the
> >>conclusion that there was no way to do it independent of a request. I
> >>wound up just sticking it in my application config file that gets read
> >>in the plugin anyway. Can anyone prove me wrong? :)
> >
> >
> > Your looking for the application context correct?
> > In the init you are passed the ActionServlet, which inherits from
> > HttpServlet, which will give you the ServletContext. IIRC you can get
> > the context from there.
> >
> >
> >>--
> >>Frank W. Zammetti
> >>Founder and Chief Software Architect
> >>Omnytex Technologies
> >>http://www.omnytex.com
> >>
> >>Martin Wegner wrote:
> >>
> >>>In have a Struts PlugIn that needs to determine the URL for the
> containing
> >>>web application (http://localhost:8080/BlahBlahBlah/). I am unable
> to
> >>>find a way to determine this information. Any ideas?
> >>>
> >>>Thanks.
> >>>
> >>>
> >>>--Marty
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>For additional commands, e-mail: user-help@struts.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>.
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> >
> >
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
The OP was looking for a way to construct the entire path. I too got as
far as ServletContext, but I'm not sure what in it would give you that,
or even all the pieces to constuct it... Maybe getAttribute()? I'm not
sure what it will return, although you can use getAttributeNames() to
see. The Javadocs indicates the attributes are container-specific
though, so I'm not sure he'd want to use that anyway.
This is just a matter of curiosity for me at this point, I long ago
solved this problem another way. I'd like to know how to do it though.
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Jim Barrows wrote:
> On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
> <fz...@omnytex.com> wrote:
>
>>I seem to remember trying to solve this problem myself and coming to the
>>conclusion that there was no way to do it independent of a request. I
>>wound up just sticking it in my application config file that gets read
>>in the plugin anyway. Can anyone prove me wrong? :)
>
>
> Your looking for the application context correct?
> In the init you are passed the ActionServlet, which inherits from
> HttpServlet, which will give you the ServletContext. IIRC you can get
> the context from there.
>
>
>>--
>>Frank W. Zammetti
>>Founder and Chief Software Architect
>>Omnytex Technologies
>>http://www.omnytex.com
>>
>>Martin Wegner wrote:
>>
>>>In have a Struts PlugIn that needs to determine the URL for the containing
>>>web application (http://localhost:8080/BlahBlahBlah/). I am unable to
>>>find a way to determine this information. Any ideas?
>>>
>>>Thanks.
>>>
>>>
>>>--Marty
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>>.
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by Jim Barrows <ji...@gmail.com>.
On Tue, 25 Jan 2005 18:37:29 -0500, Frank W. Zammetti
<fz...@omnytex.com> wrote:
> I seem to remember trying to solve this problem myself and coming to the
> conclusion that there was no way to do it independent of a request. I
> wound up just sticking it in my application config file that gets read
> in the plugin anyway. Can anyone prove me wrong? :)
Your looking for the application context correct?
In the init you are passed the ActionServlet, which inherits from
HttpServlet, which will give you the ServletContext. IIRC you can get
the context from there.
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
>
> Martin Wegner wrote:
> > In have a Struts PlugIn that needs to determine the URL for the containing
> > web application (http://localhost:8080/BlahBlahBlah/). I am unable to
> > find a way to determine this information. Any ideas?
> >
> > Thanks.
> >
> >
> > --Marty
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
> >
> > .
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
James A Barrows
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: PlugIn and the base URL
Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
I seem to remember trying to solve this problem myself and coming to the
conclusion that there was no way to do it independent of a request. I
wound up just sticking it in my application config file that gets read
in the plugin anyway. Can anyone prove me wrong? :)
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Martin Wegner wrote:
> In have a Struts PlugIn that needs to determine the URL for the containing
> web application (http://localhost:8080/BlahBlahBlah/). I am unable to
> find a way to determine this information. Any ideas?
>
> Thanks.
>
>
> --Marty
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> .
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org