Re: Wicket as a front controller ?

2008-02-28 Thread smallufo



 To redirect, try:

 public class P1 extends WebPage {
@Override
protected void onBeforeRender() {
super.onBeforeRender();
throw new RestartResponseException(P2.class);
}

 }


Hi
I want to handle a POST request , and output custom messages , but

In onBeroereRenderer()  , I write the following codes :

HttpServletResponse res = ((WebResponse)
getWebRequestCycle().getResponse()).getHttpServletResponse();
PrintWriter out = res.getWriter();
out.print(responseText);

But wicket seems pre-output HTML's DOCTYPE , that makes the remote site
can't parse...:
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN

I've already deleted the corresponding HTML file.

How to make wicket not pre-output any HTML header/doctype ?


Re: Wicket as a front controller ?

2008-02-28 Thread smallufo
Oops , sorry , I found what went wrong
Because the Server page inherits another Parent Page.
So it output the header of its parent page...


2008/2/29 smallufo [EMAIL PROTECTED]:


 
  To redirect, try:
 
  public class P1 extends WebPage {
 @Override
 protected void onBeforeRender() {
 super.onBeforeRender();
 throw new RestartResponseException(P2.class);
 }
 
  }
 

 Hi
 I want to handle a POST request , and output custom messages , but

 In onBeroereRenderer()  , I write the following codes :

 HttpServletResponse res = ((WebResponse)
 getWebRequestCycle().getResponse()).getHttpServletResponse();
 PrintWriter out = res.getWriter();
 out.print(responseText);

 But wicket seems pre-output HTML's DOCTYPE , that makes the remote site
 can't parse...:
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN

 I've already deleted the corresponding HTML file.

 How to make wicket not pre-output any HTML header/doctype ?



Re: Wicket as a front controller ?

2008-02-25 Thread Kent Tong
smallufo smallufo at gmail.com writes:

 I just need to redirect.
 If bbAuth token is correct , then set correct Wicket Session and redirect to
 proper page.
 If incorrect , then redirect to another page.

To redirect, try:

public class P1 extends WebPage {
@Override
protected void onBeforeRender() {
super.onBeforeRender();
throw new RestartResponseException(P2.class);
}

}
--
Kent Tong
Wicket book with free chapters at http://www.agileskills2.org/EWDW



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket as a front controller ?

2008-02-25 Thread smallufo
Thank you , it's almost done.
But it still have problems :
Calling setResponsePage() at the end of onBeforeRender() not working.
How to solve it ?


2008/2/25, Kent Tong [EMAIL PROTECTED]:

 smallufo smallufo at gmail.com writes:

  I just need to redirect.
  If bbAuth token is correct , then set correct Wicket Session and
 redirect to
  proper page.
  If incorrect , then redirect to another page.


 To redirect, try:

 public class P1 extends WebPage {
 @Override
 protected void onBeforeRender() {
 super.onBeforeRender();
 throw new RestartResponseException(P2.class);
 }

 }



Re: Wicket as a front controller ?

2008-02-25 Thread smallufo
2008/2/26, smallufo [EMAIL PROTECTED]:

 Thank you , it's almost done.
 But it still have problems :
 Calling setResponsePage() at the end of onBeforeRender() not working.
 How to solve it ?

I found the answer .
just add : setRedirect(true);
And it works.


Re: Wicket as a front controller ?

2008-02-24 Thread Kent Tong


smallufo wrote:
 
 Thank you , but I want a (bookmarkable) page without HTML
 Is it possible ?
 

What do you want to output?

-
--
Kent Tong
Wicket tutorials freely available at http://www.agileskills2.org/EWDW
Axis2 tutorials freely available at http://www.agileskills2.org/DWSAA
-- 
View this message in context: 
http://www.nabble.com/Wicket-as-a-front-controller---tp15656646p15664148.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket as a front controller ?

2008-02-24 Thread smallufo
I just need to redirect.
If bbAuth token is correct , then set correct Wicket Session and redirect to
proper page.
If incorrect , then redirect to another page.

If I use pure servlet to implement this , I have to hard code the
redirecting URL , and can only use HttpSession ...


