与路径安装页面,以“/”(mount page with path to “/”)

2019-09-29 05:45发布

我试着去使用mountPage在检票口安装“/” URL作为我的URL的MainPage。

我的WebApplication现在看起来是这样的:

public class WicketApplication extends WebApplication
{
@Override
public Class<HomePage> getHomePage()
{
    return HomePage.class;
}

@Override
public void init()
{
    super.init();
    mountPages();
}

private void mountPages()
{
    mountPage( "/home", HomePage.class );
    mountPage( "/about", AboutCompany.class );
    mountPage( "/prices", Prices.class );
    mountPage( "/gallery", Gallery.class );
    mountPage( "/contact", Contact.class );
    mountPage( "/offer", Offer.class );
}
}

和实际工作很好,但我想“/家庭”转变为“/”,但它搅乱了很多与CSS例如,不transfering,但整个首页来代替。 我怎样才能使这项工作我想要的方式?

Answer 1:

由于检票1.5,你可以申请HomePageMapper ,它的目的是请求映射到根路径。 其实HomePageMapper将被自动检票口为您提供的网页应用WebApplicationClass<? extends Page> getHomePage() Class<? extends Page> getHomePage()使您的主页将被安装到根路径



文章来源: mount page with path to “/”
标签: wicket