Re: Templates & Images
I'm sure there is a way to get at the hashtable used by the templates though and lookup the value. I'm not sure how this would work with an tag without using scriptlets, but you could at least get at them using scriptlets as a first pass. Check out the diagram at: http://www.javaworld.com/javaworld/jw-09-2000/images/jw-0915-jspweb4.gif for information on how the template architecture works. Erik - Original Message - From: "James Maggs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 15, 2001 7:53 AM Subject: Re: Templates & Images > I am using the direct='true' attribute to write the String > 'images/example.gif' to the template file. The trouble is that in the > template file, you cannot embed the tag within the > page attribute. > > I think I'm going to end up with lots of tiny jsp pages containing only > image tags! > > Thanks ayway, > > -James > > - Original Message - > From: "Aaron Ravenberg" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]>; "'James Maggs'" > <[EMAIL PROTECTED]> > Sent: Wednesday, August 15, 2001 3:37 PM > Subject: RE: Templates & Images > > > > Using tag show below is trying to put an image file as > > include into the JSP.template, then asking the JSP.template to compile. > > What you really want to display is the String '/images/example.gif'. So > you > > have to specify a my.JSP that contained the text '/images/example.gif', > > therefore you would need to use a html or have > > the my.JSP file contain the tag. > > > > If you only have a few images that can be displayed and depending on what > > you use to determine to display them, wrapping the tags in > > tags might be a solution. > > > > -Aaron > > > > -Original Message- > > From: James Maggs [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, August 15, 2001 10:00 AM > > To: [EMAIL PROTECTED] > > Subject: Templates & Images > > > > > > Hi There, > > > > I'm working on a Struts powered site right now and have come up against a > > bit of a problem. I'm using the templating tags to give my pages a uniform > > look and feel. However I'd like to be able to insert images into my > > template. I figured the best way would be as follows: > > > > > >/> > > > > > > But this begs the question, how do you insert the content into the src > > attribute of the image tag? I suppose I could put the whole image tag into > > the template but I'd rather avoid embedding content in the above code. > > > > Can anyone suggest a best way forward? > > > > Many thanks, > > > > -James > > > > >
Re: Templates & Images
Just because you're using the Struts framework doesnt mean you always have to use the Struts tags, Am I right?. I have come to some situations where using a normal html tag makes life easier for me (in most cases with tags). I suggest you to better use the tag (from normal Html). Remember, At the end what the Struts tags create are normal Html tags. So If in some cases just normal Html tags are the better way to receive what you expect, I guess its okay. By the way, Will be there a in the future a feature to add a tooltip to the Html elements ('title' property in Html)? I know this feature is not really 'important' , but I use it to do my webapps a little more 'friendly'. Regards. Luis Olivares. Infosphere S.A. de C.V. "Delivering the Power of Information" - (52)8-365-42-88 Ext. 107. [EMAIL PROTECTED] - Original Message - From: "James Maggs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 15, 2001 9:53 AM Subject: Re: Templates & Images > I am using the direct='true' attribute to write the String > 'images/example.gif' to the template file. The trouble is that in the > template file, you cannot embed the tag within the > page attribute. > > I think I'm going to end up with lots of tiny jsp pages containing only > image tags! > > Thanks ayway, > > -James > > - Original Message - > From: "Aaron Ravenberg" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]>; "'James Maggs'" > <[EMAIL PROTECTED]> > Sent: Wednesday, August 15, 2001 3:37 PM > Subject: RE: Templates & Images > > > > Using tag show below is trying to put an image file as > > include into the JSP.template, then asking the JSP.template to compile. > > What you really want to display is the String '/images/example.gif'. So > you > > have to specify a my.JSP that contained the text '/images/example.gif', > > therefore you would need to use a html or have > > the my.JSP file contain the tag. > > > > If you only have a few images that can be displayed and depending on what > > you use to determine to display them, wrapping the tags in > > tags might be a solution. > > > > -Aaron > > > > -Original Message- > > From: James Maggs [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, August 15, 2001 10:00 AM > > To: [EMAIL PROTECTED] > > Subject: Templates & Images > > > > > > Hi There, > > > > I'm working on a Struts powered site right now and have come up against a > > bit of a problem. I'm using the templating tags to give my pages a uniform > > look and feel. However I'd like to be able to insert images into my > > template. I figured the best way would be as follows: > > > > > >/> > > > > > > But this begs the question, how do you insert the content into the src > > attribute of the image tag? I suppose I could put the whole image tag into > > the template but I'd rather avoid embedding content in the above code. > > > > Can anyone suggest a best way forward? > > > > Many thanks, > > > > -James > > > >
Re: Templates & Images
I am using the direct='true' attribute to write the String 'images/example.gif' to the template file. The trouble is that in the template file, you cannot embed the tag within the page attribute. I think I'm going to end up with lots of tiny jsp pages containing only image tags! Thanks ayway, -James - Original Message - From: "Aaron Ravenberg" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "'James Maggs'" <[EMAIL PROTECTED]> Sent: Wednesday, August 15, 2001 3:37 PM Subject: RE: Templates & Images > Using tag show below is trying to put an image file as > include into the JSP.template, then asking the JSP.template to compile. > What you really want to display is the String '/images/example.gif'. So you > have to specify a my.JSP that contained the text '/images/example.gif', > therefore you would need to use a html or have > the my.JSP file contain the tag. > > If you only have a few images that can be displayed and depending on what > you use to determine to display them, wrapping the tags in > tags might be a solution. > > -Aaron > > -Original Message- > From: James Maggs [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 15, 2001 10:00 AM > To: [EMAIL PROTECTED] > Subject: Templates & Images > > > Hi There, > > I'm working on a Struts powered site right now and have come up against a > bit of a problem. I'm using the templating tags to give my pages a uniform > look and feel. However I'd like to be able to insert images into my > template. I figured the best way would be as follows: > > > > > > But this begs the question, how do you insert the content into the src > attribute of the image tag? I suppose I could put the whole image tag into > the template but I'd rather avoid embedding content in the above code. > > Can anyone suggest a best way forward? > > Many thanks, > > -James > >
RE: Templates & Images
Using tag show below is trying to put an image file as include into the JSP.template, then asking the JSP.template to compile. What you really want to display is the String '/images/example.gif'. So you have to specify a my.JSP that contained the text '/images/example.gif', therefore you would need to use a html or have the my.JSP file contain the tag. If you only have a few images that can be displayed and depending on what you use to determine to display them, wrapping the tags in tags might be a solution. -Aaron -Original Message- From: James Maggs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 15, 2001 10:00 AM To: [EMAIL PROTECTED] Subject: Templates & Images Hi There, I'm working on a Struts powered site right now and have come up against a bit of a problem. I'm using the templating tags to give my pages a uniform look and feel. However I'd like to be able to insert images into my template. I figured the best way would be as follows: But this begs the question, how do you insert the content into the src attribute of the image tag? I suppose I could put the whole image tag into the template but I'd rather avoid embedding content in the above code. Can anyone suggest a best way forward? Many thanks, -James