How to integrate wicket framework 6.x with plain old jsp

后端 未结 2 634
一个人的身影
一个人的身影 2021-01-16 19:19

I am looking for examples for how to ingrate wicket 6.10 with jsp We have lots of code written in jsp , which is a good code and we want it to be in our wicket 1. applicati

相关标签:
2条回答
  • 2021-01-16 19:52

    the new version of the wicketstuff minis project is supporting the integration of jsp files into wicket pages:

    <dependency>
       <groupId>org.wicketstuff</groupId>
       <artifactId>wicketstuff-minis</artifactId>
       <version>6.17.0</version><!-- or 7.0.0-M3 -->
    </dependency>
    

    Only use the following line in your Wicket-WebApplication:

    getPageSettings().addComponentResolver(new WicketServletAndJSPResolver());
    

    Then you are able to include jsp's like this:

    <wicket:jsp file="/de/test/jspwicket/TestPage.jsp"/>
    

    A documentation can be found in the "wicketstuff-minis-example"-Projekt of the same version.

    kind regards

    Updated information (22.10.2014):

    Since the new SNAPSHOT versions of Wicketstuff the jee integration has been moved to a separate project:

    <dependency>
       <groupId>org.wicketstuff</groupId>
       <artifactId>wicketstuff-jee-web</artifactId>
       <version>6.18.0-SNAPSHOT</version>
       <!-- soon 6.18.0 --><!-- or 7.0.0-SNAPSHOT, soon 7.0.0 -->
    </dependency>
    

    The class name has been changed slightly:

    getPageSettings().addComponentResolver(new JEEWebResolver());
    

    There is also a lot of new stuff to check out like form submit support with el functions / tags.

    The documentation has been moved to the projects wiki page (JEE Web Integration) on github. To enable the SNAPSHOT-Repository refer to the documentation of Wicketstuff.

    Updated information (15.02.2015):

    http://java.dzone.com/articles/integrate-jspjsf-pages-wicket

    kind regards

    0 讨论(0)
  • 2021-01-16 20:04

    To add JSP content to a Wicket page, you can use Include.

    To use Wicket-dependent infrastructure in JSP pages (such as the WebSession and WebApplication instances, or generating URLs for Wicket pages), you can use WicketSessionFilter.

    I don't know if including Wicket content in a JSP page is very advisable, but you may try the WicketTester, calling startPage() or startComponentInPage(), and then getting the resulting HTML with getLastResponseAsString().

    0 讨论(0)
提交回复
热议问题