[Wicket-user] Re: Keeping images outside of WEB-INF

2005-11-16 Thread James Yong
Johan Compagner jcompagner at gmail.com writes:

 
 
 jip that is what i meant
 But ofcourse eelco's method is also fine to use.
 
 On 11/15/05, Scott Sauyet lists at sauyet.com wrote:
   = James Yong i_yongbl at yahoo.com.sg
   = Johan Compagner jcompagner at gmail.com  If you can do that then 
i would just have the img tag directly in  the html with a wicket id and 
then you use a label componet which
   only has a attribute modifier to set the src attribute.  That looks to 
me as the cleanest method.  [ ... ]  In the end, I used the label component 
to generate the whole img tag.I don't mean to speak for Johan, but I think the 
suggestion wassomething like this: listItem.add(new Label(file_img).add
(new AttributeModifier(src, + childfolder + / + 
 file.getName())); along with img wicket:id=file_img 
src=placeholder.png alt=/That sounds to me the most Wicketish way of doing 
this.   -- Scott


Hi Johan and Scott,

Sorry for my misinterpretion. Thanks for clearing things up. I didn't expect 
there are so many approaches. keke.

Regards,
james



---
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628alloc_id=16845op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Re: Keeping images outside of WEB-INF

2005-11-15 Thread James Yong
Johan Compagner jcompagner at gmail.com writes:

 
 
 ok you do write in the webapplication directory..
 You do have always complete control over it where youre webapp will be
 installed on? And what kind of application server is used?
 Because you do know that writeable access isn't guarenteed? Or that it is 
even a directory at all?
 Application servers could just use the war directly without extracting it.
Hi Johan,

Thank you for the reply ;-)

Sorry, that I didn't reply you the 1st time.

Yes, I have complete control over the server. I am using Tomcat as the 
application server.


 If you can do that then i would just have the img tag directly in the html
 With a wicket id and then you use a label componet which only has a attribute 
modifier to set the src attribute.
 That looks to me as the cleanest method.

Not sure if you mean the following.


I have tried just outputting the image filename by using the tag below
td width=200img src='span wicket:id=file_img/'//td

But it gives the following result:
td width=200'//td


Then I rewrote it to the following:
td width=200img src='span wicket:id=file_img/span'//td

But it generates this error message:
Tag 'td width=200' (line 37, column 10) has a mismatched close tag 
at '/span'(line 37, column 63) ..


In the end, I used the label component to generate the whole img tag.

-James




---
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628alloc_id=16845op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Re: Keeping images outside of WEB-INF

2005-11-15 Thread James Yong
Eelco Hillenius eelco.hillenius at gmail.com writes:



 
 Or use
 
 public class SimpleImage extends WebComponent {
 
   public SimpleImage(String id, String imgSrc) {
   super(id, new Model(imgSrc));
   }
 
   public SimpleImage(String id, IModel imgSrcModel) {
   super(id, imgSrcModel);
   }
 
   protected void onComponentTag(ComponentTag tag) {
   tag.getAttributes().put(src, getModelObjectAsString());
   }
 }
 
 Eelco
 
Hi Eelco,

Seems good. I was hoping for a solution done in the wicket way.
Will try it ;-)

Thanks.



---
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628alloc_id=16845op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: Keeping images outside of WEB-INF

2005-11-15 Thread Scott Sauyet

 = James Yong [EMAIL PROTECTED]
 = Johan Compagner jcompagner at gmail.com

 If you can do that then i would just have the img tag directly in 
 the html with a wicket id and then you use a label componet which

 only has a attribute modifier to set the src attribute.
 That looks to me as the cleanest method.
 [ ... ]
 In the end, I used the label component to generate the whole img tag.

I don't mean to speak for Johan, but I think the suggestion was 
something like this:


listItem.add(new Label(file_img).add(new AttributeModifier(src, 
 + childfolder + / + file.getName()));


along with

img wicket:id=file_img src=placeholder.png alt=/

That sounds to me the most Wicketish way of doing this.

  -- Scott



---
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628alloc_id=16845op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: Keeping images outside of WEB-INF

2005-11-15 Thread Johan Compagner
jip that is what i meant
But ofcourse eelco's method is also fine to use.On 11/15/05, Scott Sauyet [EMAIL PROTECTED] wrote:
  = James Yong [EMAIL PROTECTED]
  = Johan Compagner jcompagner at gmail.com  If you can do that then i would just have the img tag directly in  the html with a wicket id and then you use a label componet which
  only has a attribute modifier to set the src attribute.  That looks to me as the cleanest method.  [ ... ]  In the end, I used the label component to generate the whole img tag.
I don't mean to speak for Johan, but I think the suggestion wassomething like this: listItem.add(new Label(file_img).add(new AttributeModifier(src, + childfolder + / + 
file.getName())); along with img wicket:id=file_img src="" alt=/That sounds to me the most Wicketish way of doing this. -- Scott
---This SF.Net email is sponsored by the JBoss Inc.Get Certified TodayRegister for a JBoss Training Course.Free Certification Examfor All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628alloc_id=16845op=click___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user



