import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.MarkupStream;
import org.apache.wicket.markup.html.include.Include;
import org.apache.wicket.model.IModel;
public class MyInclude extends Include {
public MyInclude(String id, IModel<String> model) {
super(id, model);
}
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag
openTag) {
String content = "";
try {
content = importAsString();
} catch (Exception e) {
// ...
}
replaceComponentTagBody(markupStream, openTag, content);
}
}
Thomas Götz
IT Consultant/Freelancer
Kaulardstraße 70a
50354 Hürth/Efferen
phone +49 151 40420203
mail [email protected]
web www.decoded.de
On 02.05.2012 at 17:08 Bruce Pease wrote:
> Sorry, that's Wicket version 4.1.15.
>
>
>
> From: Bruce Pease
> Sent: Wednesday, May 02, 2012 11:06 AM
> To: '[email protected]'
> Subject: Include Component
>
>
>
> Good Morning:
>
>
>
> I am using the Wicket 1.4.14 release in a Tomcat 7 windows server. I am
> using the Include class to render a navigation panel. I would like to
> protect this call on the off chance that the file/url does not exist. Right
> now, the framework throws a file io exception, and the page fails. Is there
> a way to tell the framework to default to an empty panel is the file does not
> exist?
>
>
>
> Thanks,
>
>
>
> Bruce D. Pease
> Technical Team Lead - Web Applications
> CruiseOne(r) <http://www.cruiseone.com/> & Cruises Inc(tm)
> <http://www.cruisesinc.com/>
> 1201 W. Cypress Creek Road, Suite 100
> Fort Lauderdale, FL 33309-1955
> 954-958-3654 (direct) | 954-958-3665 (fax)
> [email protected] <mailto:[email protected]>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]