I'm fairly old school, so a lot of my solutions kind of tend to
sidestep the platforms I use :). It's all a matter of using the right tool
for the right job.
--- Pat
> -----Original Message-----
> From: Nick Stuart [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 01, 2005 10:23 AM
> To: Tapestry users
> Subject: Re: TAP4 upload path?
>
> That works. Not very 'tapestry' like, but it works. :)
>
> Thanks!
>
> On 9/1/05, Patrick Casey <[EMAIL PROTECTED]> wrote:
> >
> > How about putting this line in your servlet:
> > public void init(ServletConfig config) throws ServletException {
> > super.init(config);
> > String temp =
> > config.getServletContext().getRealPath("work");
> > fWorkDirectory = temp;
> > if (fDebug) {
> > Log.info("NOT starting scheduler because we're
> in
> > debug mode");
> > return;
> > }
> > ScheduleReader run = new ScheduleReader();
> > run.setDaemon(true);
> > run.setName("Schedule Reader");
> > run.start();
> >
> > }
> >
> > public static String getWorkDirectory() {
> > return fWorkDirectory;
> > }
> >
> > Then whenever you need the work directory just do a
> > MyServlet.getWorkDirector() to access the static.
> >
> > --- Pat
> >
> > > -----Original Message-----
> > > From: Nick Stuart [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, September 01, 2005 9:48 AM
> > > To: Tapestry users
> > > Subject: TAP4 upload path?
> > >
> > > Hi all, did some digging and all I can find are references that will
> > > work 3.0 but not for 4. So, what is the best way to get the actually
> > > full path in your webcontext to upload files to? In 3 you could do
> > > something like:
> > > String path =
> > >
> getRequestCycle().getRequestContext().getServlet().getServletContext().get
> > > RealPath("/");
> > >
> > > But in 4 the getRequestContext() is deprecated and there is no more
> > > getServlet in the context. My first question was how does one get
> > > ahold of the requestContext, or what seems to have replaced it,
> > > 'WebRequest'. and once you have it can you do anything with it to get
> > > the actual path?
> > >
> > > Thanks!
> > > -Nick
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]