How about extending Include as follows:
public class LightInclude extends Include {

public LightInclude(String id, String model, ServletRequest request, ServletResponse response) {
      this.request = request;
      this.response = response;
   }

   protected String importUrl(String url) {
       //create a buffer
       Writer writer = new BufferedWriter(new CharArratWriter());
       //create some mockup response
       ServletResponse mockupResponse = new ServletResponse() {
//implement all interface methods by delegating to the original response except for this:
          public PrintWriter getWriter(){
             return new PrintWriter(writer);
          }
       };
//call RequestDispatcher with the mockup response
       //this will write the response to our buffer
       request.getrequestDispatcher(url).include(request, mockupResponse);
//return the content of the buffer
       return writer.toString();
   }
}

I guess some additional polish is required..
Nili

Eelco Hillenius wrote:
That's what I did in the first version(s) of Include. There were
issues with it, which I unfortunately forgot. I never use this
component myself, but if you have good ideas in the form of patches,
I'd be happy to look at them.

Eelco

On 3/29/06, Nili Adoram <[EMAIL PROTECTED]> wrote:
Hi,
Is there an option to use utilize wicket Include without opening a new
connection?
I would like to include the contents of a URL like
RequestDispatcher.include() does, directly into a wicket component.
10x
Nili


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to