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-name>ImageServletMapping</param-name>
    <param-value>/gen-image</param-value>
  </context-param>

  <servlet>
    <servlet-name>ImageServlet</servlet-name>
    <servlet-class>org.apache.taglibs.image.ImageServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>ImageServlet</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]

Reply via email to