Re: Revisited: How to mount a form?

2008-03-12 Thread Martijn Dashorst
You can't mount a form. Only bookmarkable pages can be mounted.

Martijn

On 3/12/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Hi,

  I'm trying to mount forms in my wicket application more appropiate
  URLs. For example I want to replace this:
  
 action=../?wicket:interface=:3:registerpanel:registerForm::IFormSubmitListener::

  with something like this (I'm not sure yet if the version parameter is
  necessary, or whatever that is):
  action=../register/form/?version=3

  What I have so far is this:

  In Application#init: mount(new FormMount(/register/action/,
  RegisterPanel.RegisterForm.class));

  public class FormMount extends AbstractRequestTargetUrlCodingStrategy {

 private final Class? extends Form formClass;

 public FormMount(String mountPath, Class? extends Form formClass) {
 super(mountPath);
 this.formClass = formClass;
 }

 public IRequestTarget decode(RequestParameters requestParameters) {
 return null;
 }

 public CharSequence encode(IRequestTarget requestTarget) {
 return null;
 }

 public boolean matches(IRequestTarget requestTarget) {
 if (requestTarget instanceof IListenerInterfaceRequestTarget) 
 {
 IListenerInterfaceRequestTarget target =
  (IListenerInterfaceRequestTarget) requestTarget;
 return 
 target.getTarget().getClass().equals(formClass);
 }
 return false;
 }

  }

  Now, I have no idea how to write the encode and decode
  implementations. The existing implementations are all non-trivial and
  I can't find a way to instantiate the appropiate IRequestTarget.

  Thanks for any hints
  Jörn

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




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Revisited: How to mount a form?

2008-03-12 Thread Jörn Zaefferer
Hi,

I'm trying to mount forms in my wicket application more appropiate
URLs. For example I want to replace this:
action=../?wicket:interface=:3:registerpanel:registerForm::IFormSubmitListener::

with something like this (I'm not sure yet if the version parameter is
necessary, or whatever that is):
action=../register/form/?version=3

What I have so far is this:

In Application#init: mount(new FormMount(/register/action/,
RegisterPanel.RegisterForm.class));

public class FormMount extends AbstractRequestTargetUrlCodingStrategy {

private final Class? extends Form formClass;

public FormMount(String mountPath, Class? extends Form formClass) {
super(mountPath);
this.formClass = formClass;
}

public IRequestTarget decode(RequestParameters requestParameters) {
return null;
}

public CharSequence encode(IRequestTarget requestTarget) {
return null;
}

public boolean matches(IRequestTarget requestTarget) {
if (requestTarget instanceof IListenerInterfaceRequestTarget) {
IListenerInterfaceRequestTarget target =
(IListenerInterfaceRequestTarget) requestTarget;
return target.getTarget().getClass().equals(formClass);
}
return false;
}

}

Now, I have no idea how to write the encode and decode
implementations. The existing implementations are all non-trivial and
I can't find a way to instantiate the appropiate IRequestTarget.

Thanks for any hints
Jörn

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



Re: Revisited: How to mount a form?

2008-03-12 Thread Jörn Zaefferer
That is not an acceptable answer. And from what I've seen, Wickets
RequestCodingStrategy-architecture allows you to mount forms just as
well - its just not exactly easy.

Any others?

On Wed, Mar 12, 2008 at 10:14 AM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
 You can't mount a form. Only bookmarkable pages can be mounted.

  Martijn



  On 3/12/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
   Hi,
  
I'm trying to mount forms in my wicket application more appropiate
URLs. For example I want to replace this:

 action=../?wicket:interface=:3:registerpanel:registerForm::IFormSubmitListener::
  
with something like this (I'm not sure yet if the version parameter is
necessary, or whatever that is):
action=../register/form/?version=3
  
What I have so far is this:
  
In Application#init: mount(new FormMount(/register/action/,
RegisterPanel.RegisterForm.class));
  
public class FormMount extends AbstractRequestTargetUrlCodingStrategy {
  
   private final Class? extends Form formClass;
  
   public FormMount(String mountPath, Class? extends Form 
 formClass) {
   super(mountPath);
   this.formClass = formClass;
   }
  
