On 9/16/01 10:50 AM, "Dan Bachelder" <[EMAIL PROTECTED]> wrote:
>> Done. I have changed the Turbine.java and the servlet service so that the
>> server information is collected during the first request in Turbine.java
> and
>> the ServletService will delegate requests for the server info the
>> Turbine.java.
>
> It looks good so far... some slight issues perhaps... in my Index.vm
>
> $ui.image("yo")
>
> renders to
>
> http://127.0.0.1:80C:\dev\tdk\webapps\law//resources/ui/skins/default/images
> /yo
Oops, that's my fault I'll fix that I used the application root instead of
the context path there.
> which looks a bit funny.... I dont really use images, so this doesn't really
> matter to me.
What's above isn't right.
> anyway... it looks like the server data is populated on the first request...
> thanks!
>
> more on scheduled jobs below....
>
>> I've updated the ServletService screen and template in the sample/test app
>> and the values appear to be showing up correctly. I don't have a scheduled
>> job on hand to easily test this so if you could try what's in CVS with
> your
>> scenerio that was giving you problems I'd appreciate it.
>
> after making the initial request my scheduled jobs work as follows...
>
> I have to instantiate TemplateLink with the following serverdata for it to
> work...
> are you supposed to have to hand in so much for a script name?
Do not use ServerData you don't need it and it doesn't exist in Turbine 3.0.
With the information you can now get the servlet service you don't need to
make a template link. You're actually just going around in a circle there
making a ServerData object because the template link just pulls out the info
you just fed into the ServerData constructor. When the getContextPath()
method is fixed to return the proper information you can just construct the
correct URL yourself.
What you're doing here is a prime example of what happens when there is a
lack of information and no API. I've never seen anyone do this before, not
to say that it's wrong but I certainly would never expect usage like this.
In short it shouldn't be necessary when you can properly retrieve all the
info from the servlet service.
I will add another example to tdk servlet service example and construct an
URL the way I suggest above to make sure it works and I'll let you know.
> ServerData sd = new ServerData(Turbine.getServerName(),
> Integer.parseInt(Turbine.getServerPort()),
> Turbine.getServerScheme(),
> "/law/servlet/law",
> Turbine.getContextPath());
>
> which gives me a link like the following... note the lack of port...
>
> http://127.0.0.1/law/servlet/law/template/NewReminder.vm
>
> this is much better than before... thanks...
You you be able to construct the URL in the following manner
String url = new StringBuffer().
append(TurbineServlet.getServerScheme()).
append("://").
append(TurbineServlet.getServerName()).
append(":").
append(TurbineServlet.getServerPort()).
append(TurbineServlet.getContextPath()).
append(pathToYourResource).
toString();
Something close to that anyway.
> Now I also know how to use jakartas cvs and how to build turbine and place
> the new build in my tdk so everything works! way cool... thanks for that too
> :)
>
I'll get the context path fix in later on today. I'll post something when
it's in there sorry for the first round glitch.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
jvz.
Jason van Zyl
http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]