Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-17 Thread Dakota Jack

Here is an example.  You can make the cache values dynamic.  I assume you
know how to use class loaders to get your classpath dynamically, which is
what Classpath.WEB_INF does.  This solution involves having one folder where
you store all your resources, separating them into subfolders named tiff,
etc.


public final class ResourceCacheAction
   extends Action {

 public ActionForward execute(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
 throws IOException,
ServletException {
   String file= request.getParameter(file);
   String ext = file.substring(file.lastIndexOf('.') + 1);
   String type= null;
   String path= null;

   if (gif.equals(ext)) {
 type = image/gif;
 path = path(gif);
   } else if (jpg.equals(ext)) {
 type = image/jpeg;
 path = path(jpeg);
   } else if (css.equals(ext)) {
 type = text/css;
 path = path(css);
   } else if (flash.equals(ext)) {
 type = application/x-shockwave-flash;
 path = path(flash);
   } else if (text.equals(ext)) {
 type = text/plain;
 path = path(text);
   } else if (js.equals(ext)) {
 type = text/javascript;
 path = path(js);
   } else if (png.equals(ext)) {
 type = image/png;
 path = path(png);
   } else if (html.equals(ext)) {
 type = text/html;
 path = path(html);
   } else if (bmp.equals(ext)) {
 type = image/bmp;
 path = path(bmp);
   } else if (tif.equals(ext)) {
 type = image/tiff;
 path = path(tiff);
   } else if (tiff.equals(ext)) {
 type = image/tiff;
 path = path(tiff);
   }

   String fileName = Classpath.WEB_INF + path + file;

   response.setContentType(type);

   /* E.g. cache = post-check=120,pre-check=240,
 = max-age=86400,private

  post-checks are the time after the initial cache at which you
  have an immediate view without any update.  The time from the
  post to the pre-check is the time whem you get an immediate
  view but an update.  The time after the pre-check time is when
  you get an update prior to a view.
  Cf. 
http://msdn.microsoft.com/workshop/author/perf/perftips.asp#Use_Cache-Control_Extensions
*/http://msdn.microsoft.com/workshop/author/perf/perftips.asp#Use_Cache-Control_Extensions*/

   String cache   = request.getParameter(cache);  /* HTTP 1.1: Numbers
are seconds for cache. */
   String pragma  = request.getParameter(pragma); /* HTTP 1.0: Numbers
are seconds for pragma. */
   String expires = request.getParameter(expires);/* HTTP 1.0: Numbers
are minutes for expires. */

   response.setHeader(Cache-Control,  ((cache   == null) ?
max-age=864,private : cache));
   response.setHeader(Pragma, ((pragma  == null) ?
max-age=864,private : pragma));
   response.setHeader(Expires,((expires == null) ?
144000 : expires));
   response.addHeader(Content-Disposition,(filename= + fileName));

   try {
 FileInputStream fis= new FileInputStream(fileName);
 BufferedInputStream bis= new BufferedInputStream(fis);
 byte[]  bytes  = new byte[bis.available()];
 OutputStreamos = response.getOutputStream();
 bis.read(bytes);
 os.write(bytes);
 os.flush();
 os.close();
 os = null;
 fis.close();
 fis = null;
 bis.close();
 bis = null;
   } catch (IOException ioe) {
 StdOut.log(SiteConstant.ERROR_LOG,ResourceCacheAction: problem file
is:  + fileName + \n + StackTrace.trace(ioe) + \n + ioe.getMessage());
   }

   return null;
 }

 private String path(String fileType) {
   return resource + File.separator + content_type + File.separator +
fileType + File.separator;
 }
} ///;-)

On 5/16/06, M.Liang Liu [EMAIL PROTECTED] wrote:


*Dakota Jack,*your solution is awesome;cool.
Actually I am a freshman to struts;as a result,I need your help to do the
same as you.
**Greatly appreciated if you send your code of the very action
class  which
is to deliver all images or other resources.

Thanks .
On 5/17/06, Dakota Jack [EMAIL PROTECTED] wrote:

 Using standard URLs is just a guarantee that you will keep having these
 sorts of problems.  I use an action to deliver all images, including
 flash,
 or other resources, CSS, etc.  I would suggest you do the same and you
 will
 never have to worry about this recurrent problem again.







--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~


Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-17 Thread Dakota Jack

Here is a use of the previous code, Liu.  CRACKWILLOW is used instead of
the usual .do.

html:img src='cache.CRACKWILLOW?file=flags/great_britain.gif' height='18'
border='0'/

Here is the Struts config.

   action path='/cache'
scope='request' type='
com.crackwillow.struts.action.ResourceCacheAction' /



On 5/16/06, M.Liang Liu [EMAIL PROTECTED] wrote:


*Dakota Jack,*your solution is awesome;cool.
Actually I am a freshman to struts;as a result,I need your help to do the
same as you.
**Greatly appreciated if you send your code of the very action
class  which
is to deliver all images or other resources.

Thanks .
On 5/17/06, Dakota Jack [EMAIL PROTECTED] wrote:

 Using standard URLs is just a guarantee that you will keep having these
 sorts of problems.  I use an action to deliver all images, including
 flash,
 or other resources, CSS, etc.  I would suggest you do the same and you
 will
 never have to worry about this recurrent problem again.







--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~


Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-17 Thread Dakota Jack

That is irrelevant.  You miss the point.  You can run Flash dynamically by
varying the content.  Flash has an action script.  Gainty's point is
useful.  The fact that Flash or JS run locally is irrelevant.  In fact, I
create my Flash on the backend dynamically.

On 5/16/06, Dave Newton [EMAIL PROTECTED] wrote:


Martin Gainty wrote:
 My cursory understanding of Flash is that it runs as a Gateway thru Jrun
Container I invite you to look at
http://www.adobe.com/support/documentation/en/flash/


What? Flash runs locally.

Dave



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





--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~


Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-17 Thread Dakota Jack

Probably correct but a work-intensive solution.  A generic solution would be
better.

On 5/16/06, Bart Busschots [EMAIL PROTECTED] wrote:


Hi,

This is probably a simple problem with relative paths, just do a
view-source on the generated page to see what's going on. That or right
click and 'view image' to see what URL the image is being retrieved
from. I'd wager it won't be what you're expecting and that will be the
cause of your problems.

HTH, Bart.

M.Liang Liu wrote:
 My GOD!
 The same thing  happened when I try to insert an image!!

 Help,please.
 On 5/16/06, M.Liang Liu [EMAIL PROTECTED] wrote:

 Hi,guys!
I am meeting with a problem when I tried to insert a flash to my
 pages.I use Tiles plug-in and it works well.
   I put a flash in my header.jsp and the flash can display as
 expected as
 I typed the very url of this page.But when I put this page in my
 layout.jsp tiles files,nothing displayed.
   I defined the xml file as following:

  !DOCTYPE tiles-definitions PUBLIC -//Apache Software
Foundation//DTD
  Tiles Configuration 1.1//EN 
  http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd;
  tiles-definitions
  definition name=.main.layout path=/tiles/layouts/Layout.jsp
  put name=title value=${title}/
  put name=menutree value=/tiles/menutree.jsp /
  put name=header value= /
  put name=body value=/
  put name=footer value=/tiles/footer.jsp /
  /definition
  definition name=.index extends=.main.layout
  put name=title value=welcome!!! type=string /
  put name=header value=/tiles/header.jsp /
  /definition
  /tiles-definitions
 
 And I opened welcome.do mapping to .index and the pages displayed
 successfully ,except the flash.

 Who can help me?And it is strange,yup?

 Beg your pardon for my poor English.

 Thanks for reading.






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





--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~


Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-17 Thread M.Liang Liu

H,thanks a lot Dakota Jack!

It costs time for me to understand your cool solution to problems of this
kind.

Thank you.



On 5/17/06, Dakota Jack [EMAIL PROTECTED] wrote:


Actually, in a real sense it was.  You have to deliver the flash file to
the
Flash plugin, after all.  That is a problem with knowing how to embed
flash.

On 5/16/06, Dave Newton [EMAIL PROTECTED] wrote:

 Wendy Bossons wrote:
  If you just want to embed a flash movie, the following is an example:

 The original poster was having a (probable) relative path issue; I don't
 think it was a don't-know-how-to-embed-flash problem.

 Dave



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




--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~





--
 http://blog.csdn.net/patriotlml
   Drink   Drank Drunk
http://my.donews.com/patriotlml/


RE: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-17 Thread David G. Friedman
Funny, but it almost seemed like D.J wrote a fancy way of saying this:

If you don't have the Flash plugin installed in your browser then it won't 
work

What a practical answer (add sarcasm here).

Regards,
David / [EMAIL PROTECTED]

On 5/17/06, Dakota Jack [EMAIL PROTECTED] wrote:

 Actually, in a real sense it was.  You have to deliver 
 the flash file to the Flash plugin, after all.  That 
 is a problem with knowing how to embed flash.


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



Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-17 Thread Dave Newton
David G. Friedman wrote:
 If you don't have the Flash plugin installed in your browser then it won't 
 work
   

No no, it's just not knowing the difference between a
technology-independent path issue, which is Struts, and a problem with
the technology itself.

It wouldn't have mattered what was being included, it was a Struts path
resolution/generation misunderstanding.

Dave



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



Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-17 Thread Dakota Jack

Well, you ought to try doing it on your own.  That would really cost
you time.  ///;-)

On 5/17/06, M.Liang Liu [EMAIL PROTECTED] wrote:

H,thanks a lot Dakota Jack!

It costs time for me to understand your cool solution to problems of this
kind.

Thank you.



On 5/17/06, Dakota Jack [EMAIL PROTECTED] wrote:

 Actually, in a real sense it was.  You have to deliver the flash file to
 the
 Flash plugin, after all.  That is a problem with knowing how to embed
 flash.

 On 5/16/06, Dave Newton [EMAIL PROTECTED] wrote:
 
  Wendy Bossons wrote:
   If you just want to embed a flash movie, the following is an example:
 
  The original poster was having a (probable) relative path issue; I don't
  think it was a don't-know-how-to-embed-flash problem.
 
  Dave
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 You can lead a horse to water but you cannot make it float on its back.
 ~Dakota Jack~




--
  http://blog.csdn.net/patriotlml
Drink   Drank Drunk
http://my.donews.com/patriotlml/





--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

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



Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-17 Thread Dakota Jack

Friendman, you are completely missing the boat. Do you know how the
src parameter works in Flash?  Give me a break!  Don't read into my
comments what you might have meant.

On 5/17/06, David G. Friedman [EMAIL PROTECTED] wrote:

Funny, but it almost seemed like D.J wrote a fancy way of saying this:

If you don't have the Flash plugin installed in your browser then it won't 
work

What a practical answer (add sarcasm here).

Regards,
David / [EMAIL PROTECTED]

On 5/17/06, Dakota Jack [EMAIL PROTECTED] wrote:

 Actually, in a real sense it was.  You have to deliver
 the flash file to the Flash plugin, after all.  That
 is a problem with knowing how to embed flash.


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





--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

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



Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread M.Liang Liu

My GOD!
The same thing  happened when I try to insert an image!!

Help,please.
On 5/16/06, M.Liang Liu [EMAIL PROTECTED] wrote:


Hi,guys!
   I am meeting with a problem when I tried to insert a flash to my
pages.I use Tiles plug-in and it works well.
  I put a flash in my header.jsp and the flash can display as expected as
I typed the very url of this page.But when I put this page in my
layout.jsp tiles files,nothing displayed.
  I defined the xml file as following:

 !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD
 Tiles Configuration 1.1//EN 
 http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd;
 tiles-definitions
 definition name=.main.layout path=/tiles/layouts/Layout.jsp
 put name=title value=${title}/
 put name=menutree value=/tiles/menutree.jsp /
 put name=header value= /
 put name=body value=/
 put name=footer value=/tiles/footer.jsp /
 /definition
 definition name=.index extends=.main.layout
 put name=title value=welcome!!! type=string /
 put name=header value=/tiles/header.jsp /
 /definition
 /tiles-definitions

And I opened welcome.do mapping to .index and the pages displayed
successfully ,except the flash.

Who can help me?And it is strange,yup?

Beg your pardon for my poor English.

Thanks for reading.





--
 http://blog.csdn.net/patriotlml
   Drink   Drank Drunk
http://my.donews.com/patriotlml/


Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread Emmanouil Batsis

M.Liang Liu wrote:


My GOD!
The same thing  happened when I try to insert an image!!



* Have you tried accessing the URL of the image directly from your 
browser? What is the response?

* Anything in the logs?

Manos

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



Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread Bart Busschots

Hi,

This is probably a simple problem with relative paths, just do a 
view-source on the generated page to see what's going on. That or right 
click and 'view image' to see what URL the image is being retrieved 
from. I'd wager it won't be what you're expecting and that will be the 
cause of your problems.


HTH, Bart.

M.Liang Liu wrote:

My GOD!
The same thing  happened when I try to insert an image!!

Help,please.
On 5/16/06, M.Liang Liu [EMAIL PROTECTED] wrote:


Hi,guys!
   I am meeting with a problem when I tried to insert a flash to my
pages.I use Tiles plug-in and it works well.
  I put a flash in my header.jsp and the flash can display as 
expected as

I typed the very url of this page.But when I put this page in my
layout.jsp tiles files,nothing displayed.
  I defined the xml file as following:

 !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD
 Tiles Configuration 1.1//EN 
 http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd;
 tiles-definitions
 definition name=.main.layout path=/tiles/layouts/Layout.jsp
 put name=title value=${title}/
 put name=menutree value=/tiles/menutree.jsp /
 put name=header value= /
 put name=body value=/
 put name=footer value=/tiles/footer.jsp /
 /definition
 definition name=.index extends=.main.layout
 put name=title value=welcome!!! type=string /
 put name=header value=/tiles/header.jsp /
 /definition
 /tiles-definitions

And I opened welcome.do mapping to .index and the pages displayed
successfully ,except the flash.

Who can help me?And it is strange,yup?

Beg your pardon for my poor English.

Thanks for reading.








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



Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread Christian Bollmeyer

This is kind of trivial and not related to Tiles at all.
Fact is, your Flash thing or even the image, if you like,
are not found because their URLs are incorrect. Solution
is to specify context-relative URLs like this (JSP 2.0):

img src=${pageContext.request.contextPath}/myImage.jpg

and the like. For older JSP versions, use the c:out or
c:url tags.

HTH,
-- Chris

M.Liang Liu schrieb:


My GOD!
The same thing  happened when I try to insert an image!!

Help,please.
On 5/16/06, M.Liang Liu [EMAIL PROTECTED] wrote:


Hi,guys!
   I am meeting with a problem when I tried to insert a flash to my
pages.I use Tiles plug-in and it works well.
  I put a flash in my header.jsp and the flash can display as expected as
I typed the very url of this page.But when I put this page in my
layout.jsp tiles files,nothing displayed.
  I defined the xml file as following:

 !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD
 Tiles Configuration 1.1//EN 
 http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd;
 tiles-definitions
 definition name=.main.layout path=/tiles/layouts/Layout.jsp
 put name=title value=${title}/
 put name=menutree value=/tiles/menutree.jsp /
 put name=header value= /
 put name=body value=/
 put name=footer value=/tiles/footer.jsp /
 /definition
 definition name=.index extends=.main.layout
 put name=title value=welcome!!! type=string /
 put name=header value=/tiles/header.jsp /
 /definition
 /tiles-definitions

And I opened welcome.do mapping to .index and the pages displayed
successfully ,except the flash.

Who can help me?And it is strange,yup?

Beg your pardon for my poor English.

Thanks for reading.








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



Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread Martin Gainty
Hello Christian
You're probably better off asking on livedocs.macromedia.com
My cursory understanding of Flash is that it runs as a Gateway thru Jrun 
Container I invite you to look at
http://www.adobe.com/support/documentation/en/flash/
Let me know how this works for you,
Viel Gluck,
Martin --
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - 
From: Christian Bollmeyer [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, May 16, 2006 2:52 PM
Subject: Re: I've got a big problem:Can NOT insert flash into jsp---using 
struts 1.1 and Tiles


 This is kind of trivial and not related to Tiles at all.
 Fact is, your Flash thing or even the image, if you like,
 are not found because their URLs are incorrect. Solution
 is to specify context-relative URLs like this (JSP 2.0):
 
 img src=${pageContext.request.contextPath}/myImage.jpg
 
 and the like. For older JSP versions, use the c:out or
 c:url tags.
 
 HTH,
 -- Chris
 
 M.Liang Liu schrieb:
 
 My GOD!
 The same thing  happened when I try to insert an image!!
 
 Help,please.
 On 5/16/06, M.Liang Liu [EMAIL PROTECTED] wrote:

 Hi,guys!
I am meeting with a problem when I tried to insert a flash to my
 pages.I use Tiles plug-in and it works well.
   I put a flash in my header.jsp and the flash can display as expected as
 I typed the very url of this page.But when I put this page in my
 layout.jsp tiles files,nothing displayed.
   I defined the xml file as following:

  !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD
  Tiles Configuration 1.1//EN 
  http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd;
  tiles-definitions
  definition name=.main.layout path=/tiles/layouts/Layout.jsp
  put name=title value=${title}/
  put name=menutree value=/tiles/menutree.jsp /
  put name=header value= /
  put name=body value=/
  put name=footer value=/tiles/footer.jsp /
  /definition
  definition name=.index extends=.main.layout
  put name=title value=welcome!!! type=string /
  put name=header value=/tiles/header.jsp /
  /definition
  /tiles-definitions
 
 And I opened welcome.do mapping to .index and the pages displayed
 successfully ,except the flash.

 Who can help me?And it is strange,yup?

 Beg your pardon for my poor English.

 Thanks for reading.

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


Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread Dave Newton
Martin Gainty wrote:
 My cursory understanding of Flash is that it runs as a Gateway thru Jrun 
 Container I invite you to look at 
 http://www.adobe.com/support/documentation/en/flash/
   

What? Flash runs locally.

Dave



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



Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread Wendy Bossons

If you just want to embed a flash movie, the following is an example:

OBJECT classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354
codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0;
WIDTH=550 HEIGHT=400 id=myMovieName
PARAM NAME=movie VALUE=myFlashMovie.swf
PARAM NAME=quality VALUE=high
PARAM NAME=bgcolor VALUE=#FF
EMBED src=/support/flash/ts/documents/myFlashMovie.swf quality=high bgcolor=#FF 
WIDTH=550 HEIGHT=400
NAME=myMovieName ALIGN= TYPE=application/x-shockwave-flash
PLUGINSPAGE=http://www.macromedia.com/go/getflashplayer;
/EMBED
/OBJECT



Dave Newton wrote:

Martin Gainty wrote:
  

My cursory understanding of Flash is that it runs as a Gateway thru Jrun 
Container I invite you to look at 
http://www.adobe.com/support/documentation/en/flash/
  



What? Flash runs locally.

Dave



-
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]

Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread Dave Newton
Wendy Bossons wrote:
 If you just want to embed a flash movie, the following is an example:

The original poster was having a (probable) relative path issue; I don't
think it was a don't-know-how-to-embed-flash problem.

Dave



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



Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread M.Liang Liu

Thanks a lot for your immediate reply which helped me a lot to resolve this
problem.

The solution *Christian Bollmeyer *provided is just fine;I make the image
display properly;*
**Bart Busschots's *advice is of great useful,I check all my webapp to make
sure all the things go as expected.*

**Wendy Bossons's * code is right in a jsp page---it is the same as
mime.But the flash can NOT display when I put it in a Tiles file,and it is
the real problem I met as Dave Newton pointed out.*

*The solution to flash-problem is* *to name the movie's value you want to
insert as a  context-Relative url as following:
PARAM NAME=movie VALUE=${pageContext.request.contextPath
}/tiles/myFlashMovie.swf

and the code to insert a flash is to be:

object classid=clsid:d27cdb6e-ae6d-11cf-96b8-44455354

codebase=
http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0

width=783 height=90 id=logo align=middle
param name=allowScriptAccess value=sameDomain /
param name=movie 
value=${pageContext.request.contextPath}/tiles/logo.swf
/
param name=quality value=high /
param name=bgcolor value=#ff /
embed src=${pageContext.request.contextPath}/tiles/logo.swf
quality=high bgcolor=#ff width=783 height=90
name=logo
align=middle allowScriptAccess=sameDomain
type=application/x-shockwave-flash
pluginspage=http://www.macromedia.com/go/getflashplayer;
//object



I got it as what I said.And if there is any better way ,please notice me.

Thanks again.


Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread Dakota Jack

Using standard URLs is just a guarantee that you will keep having these
sorts of problems.  I use an action to deliver all images, including flash,
or other resources, CSS, etc.  I would suggest you do the same and you will
never have to worry about this recurrent problem again.

On 5/16/06, M.Liang Liu [EMAIL PROTECTED] wrote:


Hi,guys!
   I am meeting with a problem when I tried to insert a flash to my
pages.Iuse Tiles plug-in and it works well.
  I put a flash in my header.jsp and the flash can display as expected as
I
typed the very url of this page.But when I put this page in my
layout.jsptiles files,nothing displayed.
  I defined the xml file as following:

 !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD
 Tiles Configuration 1.1//EN 
 http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd;
 tiles-definitions
 definition name=.main.layout path=/tiles/layouts/Layout.jsp
 put name=title value=${title}/
 put name=menutree value=/tiles/menutree.jsp /
 put name=header value= /
 put name=body value=/
 put name=footer value=/tiles/footer.jsp /
 /definition
 definition name=.index extends=.main.layout
 put name=title value=welcome!!! type=string /
 put name=header value=/tiles/header.jsp /
 /definition
 /tiles-definitions

And I opened welcome.do mapping to .index and the pages displayed
successfully ,except the flash.

Who can help me?And it is strange,yup?

Beg your pardon for my poor English.

Thanks for reading.





--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~


Re: I've got a big problem:Can NOT insert flash into jsp---using struts 1.1 and Tiles

2006-05-16 Thread M.Liang Liu

*Dakota Jack,*your solution is awesome;cool.
Actually I am a freshman to struts;as a result,I need your help to do the
same as you.
**Greatly appreciated if you send your code of the very action class  which
is to deliver all images or other resources.

Thanks .
On 5/17/06, Dakota Jack [EMAIL PROTECTED] wrote:


Using standard URLs is just a guarantee that you will keep having these
sorts of problems.  I use an action to deliver all images, including
flash,
or other resources, CSS, etc.  I would suggest you do the same and you
will
never have to worry about this recurrent problem again.