   public IRequestTarget decode(RequestParameters requestParameters) {
   return null;
   }
  
   public CharSequence encode(IRequestTarget requestTarget) {
   return null;
   }
  
   public boolean matches(IRequestTarget requestTarget) {
   if (requestTarget instanceof 
 IListenerInterfaceRequestTarget) {
   IListenerInterfaceRequestTarget target =
(IListenerInterfaceRequestTarget) requestTarget;
   return 
 target.getTarget().getClass().equals(formClass);
   }
   return false;
   }
  
}
  
Now, I have no idea how to write the encode and decode
implementations. The existing implementations are all non-trivial and
I can't find a way to instantiate the appropiate IRequestTarget.
  
Thanks for any hints
Jörn
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  


  --
  Buy Wicket in Action: http://manning.com/dashorst
  Apache Wicket 1.3.1 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



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



Re: Revisited: How to mount a form?

2008-03-12 Thread Jay Hogan
Jörn,

Sorry the answer is not acceptable to you but that is the correct answer. A
Form (i.e. org.apache.wicket.markup.html.form.Form or a subclass of such)
cannot be rendered unless it is added to a WebPage. Sorry, that is just how
Wicket works. I would suggest that you read the Getting Started guide on the
wiki (http://cwiki.apache.org/WICKET/newuserguide.html) for further
information.

Jay

On Wed, Mar 12, 2008 at 5:23 AM, Jörn Zaefferer 
[EMAIL PROTECTED] wrote:

 That is not an acceptable answer. And from what I've seen, Wickets
 RequestCodingStrategy-architecture allows you to mount forms just as
 well - its just not exactly easy.

 Any others?

 On Wed, Mar 12, 2008 at 10:14 AM, Martijn Dashorst
 [EMAIL PROTECTED] wrote:
  You can't mount a form. Only bookmarkable pages can be mounted.
 
   Martijn
 
 
 
   On 3/12/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
Hi,
   
 I'm trying to mount forms in my wicket application more appropiate
 URLs. For example I want to replace this:
   
  
 action=../?wicket:interface=:3:registerpanel:registerForm::IFormSubmitListener::
   
 with something like this (I'm not sure yet if the version parameter
 is
 necessary, or whatever that is):
 action=../register/form/?version=3
   
 What I have so far is this:
   
 In Application#init: mount(new FormMount(/register/action/,
 RegisterPanel.RegisterForm.class));
   
 public class FormMount extends
 AbstractRequestTargetUrlCodingStrategy {
   
private final Class? extends Form formClass;
   
public FormMount(String mountPath, Class? extends Form
 formClass) {
super(mountPath);
this.formClass = formClass;
}
   
public IRequestTarget decode(RequestParameters
 requestParameters) {
return null;
}
   
public CharSequence encode(IRequestTarget requestTarget) {
return null;
}
   
public boolean matches(IRequestTarget requestTarget) {
if (requestTarget instanceof
 IListenerInterfaceRequestTarget) {
IListenerInterfaceRequestTarget target =
 (IListenerInterfaceRequestTarget) requestTarget;
return target.getTarget
 ().getClass().equals(formClass);
}
return false;
}
   
 }
   
 Now, I have no idea how to write the encode and decode
 implementations. The existing implementations are all non-trivial
 and
 I can't find a way to instantiate the appropiate IRequestTarget.
   
 Thanks for any hints
 Jörn
   
   
  -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
   
   
 
 
   --
   Buy Wicket in Action: http://manning.com/dashorst
   Apache Wicket 1.3.1 is released
   Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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




-- 

Computer Science: solving today's problems tomorrow.


Re: Revisited: How to mount a form?

2008-03-12 Thread Jörn Zaefferer
Jay: I didn't ask for rendering a form without a page - I just want to
control the url in the form's action attribute.

Johan: I can mount a page, but that doesn't affect the
action-attribute of the form at all.

I need to make it non-trivial for an attacker to find out which web
framework I'm using. Currently the form-urls make it way too obvious
that Wicket is in charge. The same is true for ILinkListeners.

