Re: Nicer URLs in Wicket

2007-07-30 Thread Korbinian Bachl

Hi Matej,

looks really great! - One thing I dont understand ist:

You wrote:
* The redirect is necessary for pages with AJAX stuff, so that the
   page instance is preserved on reload (otherwise with bookmarkable URL
   new instance of page would be created on every reload, which discards
   the AJAX changes)

So, the only pages that need this, are AJAX ones, right? - So why do we 
have this behaviou for all pages? - Wouldnt it be possible to have this 
redirect only for pages containing AJAX? (Should be possible to find 
out, shouldn't it ?)


Beside the char: cant you make the seperate sequence choicable by the 
webapp-programer? - as this was/ is IMHO the biggest pain with the old 
interface:wicket thing - if sb. could have made easily 
interface:MyCompany or sth. like that this wouldnt be a problem for 
many - as the URL at least would have looked CI-like.


Best Regards

Korbinian


Matej Knopp schrieb:

The example is also online:
http://wicketstuff.org/wicket13/ajax/

So far I'm not sure what should the default look like
/mount/point|3|
or
/mount/point(3)
or maybe something else?

Does anyone have an opinion about this?

-Matej


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



Switching to SSL for SignIn page

2007-07-30 Thread shumbola

I want to be able to switch to SSL when SignIn page showed to a user  and if
successful, then switch back to normal HTTP protocol. I'm using wicket-1.3.

In my Application class I've come up with the following:

protected IRequestCycleProcessor newRequestCycleProcessor() {
return new WebRequestCycleProcessor() {
public void respond(RequestCycle requestCycle) {
IRequestTarget target = requestCycle.getRequestTarget();
WebResponse response = (WebResponse)
requestCycle.getResponse();
WebRequest request = (WebRequest) requestCycle.getRequest();
HttpServletRequest httpServletRequest =
request.getHttpServletRequest();
if(target instanceof BookmarkablePageRequestTarget) {
if(((BookmarkablePageRequestTarget)target).getPage()
instanceof SignIn 
!httpServletRequest.isSecure())
{
StringBuffer url = new StringBuffer(https://;);
url.append(httpServletRequest.getServerName());
url.append(:).append(HTTPS_PORT);
String s =
RequestCycle.get().urlFor(target).toString();
url.append(/app/).append(s);
response.redirect(url.toString());
}
else if
(((BookmarkablePageRequestTarget)target).getPage() instanceof Home 
httpServletRequest.isSecure()) {
StringBuffer url = new StringBuffer(http://;);
url.append(httpServletRequest.getServerName());
url.append(:).append(HTTP_PORT);
String s =
RequestCycle.get().urlFor(target).toString();
url.append(/app/).append(s);
response.redirect(url.toString());
} else
target.respond(requestCycle);
}
else
target.respond(requestCycle);
}
};

}

It kinda works but I'm not sure if I'm doing it right way. And I'm not sure
if it is bug free. I dont fully understand how wicket requestcycle works, so
I need your help there.

Thanks.
shumbola


-- 
View this message in context: 
http://www.nabble.com/Switching-to-SSL-for-SignIn-page-tf4169495.html#a11861892
Sent from the Wicket Users New mailing list archive at Nabble.com.


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



loads of Internal error cloning object

2007-07-30 Thread Dipu Seminlal
Hi all,


I am seeing loads of Internal error cloning object error in the log files.

I am running on DEPLOYMENT mode and also  i have set
get().getDebugSettings().setSerializeSessionAttributes(false);
( which is not really required when i am on Deployment mode ) in the
application class.

I have an Iframe on different site pointing to my application like this
iframe id=framename name=framename marginwidth=0 marginheight=0
hspace=0 vspace=0 target=_top
src=
http://sagittarius:8080/fab1gui/search?wicket:bookmarkablePage=:com.xmltravel.fab1.wicket.flights.HorizontalSearchNavPage;

allowtransparency=true frameborder=0 height=210 scrolling=no
width=540/iframe

I tried to simulate this situation and noticed that when i do a submit on
the Iframe for the first time this error is thrown.

How can i get around this issue.

My client has configured a spider to do searches on the live site and i am
seeing loads and loads of Internal error cloning object exception.
And worst of all today there was an out of memory error, i am wondering if
the repeated occurrence of cloning excpetion has got anything to
do with the out of memory error.

Regards
Dipu


2007-07-30 12:25:45:437 ERROR wicket.markup.html.WebPage
[http-8080-Processor25] - Page [Page class =
com.xmltravel.fab1.wicket.flights.FlightSearchResultPage, id = 1] couldn't
be cloned to move to another pagemap
wicket.WicketRuntimeException: Internal error cloning object
at wicket.util.lang.Objects.cloneObject(Objects.java:466)
at wicket.markup.html.WebPage.onNewBrowserWindow(WebPage.java:344)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at wicket.RequestListenerInterface.invoke(RequestListenerInterface.java
:187)
at
wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents
(ListenerInterfaceRequestTarget.java:74)
at wicket.request.compound.DefaultEventProcessorStrategy.processEvents(
DefaultEventProcessorStrategy.java:65)
at
wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(
AbstractCompoundRequestCycleProcessor.java:57)
at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:896)
at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
at wicket.RequestCycle.step(RequestCycle.java:1010)
at wicket.RequestCycle.steps(RequestCycle.java:1084)
at wicket.RequestCycle.request(RequestCycle.java:454)
at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.NotSerializableException:
org.apache.catalina.core.ApplicationContextFacade
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
:1369)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java
:1341)
at java.io.ObjectOutputStream.writeOrdinaryObject(
ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
:1369)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java
:1341)
at java.io.ObjectOutputStream.writeOrdinaryObject(
ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at 

Re: Switching to SSL for SignIn page

2007-07-30 Thread shumbola



Upayavira-2 wrote:
 
 shumbola wrote:
 I want to be able to switch to SSL when SignIn page showed to a user  and
 if
 successful, then switch back to normal HTTP protocol. I'm using
 wicket-1.3.
 
 We recently had a security firm audit our application. They pointed out 
 that such an approach is flawed.
 
 Basically, you secure the transfer of username/passwords, but from then 
 on, you pass a session cookie unprotected. For the lifespan of that 
 cookie, gaining access to the cookie would grant the same access to the 
 application as would the username/password.
 
 Therefore, by rights, if you wish to protect the transfer of 
 username/password, the entire application should use SSL.
 
 Hope I'm not missing something.
 
 Regards, Upayavira
 
 In my Application class I've come up with the following:
 
 protected IRequestCycleProcessor newRequestCycleProcessor() {
 return new WebRequestCycleProcessor() {
 public void respond(RequestCycle requestCycle) {
 IRequestTarget target = requestCycle.getRequestTarget();
 WebResponse response = (WebResponse)
 requestCycle.getResponse();
 WebRequest request = (WebRequest)
 requestCycle.getRequest();
 HttpServletRequest httpServletRequest =
 request.getHttpServletRequest();
 if(target instanceof BookmarkablePageRequestTarget) {
 if(((BookmarkablePageRequestTarget)target).getPage()
 instanceof SignIn 
 !httpServletRequest.isSecure())
 {
 StringBuffer url = new StringBuffer(https://;);
 url.append(httpServletRequest.getServerName());
 url.append(:).append(HTTPS_PORT);
 String s =
 RequestCycle.get().urlFor(target).toString();
 url.append(/app/).append(s);
 response.redirect(url.toString());
 }
 else if
 (((BookmarkablePageRequestTarget)target).getPage() instanceof Home 
 httpServletRequest.isSecure()) {
 StringBuffer url = new StringBuffer(http://;);
 url.append(httpServletRequest.getServerName());
 url.append(:).append(HTTP_PORT);
 String s =
 RequestCycle.get().urlFor(target).toString();
 url.append(/app/).append(s);
 response.redirect(url.toString());
 } else
 target.respond(requestCycle);
 }
 else
 target.respond(requestCycle);
 }
 };
 
 }
 
 It kinda works but I'm not sure if I'm doing it right way. And I'm not
 sure
 if it is bug free. I dont fully understand how wicket requestcycle works,
 so
 I need your help there.
 
 Thanks.
 shumbola
 
 
 
 

Doesn't yahoo mail, gmail, etc work that way? 
When I go to my yahoo mail it switches to the SSL signin page and after
switches back to the http. Or is there additional protection then?

shumbola
-- 
View this message in context: 
http://www.nabble.com/Switching-to-SSL-for-SignIn-page-tf4169495.html#a11862436
Sent from the Wicket Users New mailing list archive at Nabble.com.


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



Re: users Digest 28 Jul 2007 02:38:45 -0000 Issue 3

2007-07-30 Thread Stephane Boisson
Igor wrote:

 hrm, what version of wicket are you using?


1.3-SNAPSHOT

to me it looks like abstractsingleselectchoice.convertvalue() does convert
 id back to choice object.


You're right.. But it looks like this method is not called in my case..

I made my component work with a quick hack, but I am not very happy of it..

new DateTime( getPickerValue(yearPicker), getPickerValue(monthPicker),
getPickerValue(dayPicker), 12, 0, 0, 0 );

private int getPickerValue( DropDownChoice picker ) {
return (Integer) picker.getChoices().get( (Integer)
picker.getConvertedInput() );
}

Stéphane


Re: Wicket-auth-roles 1.2.6 1.4 JVM

2007-07-30 Thread Flavio
Yes, I known that is fast and easy but I tried to do it myself and I
had  problems.
Thanks!

On 7/30/07, Erik van Oosten [EMAIL PROTECTED] wrote:
 Hi Flavio,

 It only takes 15 minutes to make it yourself.
 But anyway, here is one:
 http://omelet.zapto.org/pub/wicket/wicket-auth-roles-1.2.2-1.4.jar
 It is derived from Wicket 1.2.2 but we use it in a Wicket 1.2.6
 environment on production.

 Regards,
 Erik.


 Flavio wrote:
  Hi!
 
  I'm trying to integrate acegi and wicket on a 1.4 JVM. Can anyone send
  me wicket-auth-roles without annotations and ported to 1.4?
 
  Thanks,
 
  Flavio.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 --
 Erik van Oosten
 http://2008.rubyenrails.nl/
 http://www.day-to-day-stuff.blogspot.com/


 -
 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: general question on dynamic pages

2007-07-30 Thread Eelco Hillenius
 With regard to the Login/Welcome example, I have a problem with the
 Login's page's mutator methods being called in the onClick() in the
 Welcome page. Your scenario requires that Welcome know too much about
 Login.  If Welcome and Login depend on the same model, and Welcome
 changes the model, then when control is passed back to Login it should
 be able to act on that change without the need for Welcome to know about
 it. I don't see yet where Login has the opportunity to act on the model
 change before the page is displayed. Again, is this where
 onBeforeRender() comes in? Or some other method?

I don't really get what you're after tbh. You can make your components
to be completely independent. In the end, they need to function in a
page/ component hierarchy, but this doesn't have to be related to how
components work with their models.

The onAttach/ onBeforeRender methods can be used if you need to do
special preparation before the rendering starts, but if I understand
you correctly, this wouldn't be the best way to go. What you do when
constructing the page is set the initial component hierarchy, and that
hierarchy can change later on, typically through callbacks like link
clicks and form posts.

Take a good look at the wicket-examples project for inspriration, and
if you have concrete cases you struggle with, please explain in more
detail.

Eelco

Eelco

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



Re: Behaviour adding to Component body

2007-07-30 Thread Eelco Hillenius
On 7/30/07, Jan Kriesten [EMAIL PROTECTED] wrote:

 Hi Eelco,

  You can use onRendered and write directly to the response using
  Response response = component.getResponse();

 not really. I tried that before, But that only writes the param after the 
 close
 tag which isn't what is intended. :-) Result:

 object wicket:id=swf width=200 height=150
 /object
 param name=movie value=res/mymovie.swf /

 The param belongs inside the object-tag.

Hmmm, yeah. So it looks to me like you *do* need something like
onComponentTagBody then. Any other devs have alternatives ideas? Looks
like a valid use case to me, though this is a pretty specific case
that could be solved without using behaviors.

Eelco

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



Re: Behaviour adding to Component body

2007-07-30 Thread Igor Vaynberg
On 7/30/07, Jan Kriesten [EMAIL PROTECTED] wrote:


 Hi Igor,

  i really dont think oncomponenttagbody() belongs in behaviors. this
 should
  be done without a behavior by subclassing the component and overriding
  oncomponenttagbody() there. that said you can still hack it by using
  AbstractTransformerBehavior and some string manipulation code.

 I don't think this should belong in a subclass. IMHO manipulating
 attributes for
 a certain type of object should be handled by simply adding a Behaviour.


yes i agree 100%. but, you are not manipulating attributes, you are
generating additional markup int component's body.

SWF's
 are only one example. Other Objects (QuickTime, Real, WMV) have other
 Attributes
 and parameter needs which is where Behaviours do what they do best:
 manipulating them. The Problem is, that Objects aren't handled Browser
 independend. So it's enough for FF  Co. to have a 'data'-Attribute for
 the SWF,
 whereas IE needs the  param name=movie... and no 'data' to have the
 movie
 streamed.

 ATM it looks like this:

 WebMarkupContainer swf = new WebMarkupContainer( swf );
 ResourceReference resRef = new ResourceReference( HeaderPanel.class,
 res/mymovie.swf );
 swf.add( new FlashAttributes( urlFor( resRef ).toString(), 700, 70 )
 );
 add( swf );

 It really looks messy if you subclass it and take into account the 20
 other
 parameters you could add the Object...


well the logic has to go somewhere so just do

SwfObject object=new SwfObject(swf, resRef, 700, 70); instead of putting
it into a behavior put it into a custom webmarkupcontainer subclass instead.

-igor



Best regards, --- Jan.



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




Re: Behaviour adding to Component body

2007-07-30 Thread Eelco Hillenius
 since I haven't overridden onComponentTagBody yet - what happens to child-Tags
 then, do I have to manage these, too?

If that's an issue, it's better to follow Martijn's advice and make
this component a panel with a list view for the parameters.

Eelco

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



Re: Behaviour adding to Component body

2007-07-30 Thread Eelco Hillenius
 I thought I could just concentrate on the last aspect and apply only the 
 needed
 changes... (i.e. move an attribute to a param name...).

You should be able to pull that off if you use
AbstractTransformerBehavior. Btw, if you ever get to it, a nice Flash
component with a demo for wicket-examples would be very welcome!

Eelco

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



Re: Behaviour adding to Component body

2007-07-30 Thread Jan Kriesten

Hi Eelco,

 You should be able to pull that off if you use
 AbstractTransformerBehavior.

yes, tried that already. strangely, object gets an additional
xmlns:wicket=http://wicket.apache.org-attribute?! but it doesn't seem to hurt.

 Btw, if you ever get to it, a nice Flash
 component with a demo for wicket-examples would be very welcome!

Yep. :-)

Best regards, --- Jan.



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



Re: Behaviour adding to Component body

2007-07-30 Thread Eelco Hillenius
 yes, tried that already. strangely, object gets an additional
 xmlns:wicket=http://wicket.apache.org-attribute?! but it doesn't seem to 
 hurt.

Yeah, that happens in onComponentTag:

public void onComponentTag(final Component component, final 
ComponentTag tag)
{
tag.put(xmlns:wicket, http://wicket.apache.org;);

What you could do is rather than extending that behavior directly,
create one from scratch that does the same thing. Just look at the
source for idea. Or we could make adding that attribute conditional
(seems to be particular for XSLT). Or decide that it doesn't hurt :)

  Btw, if you ever get to it, a nice Flash
  component with a demo for wicket-examples would be very welcome!

 Yep. :-)

That would be great!

Eelco

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



Getting a 1.2.7 shapshot posted to the repo on wicket-stuff

2007-07-30 Thread David Leangen

Would it be possible to have the current 1.2.7 snapshot posted on the
repository on the wicket-stuff site?

Is there anything I can do to get my hands dirty? Or do I need to rely
on the generosity of one of the committers?


Thanx!
Dave




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



Testing for cookie capability

2007-07-30 Thread David Leangen

What would be the usual way of testing a client for cookie capability?

Essentially, I want to know if I can rely on the use of a cookie, or if
I should fall back on coding something into the URL parameters.


Thanks!
David




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