2008/2/24, Kent Tong [EMAIL PROTECTED]:



 smallufo wrote:
 
  Thank you , but I want a (bookmarkable) page without HTML
  Is it possible ?
 


 What do you want to output?


 -
 --
 Kent Tong
 Wicket tutorials freely available at http://www.agileskills2.org/EWDW
 Axis2 tutorials freely available at http://www.agileskills2.org/DWSAA
 --

 View this message in context:
 http://www.nabble.com/Wicket-as-a-front-controller---tp15656646p15664148.html

 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Wicket as a front controller ?

2008-02-24 Thread Maurice Marrink
  If I use pure servlet to implement this , I have to hard code the
  redirecting URL , and can only use HttpSession ...
If you use a filter, placed after the wicket filter, i think you can
use the wicket session and you do not need to redirect because you can
do Session.get().login(.) and happily continue to the page.

Maurice

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket as a front controller ?

2008-02-24 Thread smallufo
Thank you for suggestion.
But I am using Resin 3.0.x as a servlet container.
And wicket 1.3's filter seems not working on Resin 3.0.x
see this thread for details :
http://www.nabble.com/Server-cannot-find--app-url-after-migration-to-1.3-filter-to12998876.html

Therefore , I've stay on WicketServlet



2008/2/24, Maurice Marrink [EMAIL PROTECTED]:

   If I use pure servlet to implement this , I have to hard code the
   redirecting URL , and can only use HttpSession ...

 If you use a filter, placed after the wicket filter, i think you can
 use the wicket session and you do not need to redirect because you can
 do Session.get().login(.) and happily continue to the page.


 Maurice


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Wicket as a front controller ?

2008-02-23 Thread Maurice Marrink
After reading up a bit on yahoo bbAuth, i'm thinking the following will work.
Take the code shown here
http://developer.yahoo.com/java/howto-BBauthJava.html for the servlet
and convert it to a servlet filter.
Then in your web.xml use this new WicketBbAuthFilter for your app
together with the original WicketFilter.
The WicketFilter must be the first to be invoked to setup wicket then
your WicketBbAuthFilter.

Spring can be handled as with any normal wicket application.

Note that the servlet example also checks if someone is already logged
in and if not authenticates them with yahoo.
You could do this too (although i would get that information from the
wicket session) or you can use a separate login page to do the
authentication request for you and let the filter just handle the
response.

Maurice

P.S. this is all from reading just a little bit about bbAuth, so i
can't give you any guarantees ;)

On Sat, Feb 23, 2008 at 9:04 PM, smallufo [EMAIL PROTECTED] wrote:
 Hi .
  I wonder if wicket can act as a servlet front controller ?

  I have a normal wicket webapp , but I need one endpoint to process Yahoo's
  bbAuth's request.
  Yes , I can write normal servlet to process this , but normal servlet lacks
  of spring injection and cannot access to wicket's environment.
  Therefore , I need a specialized wicket endpoint , and that endpoint must
  coexist with my wicket app .
  How to do that ?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket as a front controller ?

2008-02-23 Thread Kent Tong


smallufo wrote:
 
 I have a normal wicket webapp , but I need one endpoint to process
 Yahoo's
 bbAuth's request.
 Yes , I can write normal servlet to process this , but normal servlet
 lacks
 of spring injection and cannot access to wicket's environment.
 

Have you tried using a bookmarkabke page as the endpoint? Something like
http://foo.com/MyApp/app/?wicket:bookmarkablePage=:com.foo.MyApp.MyPage


-
--
Kent Tong
Wicket tutorials freely available at http://www.agileskills2.org/EWDW
Axis2 tutorials freely available at http://www.agileskills2.org/DWSAA
-- 
View this message in context: 
http://www.nabble.com/Wicket-as-a-front-controller---tp15656646p15660420.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket as a front controller ?

2008-02-23 Thread smallufo
Thank you , but I want a (bookmarkable) page without HTML
Is it possible ?

2008/2/24, Kent Tong [EMAIL PROTECTED]:



 smallufo wrote:
 
  I have a normal wicket webapp , but I need one endpoint to process
  Yahoo's
  bbAuth's request.
  Yes , I can write normal servlet to process this , but normal servlet
  lacks
  of spring injection and cannot access to wicket's environment.
 


 Have you tried using a bookmarkabke page as the endpoint? Something like
 http://foo.com/MyApp/app/?wicket:bookmarkablePage=:com.foo.MyApp.MyPage