If this really isn't possible at all, I'll most likely have to drop
Wicket once we've got the prototype ready. I really hope that isn't
necessary, there is too much good stuff in Wicket.

I still think that WebApplication's mount-method is the way to go, I'd
just need a bit of help to get the encoding and decoding implemented.

Thanks all!
Jörn

On Wed, Mar 12, 2008 at 10:37 AM, Johan Compagner [EMAIL PROTECTED] wrote:
 Forms point back to the page. So the url that is generated for the form is
  the page its url
  so you have to mount the page where the form is on

  And if you want a nice url you could try to use HybridUrlEncoding

  But why do you want nice url for forms? They are just in the markup
  they will not show up (normally) in the url bar

  johan



  On Wed, Mar 12, 2008 at 10:23 AM, Jörn Zaefferer 


 [EMAIL PROTECTED] wrote:

   That is not an acceptable answer. And from what I've seen, Wickets
   RequestCodingStrategy-architecture allows you to mount forms just as
   well - its just not exactly easy.
  
   Any others?
  
   On Wed, Mar 12, 2008 at 10:14 AM, Martijn Dashorst
   [EMAIL PROTECTED] wrote:
You can't mount a form. Only bookmarkable pages can be mounted.
   
 Martijn
   
   
   
 On 3/12/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
  Hi,
 
   I'm trying to mount forms in my wicket application more appropiate
   URLs. For example I want to replace this:
 

 action=../?wicket:interface=:3:registerpanel:registerForm::IFormSubmitListener::
 
   with something like this (I'm not sure yet if the version parameter
   is
   necessary, or whatever that is):
   action=../register/form/?version=3
 
   What I have so far is this:
 
   In Application#init: mount(new FormMount(/register/action/,
   RegisterPanel.RegisterForm.class));
 
   public class FormMount extends
   AbstractRequestTargetUrlCodingStrategy {
 
  private final Class? extends Form formClass;
 
  public FormMount(String mountPath, Class? extends Form
   formClass) {
  super(mountPath);
  this.formClass = formClass;
  }
 
  public IRequestTarget decode(RequestParameters
   requestParameters) {
  return null;
  }
 
  public CharSequence encode(IRequestTarget requestTarget) {
  return null;
  }
 
  public boolean matches(IRequestTarget requestTarget) {
  if (requestTarget instanceof
   IListenerInterfaceRequestTarget) {
  IListenerInterfaceRequestTarget target =
   (IListenerInterfaceRequestTarget) requestTarget;
  return target.getTarget
   ().getClass().equals(formClass);
  }
  return false;
  }
 
   }
 
   Now, I have no idea how to write the encode and decode
   implementations. The existing implementations are all non-trivial
   and
   I can't find a way to instantiate the appropiate IRequestTarget.
 
   Thanks for any hints
   Jörn
 
 
-
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 
   
   
 --
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.1 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
   
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  


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



Re: Revisited: How to mount a form?

2008-03-12 Thread James Carman
My simple form's action looks like:

action=?x=ddw0qAw21grCPRao*Ubfef2Sc3qqyFsw0T9XGN5CArkF*CTRiwidzg

when I use that along with the CachingSunJceCryptFactory.



On 3/12/08, James Carman [EMAIL PROTECTED] wrote:
 Have you looked at:

  org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy


  On 3/12/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:

  Hi,
  
I'm trying to mount forms in my wicket application more appropiate
URLs. For example I want to replace this:

 action=../?wicket:interface=:3:registerpanel:registerForm::IFormSubmitListener::
  
with something like this (I'm not sure yet if the version parameter is
necessary, or whatever that is):
action=../register/form/?version=3
  
What I have so far is this:
  
In Application#init: mount(new FormMount(/register/action/,
RegisterPanel.RegisterForm.class));
  
public class FormMount extends AbstractRequestTargetUrlCodingStrategy {
  
   private final Class? extends Form formClass;
  
   public FormMount(String mountPath, Class? extends Form 
 formClass) {
   super(mountPath);
   this.formClass = formClass;
   }
  
   public IRequestTarget decode(RequestParameters requestParameters) {
   return null;
   }
  
   public CharSequence encode(IRequestTarget requestTarget) {
   return null;
   }
  
