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

橙三吉。 提交于 2019-12-01 13:54:40

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

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().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!