You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Chih Ming Hsueh <cm...@gmail.com> on 2004/11/16 11:12:03 UTC

Got blank page occasionally!!

Hi,

I am using VelocityServlet to control the view style according to
velocity servlet_example1.
I would got a blank page without any error message in velocity.log at
some pc, but
it is always normal in my pc.
Is there debug tool to diagnose this problem ?

-- I use the following code to configure velocity
  protected Properties loadConfiguration(ServletConfig config ) throws
IOException, FileNotFoundException
  {
      Properties p = new Properties();
      path = "/opt/bea/user_projects/domains/xxx/template/eGovScreen";

      System.out.println("VelocityPath=" + path);
      p.setProperty( Velocity.FILE_RESOURCE_LOADER_PATH,  path );

      p.setProperty( "runtime.log", path + "/velocity.log" );
      return p;
  }

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Got blank page occasionally!!

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Chih,

> I add the following setting in my loadConfiguration()
> 
>       p.setProperty( "runtime.log.error.stacktrace","true");
>       p.setProperty( "runtime.log.warn.stacktrace","true");
>       p.setProperty( "runtime.log.info.stacktrace","true");
> 
> but there is no difference in my velocity.log
OK.  Let's start from the beginning.

> > > > I am using VelocityServlet to control the view style according to
> > > > velocity servlet_example1.
Does servlet_example1 work for all of your clients?  If it does, change
it a little by little towards your servlet until you find the problem.

> > "some pc" means some web clients.  But I can not figure out how it
> > happened because these web client with the same os version,  IE
> > version and IE settings as my pc.
How about firewalls?

Other things to check.
- Server access permissions
  - Does the server allow access to the web server's port from the
    clients?
- Server file permissions
  - Does the server process have write permission to the log file?
  - Does the server process have read permission to the template file?
- Web/App server log
  - Is the client request getting to the server?
  - Is the server calling the right servlet?
  - Is the server returning anything to the client?
  - Is the HTTP return code 200?
- IE
  - Is there anything in the HTML of the blank page?
## Most of these have nothing to do with Velocity, though.  B)

Anything else, everyone?

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <sh...@gmail.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Got blank page occasionally!!

Posted by Chih Ming Hsueh <cm...@gmail.com>.
Hi,

I add the following setting in my loadConfiguration()

      p.setProperty( "runtime.log.error.stacktrace","true");
      p.setProperty( "runtime.log.warn.stacktrace","true");
      p.setProperty( "runtime.log.info.stacktrace","true");

but there is no difference in my velocity.log

On Tue, 16 Nov 2004 19:51:55 +0800, Chih Ming Hsueh <cm...@gmail.com> wrote:
> Hi Shinobu
> 
> "some pc" means some web clients.  But I can not figure out how it
> happened because these web client with the same os version,  IE
> version and IE settings as my pc.
> 
> I would try to turn on the stacktrace to keep monitoring.
> 
> 
> 
> On Tue, 16 Nov 2004 20:43:23 +0900, Shinobu Kawai
> <sh...@gmail.com> wrote:
> > Hi Chih,
> >
> > > I am using VelocityServlet to control the view style according to
> > > velocity servlet_example1.
> > > I would got a blank page without any error message in velocity.log at
> > > some pc, but
> > > it is always normal in my pc.
> > When you say "some pc", are you talking about the web client, or the
> > server?  If the server, are you sure that the directory layouts are
> > exactly the same?  Just asking because your example below sets the
> > path to an absolute path.
> >
> > > Is there debug tool to diagnose this problem ?
> > You can set the properties to dump more logs.  See the
> > runtime.log.*.stacktrace properties.
> >  http://jakarta.apache.org/velocity/developer-guide.html#Velocity%20Configuration%20Keys%20and%20Values
> >
> > > -- I use the following code to configure velocity
> > >  protected Properties loadConfiguration(ServletConfig config ) throws
> > > IOException, FileNotFoundException
> > >  {
> > >      Properties p = new Properties();
> > >      path = "/opt/bea/user_projects/domains/xxx/template/eGovScreen";
> > >
> > >      System.out.println("VelocityPath=" + path);
> > >      p.setProperty( Velocity.FILE_RESOURCE_LOADER_PATH,  path );
> > >
> > >      p.setProperty( "runtime.log", path + "/velocity.log" );
> > >      return p;
> > >  }
> >
> > Best regards,
> > -- Shinobu Kawai
> >
> > --
> > Shinobu Kawai <sh...@gmail.com>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Got blank page occasionally!!

Posted by Chih Ming Hsueh <cm...@gmail.com>.
Hi Shinobu

"some pc" means some web clients.  But I can not figure out how it
happened because these web client with the same os version,  IE
version and IE settings as my pc.

I would try to turn on the stacktrace to keep monitoring.