   public boolean matches(IRequestTarget requestTarget) {
   if (requestTarget instanceof 
 IListenerInterfaceRequestTarget) {
   IListenerInterfaceRequestTarget target =
(IListenerInterfaceRequestTarget) requestTarget;
   return 
 target.getTarget().getClass().equals(formClass);
   }
   return false;
   }
  
}
  
Now, I have no idea how to write the encode and decode
implementations. The existing implementations are all non-trivial and
I can't find a way to instantiate the appropiate IRequestTarget.
  
Thanks for any hints
Jörn
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  


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



Re: Revisited: How to mount a form?

2008-03-12 Thread Johan Compagner
Forms point back to the page. So the url that is generated for the form is
the page its url
so you have to mount the page where the form is on

And if you want a nice url you could try to use HybridUrlEncoding

But why do you want nice url for forms? They are just in the markup
they will not show up (normally) in the url bar

johan



On Wed, Mar 12, 2008 at 10:23 AM, Jörn Zaefferer 
[EMAIL PROTECTED] wrote:

 That is not an acceptable answer. And from what I've seen, Wickets
 RequestCodingStrategy-architecture allows you to mount forms just as
 well - its just not exactly easy.

 Any others?

 On Wed, Mar 12, 2008 at 10:14 AM, Martijn Dashorst
 [EMAIL PROTECTED] wrote:
  You can't mount a form. Only bookmarkable pages can be mounted.
 
   Martijn
 
 
 
   On 3/12/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
Hi,
   
 I'm trying to mount forms in my wicket application more appropiate
 URLs. For example I want to replace this:
   
  
 action=../?wicket:interface=:3:registerpanel:registerForm::IFormSubmitListener::
   
 with something like this (I'm not sure yet if the version parameter
 is
 necessary, or whatever that is):
 action=../register/form/?version=3
   
 What I have so far is this:
   
 In Application#init: mount(new FormMount(/register/action/,
 RegisterPanel.RegisterForm.class));
   
 public class FormMount extends
 AbstractRequestTargetUrlCodingStrategy {
   
private final Class? extends Form formClass;
   
public FormMount(String mountPath, Class? extends Form
 formClass) {
super(mountPath);
this.formClass = formClass;
}
   
public IRequestTarget decode(RequestParameters
 requestParameters) {
return null;
}
   
public CharSequence encode(IRequestTarget requestTarget) {
return null;
}
   
public boolean matches(IRequestTarget requestTarget) {
if (requestTarget instanceof
 IListenerInterfaceRequestTarget) {
IListenerInterfaceRequestTarget target =
 (IListenerInterfaceRequestTarget) requestTarget;
return target.getTarget
 ().getClass().equals(formClass);
}
return false;
}
   
 }
   
 Now, I have no idea how to write the encode and decode
 implementations. The existing implementations are all non-trivial
 and
 I can't find a way to instantiate the appropiate IRequestTarget.
   
 Thanks for any hints
 Jörn
   
   
  -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
   
   
 
 
   --
   Buy Wicket in Action: http://manning.com/dashorst
   Apache Wicket 1.3.1 is released
   Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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




Re: Revisited: How to mount a form?

2008-03-12 Thread James Carman
Have you looked at:

org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy

On 3/12/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Hi,

  I'm trying to mount forms in my wicket application more appropiate
  URLs. For example I want to replace this:
  
 action=../?wicket:interface=:3:registerpanel:registerForm::IFormSubmitListener::

  with something like this (I'm not sure yet if the version parameter is
  necessary, or whatever that is):
  action=../register/form/?version=3

  What I have so far is this:

  In Application#init: mount(new FormMount(/register/action/,
  RegisterPanel.RegisterForm.class));

  public class FormMount extends AbstractRequestTargetUrlCodingStrategy {

 private final Class? extends Form formClass;

 public FormMount(String mountPath, Class? extends Form formClass) {
 super(mountPath);
 this.formClass = formClass;
 }

 public IRequestTarget decode(RequestParameters requestParameters) {
 return null;
 }

 public CharSequence encode(IRequestTarget requestTarget) {
 return null;
 }

 public boolean matches(IRequestTarget requestTarget) {
 if (requestTarget instanceof IListenerInterfaceRequestTarget) 
 {
 IListenerInterfaceRequestTarget target =
  (IListenerInterfaceRequestTarget) requestTarget;
 return 
 target.getTarget().getClass().equals(formClass);
 }
 return false;
 }

  }

  Now, I have no idea how to write the encode and decode
  implementations. The existing implementations are all non-trivial and
  I can't find a way to instantiate the appropiate IRequestTarget.

  Thanks for any hints
  Jörn

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



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



