Re: Image tag lib doesn't work on Windows 2003 server?

2007-09-24 Thread Kris Schneider
Can you be more specific about what you mean by doesn't work? Do you
get an exception? Have you tried running the JVM with
-Djava.awt.headless=true? Are you using the same JDK and app server
versions on both XP and Server 2003?

On 9/23/07, zhou peng [EMAIL PROTECTED] wrote:
 Hi,

 We use taglibs-image, put all jar into web-inf\lib,  and show image
 correctly on Windows XP, but when we deploy it to our Windows 2003 Server,
 it doesn't work, but also the example of taglibs-image example.war . Anyone
 can give me some advice? Thanx.

 Rick Zhou, 2007-9-24

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
directThought  http://www.directThought.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Image tag lib doesn't work on Windows 2003 server?

2007-09-24 Thread Kris Schneider
If you can't change the env so that the app can create and write to
that directory, I think you can try this (some of the info can be
found in the docs:
http://jakarta.apache.org/taglibs/sandbox/doc/image-doc/index.html).

Add the following to web.xml:

  context-param
param-nameImageServletMapping/param-name
param-value/gen-image/param-value
  /context-param

  servlet
servlet-nameImageServlet/servlet-name
servlet-classorg.apache.taglibs.image.ImageServlet/servlet-class
  /servlet

  servlet-mapping
servlet-nameImageServlet/servlet-name
url-pattern/gen-image/*/url-pattern
  /servlet-mapping

Then remove the dir attribute from the image tags. For example, if
you had this:

img:image
src=/images/splash.jpg
dir=generated
name=splash-new.jpg
attributes=alt='A sample image'
refresh=false
quality=0.8
/img:image

Use this instead:

img:image
src=/images/splash.jpg
name=splash-new.jpg
attributes=alt='A sample image'
refresh=false
quality=0.8
/img:image

This should store images in a temp dir instead of the one specified by
dir. Hopefully, the app will be able to write to that dir...

On 9/24/07, zhou peng [EMAIL PROTECTED] wrote:
 Thanx for Kirs' advice.

 I have checked again, we use the same JDK and app server versions, there's
 no exceptions in tomcat log, and images can show in localhost and lan env,
 but just can't show in wan. I compared the directory between localhost, lan
 and wan connection, and found that in wan couldn't create the generated
 directory, I think it because of different rights between these env? Any
 more advices?

 Rick Zhou, 2007-9-25

 2007/9/24, Kris Schneider [EMAIL PROTECTED]:
 
  Can you be more specific about what you mean by doesn't work? Do you
  get an exception? Have you tried running the JVM with
  -Djava.awt.headless=true? Are you using the same JDK and app server
  versions on both XP and Server 2003?
 
  On 9/23/07, zhou peng [EMAIL PROTECTED] wrote:
   Hi,
  
   We use taglibs-image, put all jar into web-inf\lib,  and show image
   correctly on Windows XP, but when we deploy it to our Windows 2003
  Server,
   it doesn't work, but also the example of taglibs-image example.war .
  Anyone
   can give me some advice? Thanx.
  
   Rick Zhou, 2007-9-24
 
  --
  Kris Schneider mailto:[EMAIL PROTECTED]
  directThought  http://www.directThought.com/

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
directThought  http://www.directThought.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Image tag lib doesn't work on Windows 2003 server?

2007-09-24 Thread zhou peng
Thanks a lot, Kirs.

I have tried your method, it still can't show image when use wan connected.
I have no idea about how to change the env so that the app can create and
write to generated or temp-dir, can you give me an examples for windows
2003 server.

I have checked our app, it can create chart png at tomcat\temp with
jfreechart, maybe we could change the env so that app can use it or
app\generated dir. I think both your method or our app could show correctly
because our server disable some user account or rights, so we can change
some env for the dir such as generated or app, and can still safe? More
help, please!

Rick Zhou, 2007-9-24

2007/9/24, Kris Schneider [EMAIL PROTECTED]:

 If you can't change the env so that the app can create and write to
 that directory, I think you can try this (some of the info can be
 found in the docs:
 http://jakarta.apache.org/taglibs/sandbox/doc/image-doc/index.html).

 Add the following to web.xml:

   context-param
 param-nameImageServletMapping/param-name
 param-value/gen-image/param-value
   /context-param

   servlet
 servlet-nameImageServlet/servlet-name
 servlet-classorg.apache.taglibs.image.ImageServlet/servlet-class
   /servlet

   servlet-mapping
 servlet-nameImageServlet/servlet-name
 url-pattern/gen-image/*/url-pattern
   /servlet-mapping

 Then remove the dir attribute from the image tags. For example, if
 you had this:

 img:image
 src=/images/splash.jpg
 dir=generated
 name=splash-new.jpg
 attributes=alt='A sample image'
 refresh=false
 quality=0.8
 /img:image

 Use this instead:

 img:image
 src=/images/splash.jpg
 name=splash-new.jpg
 attributes=alt='A sample image'
 refresh=false
 quality=0.8
 /img:image

 This should store images in a temp dir instead of the one specified by
 dir. Hopefully, the app will be able to write to that dir...

 On 9/24/07, zhou peng [EMAIL PROTECTED] wrote:
  Thanx for Kirs' advice.
 
  I have checked again, we use the same JDK and app server versions,
 there's
  no exceptions in tomcat log, and images can show in localhost and lan
 env,
  but just can't show in wan. I compared the directory between localhost,
 lan
  and wan connection, and found that in wan couldn't create the
 generated
  directory, I think it because of different rights between these env? Any
  more advices?
 
  Rick Zhou, 2007-9-25
 
  2007/9/24, Kris Schneider [EMAIL PROTECTED]:
  
   Can you be more specific about what you mean by doesn't work? Do you
   get an exception? Have you tried running the JVM with
   -Djava.awt.headless=true? Are you using the same JDK and app server
   versions on both XP and Server 2003?
  
   On 9/23/07, zhou peng [EMAIL PROTECTED] wrote:
Hi,
   
We use taglibs-image, put all jar into web-inf\lib,  and show image
correctly on Windows XP, but when we deploy it to our Windows 2003
   Server,
it doesn't work, but also the example of taglibs-image example.war .
   Anyone
can give me some advice? Thanx.
   
Rick Zhou, 2007-9-24
  
   --
   Kris Schneider mailto:[EMAIL PROTECTED]
   directThought  http://www.directThought.com/

 --
 Kris Schneider mailto:[EMAIL PROTECTED]
 directThought  http://www.directThought.com/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]