On Tue, 16 Nov 2004 20:43:23 +0900, Shinobu Kawai
<sh...@gmail.com> wrote:
> Hi Chih,
> 
> > I am using VelocityServlet to control the view style according to
> > velocity servlet_example1.
> > I would got a blank page without any error message in velocity.log at
> > some pc, but
> > it is always normal in my pc.
> When you say "some pc", are you talking about the web client, or the
> server?  If the server, are you sure that the directory layouts are
> exactly the same?  Just asking because your example below sets the
> path to an absolute path.
> 
> > Is there debug tool to diagnose this problem ?
> You can set the properties to dump more logs.  See the
> runtime.log.*.stacktrace properties.
>  http://jakarta.apache.org/velocity/developer-guide.html#Velocity%20Configuration%20Keys%20and%20Values
> 
> > -- I use the following code to configure velocity
> >  protected Properties loadConfiguration(ServletConfig config ) throws
> > IOException, FileNotFoundException
> >  {
> >      Properties p = new Properties();
> >      path = "/opt/bea/user_projects/domains/xxx/template/eGovScreen";
> >
> >      System.out.println("VelocityPath=" + path);
> >      p.setProperty( Velocity.FILE_RESOURCE_LOADER_PATH,  path );
> >
> >      p.setProperty( "runtime.log", path + "/velocity.log" );
> >      return p;
> >  }
> 
> Best regards,
> -- Shinobu Kawai
> 
> --
> Shinobu Kawai <sh...@gmail.com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Please unsubscribe me!

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi John,

> My email configuration has changed and I can't figure out how to 
> unsubscribe.
> 
> My old email was john@sfhypnosis.com

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
And send it from your old email.

## Also check the "Return-Path" header for the email you subscribed with.

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <sh...@gmail.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: problems with includes

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi christopher,

> if i use
> mywebapp
>   |- META-INF
>   |- WEB-INF
>     |- templates
>   |- images
>   |- scripts
> 
> then what do i use in my velocity properties?
> this is what i am using now
> 
> #
> # we are taking advantage of the fact that the file
> # resource loader is the default loader
> #
> 
> resource.loader = webapp
> webapp.resource.loader.description = Velocity Webapp Resource Loader
> webapp.resource.loader.class =
> org.apache.velocity.tools.view.servlet.WebappLoader
> webapp.resource.loader.path = /templates
webapp.resource.loader.path = /WEB-INF/templates
  http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/view/servlet/WebappLoader.html

In case you're using VelocityViewServlet, the "resource.loader" and
"webapp.resource.loader.class" are automatically set to these values. 
;)

> this works with my directory layout. as you can see, i am trying to follow
> the directory structure recommend for jarkarta servelets etc
Just out of curiosity, where can I find documentaion on this?

Best regards,
-- Shinobu Kawai

-- 
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: problems with includes

Posted by pi...@yahoo.co.uk.
thanks
if i use
 mywebapp
   |- META-INF
   |- WEB-INF
     |- templates
   |- images
   |- scripts

then what do i use in my velocity properties?
this is what i am using now

#
# we are taking advantage of the fact that the file
# resource loader is the default loader
#

resource.loader = webapp
webapp.resource.loader.description = Velocity Webapp Resource Loader
webapp.resource.loader.class =
org.apache.velocity.tools.view.servlet.WebappLoader
webapp.resource.loader.path = /templates

this works with my directory layout. as you can see, i am trying to follow
the directory structure recommend for jarkarta servelets etc

thanks
christopher

----- Original Message ----- 
From: "Simon Christian" <si...@stoutstick.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Wednesday, November 17, 2004 7:21 AM
Subject: Re: problems with includes


> Shinobu Kawai wrote:
> > Hi christopher,
> >
> >
> >>what if i wanted to access another image in a subdir of mine..
> >>for example
> >>mywebapp
> >>   web
> >>       META-INF
> >>       WEB-INF
> >>       templates
> >>           images
> >>   src
> >>   build
> >>
> >>i want to access the images in the image subdir of the templates
directory.
> >
> >
> >>>  <img src="http://jakarta.apache.org/velocity/images/logo.gif" />
> >
> > Just change the URI in the src attribute to a relative path.  You can
> > use the LikeTool to resolve relative paths.
> >   http://jakarta.apache.org/velocity/tools/view/LinkTool.html
> >
> > You also need to configure your server to process static images, but
> > that's usually done by default.  ;)
> >
> > Best regards,
> > -- Shinobu Kawai
> >
>
> Christopher,
>
> One caveat with this: the images directory shouldn't be within the
> WEB-INF folder at all as this isn't generally externally visible from
> the app server. The final (expanded) app structure could/should look
> something like:
>
> mywebapp
>   |- META-INF
>   |- WEB-INF
>     |- templates
>   |- images
>   |- scripts
>
> You can then reference images or other resources relative to the
templates.
>
> hth
>
> - simon
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: problems with includes