Re: Revisited: How to mount a form?

2008-03-12 Thread Matej Knopp
You can just make a fork of WebRequestCodingStrategy and change the constants.

-Matej

On Wed, Mar 12, 2008 at 10:46 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:
 Jay: I didn't ask for rendering a form without a page - I just want to
  control the url in the form's action attribute.

  Johan: I can mount a page, but that doesn't affect the
  action-attribute of the form at all.

  I need to make it non-trivial for an attacker to find out which web
  framework I'm using. Currently the form-urls make it way too obvious
  that Wicket is in charge. The same is true for ILinkListeners.

  If this really isn't possible at all, I'll most likely have to drop
  Wicket once we've got the prototype ready. I really hope that isn't
  necessary, there is too much good stuff in Wicket.

  I still think that WebApplication's mount-method is the way to go, I'd
  just need a bit of help to get the encoding and decoding implemented.

  Thanks all!
  Jörn



  On Wed, Mar 12, 2008 at 10:37 AM, Johan Compagner [EMAIL PROTECTED] wrote:
   Forms point back to the page. So the url that is generated for the form is
the page its url
so you have to mount the page where the form is on
  
And if you want a nice url you could try to use HybridUrlEncoding
  
But why do you want nice url for forms? They are just in the markup
they will not show up (normally) in the url bar
  
johan
  
  
  
On Wed, Mar 12, 2008 at 10:23 AM, Jörn Zaefferer 
  
  
   [EMAIL PROTECTED] wrote:
  
 That is not an acceptable answer. And from what I've seen, Wickets
 RequestCodingStrategy-architecture allows you to mount forms just as
 well - its just not exactly easy.

 Any others?

 On Wed, Mar 12, 2008 at 10:14 AM, Martijn Dashorst
 [EMAIL PROTECTED] wrote:
  You can't mount a form. Only bookmarkable pages can be mounted.
 
   Martijn
 
 
 
   On 3/12/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
Hi,
   
 I'm trying to mount forms in my wicket application more appropiate
 URLs. For example I want to replace this:
   
  
 action=../?wicket:interface=:3:registerpanel:registerForm::IFormSubmitListener::
   
 with something like this (I'm not sure yet if the version 
 parameter
 is
 necessary, or whatever that is):
 action=../register/form/?version=3
   
 What I have so far is this:
   
 In Application#init: mount(new FormMount(/register/action/,
 RegisterPanel.RegisterForm.class));
   
 public class FormMount extends
 AbstractRequestTargetUrlCodingStrategy {
   
private final Class? extends Form formClass;
   
public FormMount(String mountPath, Class? extends Form
 formClass) {
super(mountPath);
this.formClass = formClass;
}
   
public IRequestTarget decode(RequestParameters
 requestParameters) {
return null;
}
   
public CharSequence encode(IRequestTarget requestTarget) {
return null;
}
   
public boolean matches(IRequestTarget requestTarget) {
if (requestTarget instanceof
 IListenerInterfaceRequestTarget) {
IListenerInterfaceRequestTarget target =
 (IListenerInterfaceRequestTarget) requestTarget;
return target.getTarget
 ().getClass().equals(formClass);
}
return false;
}
   
 }
   
 Now, I have no idea how to write the encode and decode
 implementations. The existing implementations are all non-trivial
 and
 I can't find a way to instantiate the appropiate IRequestTarget.
   
 Thanks for any hints
 Jörn
   
   
  -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
   
   
 
 
   --
   Buy Wicket in Action: http://manning.com/dashorst
   Apache Wicket 1.3.1 is released
   Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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


  

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





-- 
Resizable and