When learning about JSP and servlets, I heard about redirect and dispatch. Which of them does Wicket's setResponsePage()
perform?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
setResponsePage(PageName.class) will redirect the browser to the PageName you need to go. Make sure that, you have already mount your Page.class to a given path. For example, in your Application init method, you can mount like this mountPage("/home.html", WelcomePage.class); then in some other page, when you have a need to go to the home page, you just call like this setResponsePage(WelcomePage.class);
What
setResponsePage
does is dependent on a couple of factors: how many times you call setResponsePage, which variant of the setResponsePage you call and what render strategy you use.You can call
setResponsePage
many times during a request. Wicket uses the last one to work with.There are two variants of setResponsePage: with a
Page
instance and with aPage
class andPageParameters
. The latter sends a redirect to a bookmarkable URL to the browser. The former will, depending on the render strategy, either:So the first option is dispatch, the second option is dispatch followed by a redirect, and the third option would be redirect in servlet terms.