You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Raghav@directi" <ra...@gmail.com> on 2009/03/12 17:51:10 UTC

Is it possible to have some sort of a controller in wicket

Is it possible to have some sort of a controller in wicket?

i have a situation where i want to map a url to a controller sort of thing
and based on certain conditions i want to redirect the user to different
pages.

for example 

all request to application.com/

should to go a controller and based on different states of session

i want 
if(condition1)
go to page one

if(condition2)
go to page two

and so on..... so in my case the home is not exactly a page but based on
diffent conditions i want to redirect the user to different pages. rite now
i am doing it in a page class whose responsibility is just to
setResponsePage to differnt pages. But i feel it is not a good design....coz
This is not a page at all. it is some sort of a controller.

2) Also is it possible to map the tabs of the tabbed panel to dirrent urls
 like tab1 to application.com/tab1
tab2 to application.com/tab2
tab3 to application.com/tab3

-- 
View this message in context: http://www.nabble.com/Is-it-possible-to-have-some-sort-of-a-controller-in-wicket-tp22480617p22480617.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Is it possible to have some sort of a controller in wicket

Posted by Igor Vaynberg <ig...@gmail.com>.
sure, its called a servlet :)

in 1.5 we are building a more flexible url handling infrastructure
that will let you do such things, in 1.4 its probably the easiest with
a servlet or a filter that redirects to different bookmarkable urls.

-igor

On Thu, Mar 12, 2009 at 9:51 AM, Raghav@directi
<ra...@gmail.com> wrote:
>
> Is it possible to have some sort of a controller in wicket?
>
> i have a situation where i want to map a url to a controller sort of thing
> and based on certain conditions i want to redirect the user to different
> pages.
>
> for example
>
> all request to application.com/
>
> should to go a controller and based on different states of session
>
> i want
> if(condition1)
> go to page one
>
> if(condition2)
> go to page two
>
> and so on..... so in my case the home is not exactly a page but based on
> diffent conditions i want to redirect the user to different pages. rite now
> i am doing it in a page class whose responsibility is just to
> setResponsePage to differnt pages. But i feel it is not a good design....coz
> This is not a page at all. it is some sort of a controller.
>
> 2) Also is it possible to map the tabs of the tabbed panel to dirrent urls
>  like tab1 to application.com/tab1
> tab2 to application.com/tab2
> tab3 to application.com/tab3
>
> --
> View this message in context: http://www.nabble.com/Is-it-possible-to-have-some-sort-of-a-controller-in-wicket-tp22480617p22480617.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


AW: Is it possible to have some sort of a controller in wicket

Posted by Christian Helmbold <ch...@yahoo.de>.
You could use a different Servlet or ServletFilter as the central entry point for requests and redirect to bookmarkable Wicket-Pages. But to access a wicket session via HttpServlet interface from the outside is not exactly was is called elegant.

> 2) Also is it possible to map the tabs of the tabbed panel to dirrent urls
> like tab1 to application.com/tab1
> tab2 to application.com/tab2
> tab3 to application.com/tab3

You can use a tabbed panel with bookmarkable links. Coding state of the tabs into the URLs is a bit tricky and therefor a created a BookmarkableTabbedPanel:

http://code.google.com/p/wicket-skunkworks/source/browse/trunk/wicket-pagetabs/src/main/java/org/wicketskunkworks/tabs/BookmarkableTabbedPanel.java

As far as I have tested it, it works but it is still experimantal.

Regards
Christian


      


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org