Posted by Simon Christian <si...@stoutstick.com>.
Shinobu Kawai wrote:
> Hi christopher,
> 
> 
>>what if i wanted to access another image in a subdir of mine..
>>for example
>>mywebapp
>>   web
>>       META-INF
>>       WEB-INF
>>       templates
>>           images
>>   src
>>   build
>>
>>i want to access the images in the image subdir of the templates directory.
> 
> 
>>>  <img src="http://jakarta.apache.org/velocity/images/logo.gif" />
> 
> Just change the URI in the src attribute to a relative path.  You can
> use the LikeTool to resolve relative paths.
>   http://jakarta.apache.org/velocity/tools/view/LinkTool.html
> 
> You also need to configure your server to process static images, but
> that's usually done by default.  ;)
> 
> Best regards,
> -- Shinobu Kawai
> 

Christopher,

One caveat with this: the images directory shouldn't be within the 
WEB-INF folder at all as this isn't generally externally visible from 
the app server. The final (expanded) app structure could/should look 
something like:

mywebapp
  |- META-INF
  |- WEB-INF
    |- templates
  |- images
  |- scripts

You can then reference images or other resources relative to the templates.

hth

- simon

		


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: problems with includes

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi christopher,

> what if i wanted to access another image in a subdir of mine..
> for example
> mywebapp
>    web
>        META-INF
>        WEB-INF
>        templates
>            images
>    src
>    build
> 
> i want to access the images in the image subdir of the templates directory.

> >   <img src="http://jakarta.apache.org/velocity/images/logo.gif" />
Just change the URI in the src attribute to a relative path.  You can
use the LikeTool to resolve relative paths.
  http://jakarta.apache.org/velocity/tools/view/LinkTool.html

You also need to configure your server to process static images, but
that's usually done by default.  ;)

Best regards,
-- Shinobu Kawai

-- 
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Please unsubscribe me!

Posted by John Rothfield <jo...@sfhypnosis.com>.
My email configuration has changed and I can't figure out how to 
unsubscribe.

My old email was john@sfhypnosis.com

Thanks, John
707-538-5133

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: problems with includes

Posted by pi...@yahoo.co.uk.
thanks for your reply.
what if i wanted to access another image in a subdir of mine..
for example
mywebapp
    web
        META-INF
        WEB-INF
        templates
            images
    src
    build

i want to access the images in the image subdir of the templates directory.

thanks
christopher

----- Original Message ----- 
From: "Shinobu Kawai" <sh...@gmail.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>;
<pi...@yahoo.co.uk>
Sent: Tuesday, November 16, 2004 7:58 AM
Subject: Re: problems with includes


> Hi chris,
>
> > my question, can i include reference to images(like regyular html) in
the
> > template?
> > i tried but it doesnt work.
> > then i tried to use includes.
> > i did a html page with images that works when viwed along
> > but when i try to include that in the template and then "render" the
> > template it is blank.
> Just do it like regular html.  Put the following in your template, and
> you should see a wonderful image.  :)
>   <img src="http://jakarta.apache.org/velocity/images/logo.gif" />
>
> Best regards,
> -- Shinobu Kawai
>
> -- 
> Shinobu Kawai <sh...@gmail.com>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: problems with includes

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi chris,

> my question, can i include reference to images(like regyular html) in the
> template?
> i tried but it doesnt work.
> then i tried to use includes.
> i did a html page with images that works when viwed along
> but when i try to include that in the template and then "render" the
> template it is blank.
Just do it like regular html.  Put the following in your template, and
you should see a wonderful image.  :)
  <img src="http://jakarta.apache.org/velocity/images/logo.gif" />

Best regards,
-- Shinobu Kawai

-- 
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


problems with includes

Posted by pi...@yahoo.co.uk.
high all
i am a newbie to this
i ran through some of the examples but i had problems, with servlets.
so then i switched to the velocitytools servlet
and that worked ok, for loading the templates and so on.
my question, can i include reference to images(like regyular html) in the
template?
i tried but it doesnt work.
then i tried to use includes.
i did a html page with images that works when viwed along
but when i try to include that in the template and then "render" the
template it is blank.

anyone can help me?

many thanks
chris


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Got blank page occasionally!!

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Chih,

> I am using VelocityServlet to control the view style according to
> velocity servlet_example1.
> I would got a blank page without any error message in velocity.log at
> some pc, but
> it is always normal in my pc.
When you say "some pc", are you talking about the web client, or the
server?  If the server, are you sure that the directory layouts are
exactly the same?  Just asking because your example below sets the
path to an absolute path.

> Is there debug tool to diagnose this problem ?
You can set the properties to dump more logs.  See the
runtime.log.*.stacktrace properties.
  http://jakarta.apache.org/velocity/developer-guide.html#Velocity%20Configuration%20Keys%20and%20Values

> -- I use the following code to configure velocity
>  protected Properties loadConfiguration(ServletConfig config ) throws
> IOException, FileNotFoundException
>  {
>      Properties p = new Properties();
>      path = "/opt/bea/user_projects/domains/xxx/template/eGovScreen";
> 
>      System.out.println("VelocityPath=" + path);
>      p.setProperty( Velocity.FILE_RESOURCE_LOADER_PATH,  path );
> 
>      p.setProperty( "runtime.log", path + "/velocity.log" );
>      return p;
>  }

Best regards,
-- Shinobu Kawai

-- 
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org