Re: [Wicket-user] Re: Keeping images outside of WEB-INF

2005-11-15 Thread Eelco Hillenius
Although that shouldn't be a label as there is no body to replace.
Just a WebMarkupContainer, or in this case even better a WebComponent
suffices.

Eelco


On 11/15/05, Scott Sauyet [EMAIL PROTECTED] wrote:
   = James Yong [EMAIL PROTECTED]
   = Johan Compagner jcompagner at gmail.com

   If you can do that then i would just have the img tag directly in
   the html with a wicket id and then you use a label componet which
   only has a attribute modifier to set the src attribute.
   That looks to me as the cleanest method.
   [ ... ]
   In the end, I used the label component to generate the whole img tag.

 I don't mean to speak for Johan, but I think the suggestion was
 something like this:

  listItem.add(new Label(file_img).add(new AttributeModifier(src,
  + childfolder + / + file.getName()));

  along with

  img wicket:id=file_img src=placeholder.png alt=/

 That sounds to me the most Wicketish way of doing this.

-- Scott



 ---
 This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
 Register for a JBoss Training Course.  Free Certification Exam
 for All Training Attendees Through End of 2005. For more info visit:
 http://ads.osdn.com/?ad_id=7628alloc_id=16845op=click
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28alloc_id845op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Re: Keeping images outside of WEB-INF

2005-11-14 Thread James Yong
Johan Compagner jcompagner at gmail.com writes:

 
 
 Of course you save youre files to a server you have to know the folder where 
you have write access.
 Then you can load them from that location just as fine as reading them from a 
database.
 
Hi,

I used a label to generate the img tag. It works for me. But I am not sure if 
there is a more correct way to do. Any comments?

listItem.add(new Label(file_img, img src=' + childfolder + / + 
file.getName() +  ' /).setEscapeModelStrings(false).setRenderBodyOnly(true));

Regards,
james




---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: Keeping images outside of WEB-INF

2005-11-14 Thread Juergen Donnerstag
Another option could be to use Image and override onComponentTag

Juergen

On 11/14/05, James Yong [EMAIL PROTECTED] wrote:
 Johan Compagner jcompagner at gmail.com writes:

 
 
  Of course you save youre files to a server you have to know the folder where
 you have write access.
  Then you can load them from that location just as fine as reading them from 
  a
 database.
 
 Hi,

 I used a label to generate the img tag. It works for me. But I am not sure if
 there is a more correct way to do. Any comments?

 listItem.add(new Label(file_img, img src=' + childfolder + / +
 file.getName() +  ' 
 /).setEscapeModelStrings(false).setRenderBodyOnly(true));

 Regards,
 james




 ---
 SF.Net email is sponsored by:
 Tame your development challenges with Apache's Geronimo App Server. Download
 it for free - -and be entered to win a 42 plasma tv or your very own
 Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: Keeping images outside of WEB-INF

2005-11-14 Thread Eelco Hillenius
Or use

public class SimpleImage extends WebComponent {

public SimpleImage(String id, String imgSrc) {
super(id, new Model(imgSrc));
}

public SimpleImage(String id, IModel imgSrcModel) {
super(id, imgSrcModel);
}

protected void onComponentTag(ComponentTag tag) {
tag.getAttributes().put(src, getModelObjectAsString());
}
}

Eelco


On 11/14/05, Johan Compagner [EMAIL PROTECTED] wrote:
 ok you do write in the webapplication directory..
  You do have always complete control over it where youre webapp will be
 installed on? And what kind of application server is used?
  Because you do know that writeable access isn't guarenteed? Or that it is
 even a directory at all?
  Application servers could just use the war directly without extracting it.

  If you can do that then i would just have the img tag directly in the
 html
  With a wicket id and then you use a label componet which only has a
 attribute modifier to set the src attribute.
  That looks to me as the cleanest method.




 On 11/14/05, James Yong [EMAIL PROTECTED] wrote:
  Johan Compagner jcompagner at gmail.com writes:
 
  
  
   Of course you save youre files to a server you have to know the folder
 where
  you have write access.
   Then you can load them from that location just as fine as reading them
 from a
  database.
  
  Hi,
 
  I used a label to generate the img tag. It works for me. But I am not sure
 if
  there is a more correct way to do. Any comments?
 
  listItem.add(new Label(file_img, img src=' + childfolder + / +
  file.getName() +  '
 /).setEscapeModelStrings(false).setRenderBodyOnly(true));
 
  Regards,
  james
 
 
 
 
  ---
  SF.Net email is sponsored by:
  Tame your development challenges with Apache's Geronimo App Server.
 Download
  it for free - -and be entered to win a 42 plasma tv or your very own
  Sony(tm)PSP.  Click here to play:
 http://sourceforge.net/geronimo.php
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 




---
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28alloc_id845op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user