Use html from url as markup

2011-07-11 Thread Marieke Vandamme
Hello, 

Is it possible to use html from an url as Markup-code for a WebPage? 
I thought of doing something like this: 

/public class MarkupTestPage extends WebPage implements
IMarkupResourceStreamProvider {

public MarkupTestPage(){
}

public IResourceStream getMarkupResourceStream(MarkupContainer mc,
Class? type) {
  return new UrlResourceStream(new
URL(http://myserver.tvh.com/test.html;));
}
}/

This works, but I want to use this as parent html, and include the html from
wicket:head and wicket:extend tags inside my MarkupTestPage.html.
My html returned from location http://myserver.tvh.com/test.html has a
wicket:child/ tag inside. 
So somehow before returning the UrlResourceStream, it should be merged.

Thanks for any help! Kind regards, Marieke Vandamme

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Use-html-from-url-as-markup-tp3658921p3658921.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Use html from url as markup

2011-07-11 Thread Martin Grigorov
Create a base page which includes its html from URL and a child page
which has wicket:head and wicket:extend/. And grand-child page if
needed.

On Mon, Jul 11, 2011 at 10:16 AM, Marieke Vandamme
marieke.vanda...@tvh.be wrote:
 Hello,

 Is it possible to use html from an url as Markup-code for a WebPage?
 I thought of doing something like this:

 /public class MarkupTestPage extends WebPage implements
 IMarkupResourceStreamProvider {

    public MarkupTestPage(){
    }

    public IResourceStream getMarkupResourceStream(MarkupContainer mc,
 Class? type) {
          return new UrlResourceStream(new
 URL(http://myserver.tvh.com/test.html;));
    }
 }/

 This works, but I want to use this as parent html, and include the html from
 wicket:head and wicket:extend tags inside my MarkupTestPage.html.
 My html returned from location http://myserver.tvh.com/test.html has a
 wicket:child/ tag inside.
 So somehow before returning the UrlResourceStream, it should be merged.

 Thanks for any help! Kind regards, Marieke Vandamme

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Use-html-from-url-as-markup-tp3658921p3658921.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Use html from url as markup

2011-07-11 Thread Marieke Vandamme
I've tried, 
but only getting the html from the parent page. What's between
wicket:extend-tags is'nt on it...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Use-html-from-url-as-markup-tp3658921p3659001.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Getting A Random Localized Resource (CSS Image) Instead Of Page

2011-07-11 Thread Horacio Natyural
Hi,

What does this log statement mean?

Tried to retrieve a localized string for a component that has not yet
been added to the page. This can sometimes lead to an invalid or no
localized resource returned

I see it in almost all of our pages and it's saying that i can
sometimes lead to an invalid or no localized resource returned?
Is this the reason why I'm suddenly getting a different image instead
of the one that I'm looking for?

I'm getting a css image instead of a page and this happens very randomly.
Really need help on this.

THanks A Lot!
Horacio

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



Re: Getting A Random Localized Resource (CSS Image) Instead Of Page

2011-07-11 Thread Martin Grigorov
This message means that you use:

public MyPanel() {
  ...
  Component comp = new ...;
  add(comp);
  comp.getString(some.resource.key); // 
}

The problem is that MyPanel doesn't know yet its parent (and
respectively its page). And this leads to incomplete knowledge how to
find the resource bundle with some.resource.key.

I doubt it leads to your problem.

I think you found the reason for you problem. Johan confirmed in the
other thread that replaceSession() could be the problem.

On Mon, Jul 11, 2011 at 11:26 AM, Horacio Natyural
horacio.natyu...@gmail.com wrote:
 Hi,

 What does this log statement mean?

 Tried to retrieve a localized string for a component that has not yet
 been added to the page. This can sometimes lead to an invalid or no
 localized resource returned

 I see it in almost all of our pages and it's saying that i can
 sometimes lead to an invalid or no localized resource returned?
 Is this the reason why I'm suddenly getting a different image instead
 of the one that I'm looking for?

 I'm getting a css image instead of a page and this happens very randomly.
 Really need help on this.

 THanks A Lot!
 Horacio

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Getting A Random Localized Resource (CSS Image) Instead Of Page

2011-07-11 Thread Horacio Natyural
What are the implications of this error message?

Thanks

On Mon, Jul 11, 2011 at 5:26 PM, Horacio Natyural
horacio.natyu...@gmail.com wrote:
 Hi,

 What does this log statement mean?

 Tried to retrieve a localized string for a component that has not yet
 been added to the page. This can sometimes lead to an invalid or no
 localized resource returned

 I see it in almost all of our pages and it's saying that i can
 sometimes lead to an invalid or no localized resource returned?
 Is this the reason why I'm suddenly getting a different image instead
 of the one that I'm looking for?

 I'm getting a css image instead of a page and this happens very randomly.
 Really need help on this.

 THanks A Lot!
 Horacio


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



RE: Getting A Random Localized Resource (CSS Image) Instead Of Page

2011-07-11 Thread Wilhelmsen Tor Iver
From: Horacio Natyural [mailto:horacio.natyu...@gmail.com] 
 What are the implications of this error message?

Wicket will ignore any overriding (on the Page level) of the property, only the 
component's own (and the Application's?) properties files will be used.

E.g. if FooComponent.properties has
fie=Some default

and FooPage.properties has
myfoocomponent.fie=Another value

then calling getString(fie) in the constructor will return Some default 
because there is no FooPage in the hierarchy yet.

- Tor Iver

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



Re: Use html from url as markup

2011-07-11 Thread Marieke Vandamme
I think that the html from the page is just rendered through the
UrlResourceStream, and that this one clears the non-html standard tags like
wicket:child/. Then the child-page tries to put the code between this
wicket:child-tags, but they are lost. Is that possible?

Thanks again for any help! Kind Regards, Marieke Vandamme

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Use-html-from-url-as-markup-tp3658921p3659156.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: WicketFilter.init() called twice with Glassfish

2011-07-11 Thread Wilhelmsen Tor Iver
The first workaround we ended up using was something like:

public class SafeWicketFilter extends WicketFilter {
private boolean 
initWasAlreadyCalledSoYouShouldNotDoThisYouStupidGlassfish = false;

@Override
public void init(FilterConfig filterConfig) throws ServletException
{
synchronized(this)
{
if ( ! 
initWasAlreadyCalledSoYouShouldNotDoThisYouStupidGlassfish) {
super.init(filterConfig);

initWasAlreadyCalledSoYouShouldNotDoThisYouStupidGlassfish = true;
}
}
}

}


The second workaround was to stop using Glassfish. :)

- Tor Iver 


Re: Getting A Random Localized Resource (CSS Image) Instead Of Page

2011-07-11 Thread Horacio Natyural
thanks for the info..

martin,

someone used

getRequestCycle().setRedirect(true);

Thanks for all the help


On Mon, Jul 11, 2011 at 6:05 PM, Wilhelmsen Tor Iver toriv...@arrive.no wrote:
 From: Horacio Natyural [mailto:horacio.natyu...@gmail.com]
 What are the implications of this error message?

 Wicket will ignore any overriding (on the Page level) of the property, only 
 the component's own (and the Application's?) properties files will be used.

 E.g. if FooComponent.properties has
 fie=Some default

 and FooPage.properties has
 myfoocomponent.fie=Another value

 then calling getString(fie) in the constructor will return Some default 
 because there is no FooPage in the hierarchy yet.

 - Tor Iver

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



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



RE: Application with name 'xxxx' already exists.

2011-07-11 Thread Wilhelmsen Tor Iver
 Hmm... there is just one, no more. :(

You have run into a known Glassfish bug where WicketFilter.init() is called 
twice. A solution is to add a boolean guard in a WicketFilter subclass that 
only calls super.init() once.

- Tor Iver


Re: Application with name 'xxxx' already exists.

2011-07-11 Thread Martin Grigorov
It is fixed with WICKET-3867.

On Mon, Jul 11, 2011 at 1:46 PM, Wilhelmsen Tor Iver toriv...@arrive.no wrote:
 Hmm... there is just one, no more. :(

 You have run into a known Glassfish bug where WicketFilter.init() is called 
 twice. A solution is to add a boolean guard in a WicketFilter subclass that 
 only calls super.init() once.

 - Tor Iver




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: YSlow still complaining Add Expires headers

2011-07-11 Thread Peter Karich
 anyone an idea how to change cache duration of resources?
(as setDefaultCacheDuration doesn't work for me)

  Martin,

 I'm using 1.4.17

 Your [1] is about the page itself, not about the resources
  (.css, .js, images, ...).
 ok. I just wasn't sure.

 Regards,
 Peter.

 Which version of Wicket ?
 Your [1] is about the page itself, not about the resources (.css, .js,
 images, ...).

 On Sun, Jul 10, 2011 at 6:08 PM, Peter Karich peat...@yahoo.de wrote:
  Hi all,

 because of the advice in

 http://apache-wicket.1842946.n4.nabble.com/expires-header-td1866672.html
 https://issues.apache.org/jira/browse/WICKET-1602

 I used getResourceSettings().setDefaultCacheDuration(30 * 24 * 3600);
 in my WebApplication. I also did some other hacking [1] to set the
 Expires header.
 But I still see Add Expires headers in YSlow [2] and Page Speed [3].

 What is the correct way to set the Expires headers?

 Regards,
 Peter.

 [1]
 @Override
protected void configureResponse() {
super.configureResponse();
// Last-Modified: Mon, 29 Jun 1998 02:28:12 GMT
SimpleDateFormat formatter = new SimpleDateFormat(EEE, dd MMM
  HH:mm:ss z);
formatter.setTimeZone(TimeZone.getTimeZone(GMT));

WebResponse response = getWebRequestCycle().getWebResponse();
int minutes = 30 * 24 * 60;
response.setHeader(Cache-Control, public, max-age= + minutes
 * 60);
String str = formatter.format(new
 MyDate().plusMinutes(minutes).toDate());
response.setHeader(Expires, str);

str = formatter.format(new MyDate().minusMinutes(minutes).toDate());
response.setHeader(Last-Modified, str);

// response.setHeader(Pragma, no-cache);
// response.setHeader(Keep-Alive,  + minutes * 60);
}

 [2]
 There are 29 static components without a far-future expiration date.

 [3]
 http://code.google.com/intl/de-DE/speed/page-speed/docs/caching.html#LeverageBrowserCaching


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



Re: OutputStreams and Panels

2011-07-11 Thread Alex Shubert
Julian, may you provide a small hello-world project?
I would like to see how all this work. I heard never before about BIRT
and have no idea is it any good.
thanks

On 9 July 2011 03:40, Julian Sinai jsi...@gmail.com wrote:
 I should add that I used BIRT 3.7 for this.

 Julian




-- 
Best regards
Alex

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



Re: Page De-Serialization and memory

2011-07-11 Thread Martin Grigorov
Running the third method (the 'problematic' one) 1 times shows no
changes in the PermGen space in VisualVM graphics.
The value is stable at 7.9Mb.

MemoryMXBean shows that non-heap space increases more than heap space
but I didn't find any resource explaining what is included in this
non-heap statistics.

The proof that PermGen is quite stable can be seen with:  -verbose:gc
-XX:+PrintGCDetails

It produces something like:
[Full GC (System) [PSYoungGen: 0K-0K(76480K)] [PSOldGen:
1372K-1372K(174784K)] 1372K-1372K(251264K) [PSPermGen:
6746K-6746K(16384K)], 0.0198550 secs] [Times: user=0.01 sys=0.00,
real=0.02 secs]

Comparing several such outputs shows that PermGen is stable (not
increasing, not decreasing).

Almost all of the memory allocation happens in the YoungGen and rarely
in the OldGen. This is normal because Label objects are created and
then discarded.

On Sun, Jul 10, 2011 at 11:37 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 About the use cases: my experience is that most of the time the uses
 the in-memory pages (for each listener callback execution, for ajax
 requests,...).
 Previous version of a page, or previous page is needed when the user
 clicks browser back button. Even in this case most of the time the
 in-memory cache is hit. Only when the user goes several pages back and
 this page is not in-memory then the disk store is used.

 So far so good, but...! Even in-memory store contains serialized
 versions of the Page, named SerializedPage. This is a struct which
 contains
 {
  sessionId: String,
  pageId: int,
  data: byte[]
 }
 so the Page is serialized back and forth when stored in *any*
 IPageStore/IDataStore.

 This is the current state in Wicket 1.5.

 Me and Pedro noticed that IPageStore impl (DefaultPageStore) can be
 improved to work with Page instances but we decided to postpone this
 optimization for 1.5.0+.

 About new String(someLiteral): I don't remember lately seeing this
 code neither in libraries, nor in applications. This constructor
 should be used only when the developer explicitly wants this string to
 not be interned and stored in the PermGen space, i.e. it will be
 stored in the heap space.
 Your benchmark test tests exactly this - the heap space.
 I'll try the app with MemoryMXBean to see whether the non-heap changes
 after deserialization.
 I'm not very into Java Serialization but indeed it seems the Strings
 are deserialized in the heap. But even in this case they go in the
 Eden space, i.e. they are reclaimed soon after.

 On Sun, Jul 10, 2011 at 2:37 AM, richard emberson
 richard.ember...@gmail.com wrote:
 I you run the little Java program I included, you will see that
 there is an impact - de-serialized objects take more memory.

 Richard

 On 07/09/2011 05:23 PM, Igor Vaynberg wrote:

 string literals are interned by the jvm so they should have a minimal
 memory impact.

 -igor

 On Sat, Jul 9, 2011 at 5:10 PM, richard emberson
 richard.ember...@gmail.com  wrote:

 Martin,

 The reason I was interested was because it struck me a couple of
 days ago that while each Page, tree of Components, is created
 many (almost all?) of the non-end-user-generated Strings stored
 as instance variables in the tree are shared
 between all copies of the Page but that when such a Page is
 serialized to disk and then de-serialized, each String becomes its own
 copy unique to that particular Page. This means that if an
 appreciable number of Pages in-memory are reanimated Pages, then
 there could be a bunch of memory being used for all the String
 copies.

 In the attached simple Java file (yes, I still write Java when I must)
 there are three different ways of creating an array of
 Label objects (not Wicket Label) where each Label takes a String:
    new Label(some_string)

 The first is to share the same String over all instance of the Label.
    new Label(the_string)
 The second is to make a copy of the String when creating each
 Label;
    new Label(new String(the_string))
 The third is to create a single Label, serialize it to an array of
 bytes and then generate the Labels in the array by de-serialized
 the byte array for each Label.

 Needless to say, the first uses the least memory; the label string
 is shared by all Labels while the second and third approach
 uses more memory. Also, if during the de-serialization process, the
 de-serialized String is replaced with the original instance of the
 String, then the third approach uses only as much memory as the
 first approach.

 No rocket science here, but it does seem to imply that if a
 significant number of Pages in-memory are actually reanimated Pages,
 then there could be a memory saving by
 making de-serialization smarter about possible shared objects.
 Even it it is only, say, a 5% saving for only certain Wicket
 usage patterns, it might be worth looking into.

 Hence, my question to the masters of Wicket and developers whose
 application might fit the use-case.

 Richard

 On 07/09/2011 11:03 AM, Martin 

Re: Getting A Random Localized Resource (CSS Image) Instead Of Page

2011-07-11 Thread Horacio Natyural
does it have any effect?

On Mon, Jul 11, 2011 at 7:45 PM, Horacio Natyural
horacio.natyu...@gmail.com wrote:
 thanks for the info..

 martin,

 someone used

 getRequestCycle().setRedirect(true);

 Thanks for all the help


 On Mon, Jul 11, 2011 at 6:05 PM, Wilhelmsen Tor Iver toriv...@arrive.no 
 wrote:
 From: Horacio Natyural [mailto:horacio.natyu...@gmail.com]
 What are the implications of this error message?

 Wicket will ignore any overriding (on the Page level) of the property, only 
 the component's own (and the Application's?) properties files will be used.

 E.g. if FooComponent.properties has
 fie=Some default

 and FooPage.properties has
 myfoocomponent.fie=Another value

 then calling getString(fie) in the constructor will return Some default 
 because there is no FooPage in the hierarchy yet.

 - Tor Iver

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




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



Re: YSlow still complaining Add Expires headers

2011-07-11 Thread Martin Grigorov
See what happens in
org.apache.wicket.markup.html.WebResource.setHeaders(WebResponse).
Then check the response headers for your resources.

I guess that your resources are located next to WEB-INF folder and are
delivered directly by the web container and thus Wicket doesn't set
the headers.
If this is the case then you here are two options:
- check your web container documentation
- add a filter in web.xml that will set the headers for all requests
to /css/*.css, /js/*.js, ...

On Mon, Jul 11, 2011 at 2:29 PM, Peter Karich peat...@yahoo.de wrote:
  anyone an idea how to change cache duration of resources?
 (as setDefaultCacheDuration doesn't work for me)

  Martin,

 I'm using 1.4.17

 Your [1] is about the page itself, not about the resources
  (.css, .js, images, ...).
 ok. I just wasn't sure.

 Regards,
 Peter.

 Which version of Wicket ?
 Your [1] is about the page itself, not about the resources (.css, .js,
 images, ...).

 On Sun, Jul 10, 2011 at 6:08 PM, Peter Karich peat...@yahoo.de wrote:
  Hi all,

 because of the advice in

 http://apache-wicket.1842946.n4.nabble.com/expires-header-td1866672.html
 https://issues.apache.org/jira/browse/WICKET-1602

 I used getResourceSettings().setDefaultCacheDuration(30 * 24 * 3600);
 in my WebApplication. I also did some other hacking [1] to set the
 Expires header.
 But I still see Add Expires headers in YSlow [2] and Page Speed [3].

 What is the correct way to set the Expires headers?

 Regards,
 Peter.

 [1]
 @Override
    protected void configureResponse() {
        super.configureResponse();
        // Last-Modified: Mon, 29 Jun 1998 02:28:12 GMT
        SimpleDateFormat formatter = new SimpleDateFormat(EEE, dd MMM
  HH:mm:ss z);
        formatter.setTimeZone(TimeZone.getTimeZone(GMT));

        WebResponse response = getWebRequestCycle().getWebResponse();
        int minutes = 30 * 24 * 60;
        response.setHeader(Cache-Control, public, max-age= + minutes
 * 60);
        String str = formatter.format(new
 MyDate().plusMinutes(minutes).toDate());
        response.setHeader(Expires, str);

        str = formatter.format(new MyDate().minusMinutes(minutes).toDate());
        response.setHeader(Last-Modified, str);

        // response.setHeader(Pragma, no-cache);
        // response.setHeader(Keep-Alive,  + minutes * 60);
    }

 [2]
 There are 29 static components without a far-future expiration date.

 [3]
 http://code.google.com/intl/de-DE/speed/page-speed/docs/caching.html#LeverageBrowserCaching


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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Skip validation on nested form's form level validators

2011-07-11 Thread Andrea Del Bene

Hi,

why don't simply put the inner form out of the outer one? Anyway, you 
could remove inner form's validators before the outer form is submitted 
and add them again when submit process is over (onFormSubmitted() )

Hi all,

I have two forms nested within each other (wicket 1.4.17). The inner 
form adds data to the model of the outer form via ajax when it's 
button is pressed while the outer form saves the data to the database 
when the outer form's submit button is pressed.


Both forms have validators attacehd to them and their components. and 
of course the inner form's validators must not be executed when the 
outer form is submitted. Having the inner form implement 
IFormVisitorParticipant and then check if the submitting button was 
it's own avoids the inner form's component's validators to be 
executed. But validators applied to the inner form directly (e.g. 
EqualInputValidators etc.) are still executed and in my case causing 
the request to die horribly because the requred data just is not there.


I was looking for an elegant way to solve this but since all validate 
methods in the hierarchy are final I cannot hook any code into the 
form's on validation cycle. The method onValidate is not called (I 
guess that is because the form is validated as the outer form's 
child). All other methods that allow me to achieve the deisred 
behavior (like isEnabled) are too general cause side effects like 
disabling the form. At the moment the only way I can think of is to 
disable default form processing and then call the validators manually 
which is not very appealing to me.


Is there another way how this can be done?

Cheers,
Chris




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



Basic question on Developing FormComponentPanels

2011-07-11 Thread Nazaret Kazarian
The recommended way for developing a FormComponentPanel is to override
onBeforeRender and convertInput. My question is my not override
updateModel() to synchronize the model of the custom
FormComponentPanel with the models of the nested components instead of
overriding convertInput? Wouldn't that be more symmetrical with
onBeforeRender?

model - nestedModels (onBeforeRender)
nestedModel - model (onUpdate).

Thanks!

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



Re: Getting A Random Localized Resource (CSS Image) Instead Of Page

2011-07-11 Thread Horacio Natyural
btw,

before the error occurrs,
there would be instances in which the server would not reply
here's an example scenario.

  a. Was able to login ppoerly
b. Updated a client info (changed the
alternate email address)
c. Clicked the Transfer link, inputted  the
necessary information and clicked the Submit button, nothing
   d. Clicked again the submit button,
nothing happend again.
5. Clicked the Refresh button

The CSS image then appears
there awere also instances in which the link was clicked, did not
reply. then after clicking again, the css image appeared again.

any ideas?




On Mon, Jul 11, 2011 at 8:41 PM, Horacio Natyural
horacio.natyu...@gmail.com wrote:
 does it have any effect?

 On Mon, Jul 11, 2011 at 7:45 PM, Horacio Natyural
 horacio.natyu...@gmail.com wrote:
 thanks for the info..

 martin,

 someone used

 getRequestCycle().setRedirect(true);

 Thanks for all the help


 On Mon, Jul 11, 2011 at 6:05 PM, Wilhelmsen Tor Iver toriv...@arrive.no 
 wrote:
 From: Horacio Natyural [mailto:horacio.natyu...@gmail.com]
 What are the implications of this error message?

 Wicket will ignore any overriding (on the Page level) of the property, only 
 the component's own (and the Application's?) properties files will be used.

 E.g. if FooComponent.properties has
 fie=Some default

 and FooPage.properties has
 myfoocomponent.fie=Another value

 then calling getString(fie) in the constructor will return Some default 
 because there is no FooPage in the hierarchy yet.

 - Tor Iver

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





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



Re: Xforms Controls within Wicket Application

2011-07-11 Thread Alexandros Karypidis

Hello,

First of all, there is ambiguity in your question. I'm not sure how the 
above would tie into a wicket-specific question, unless you want to 
create an XForm--XHTML renderer/processor using Wicket as the 
underlying technology (which is not a good idea IMHO). In any case:




1) Are you asking whether Wicket can be used to render XForms files (as 
in the the XForms specification at http://www.w3.org/TR/xforms11/).


In this case, the answer is NO, I'm not aware of such an XForm renderer. 
You could create a custom Wicket component that is given an XForm 
definition document and uses it to render an XHTML page, but that is a 
lot of work (and probably not a very efficient way to do it, as you 
would ideally use XSLT or something along those lines to do XML--XML 
transformation. There are available open-source tools like Orbeon (see 
http://www.orbeon.com/) which can give you this kind of functionality 
(including processing of the XForm submission).


Now, regarding the online/offline issue:

2) Do you have a rich client application that can render the XForms 
(e.g. using Swing) and allow the user to save such forms locally? In 
that case, you would need to write code that submits the forms when the 
rich client has network access. The submission should probably go to 
some servlet (e.g. an Orbeon-managed URL). Again, I don't think this 
would be wicket-related.


3) If you have a web-based application for this (e.g. a bundled Tomcat 
running on the user machine, which they access via the browser) then the 
principle is a combination of (1) and (2): You would need:


a) to render the forms using something like Orbeon to present HTML to 
the browser
b) to store the form submission to the local FS (or a locally running DB 
which could be something like Derby)
c) to implement an uploader where the user can send locally saved 
forms to a central server (same as what I talked about in (2) above)


On 11/7/2011 4:09 μμ, sramay wrote:

Hi,

   Rendering a document in the Xforms or storing it in a database is as you
have suggested
   ok.
   The issue is there when you have xform controls inside a wicket
application
instead of HTML document(form) and take the imput and stores them into a
database.

Am I explaining my position clearly ?

Regards


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Xforms-Controls-within-Wicket-Application-tp3619253p3659485.html
Sent from the Users forum mailing list archive at Nabble.com.

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



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



Re: Page De-Serialization and memory

2011-07-11 Thread richard emberson

When you say 1 times, you set NOS_TIMES to 1?
(NOS_TIMES should have been called ARRAY_SIZE).

Richard

On 07/11/2011 05:38 AM, Martin Grigorov wrote:

Running the third method (the 'problematic' one) 1 times shows no
changes in the PermGen space in VisualVM graphics.
The value is stable at 7.9Mb.

MemoryMXBean shows that non-heap space increases more than heap space
but I didn't find any resource explaining what is included in this
non-heap statistics.

The proof that PermGen is quite stable can be seen with:  -verbose:gc
-XX:+PrintGCDetails

It produces something like:
[Full GC (System) [PSYoungGen: 0K-0K(76480K)] [PSOldGen:
1372K-1372K(174784K)] 1372K-1372K(251264K) [PSPermGen:
6746K-6746K(16384K)], 0.0198550 secs] [Times: user=0.01 sys=0.00,
real=0.02 secs]

Comparing several such outputs shows that PermGen is stable (not
increasing, not decreasing).

Almost all of the memory allocation happens in the YoungGen and rarely
in the OldGen. This is normal because Label objects are created and
then discarded.

On Sun, Jul 10, 2011 at 11:37 AM, Martin Grigorovmgrigo...@apache.org  wrote:

Hi,

About the use cases: my experience is that most of the time the uses
the in-memory pages (for each listener callback execution, for ajax
requests,...).
Previous version of a page, or previous page is needed when the user
clicks browser back button. Even in this case most of the time the
in-memory cache is hit. Only when the user goes several pages back and
this page is not in-memory then the disk store is used.

So far so good, but...! Even in-memory store contains serialized
versions of the Page, named SerializedPage. This is a struct which
contains
{
  sessionId: String,
  pageId: int,
  data: byte[]
}
so the Page is serialized back and forth when stored in *any*
IPageStore/IDataStore.

This is the current state in Wicket 1.5.

Me and Pedro noticed that IPageStore impl (DefaultPageStore) can be
improved to work with Page instances but we decided to postpone this
optimization for 1.5.0+.

About new String(someLiteral): I don't remember lately seeing this
code neither in libraries, nor in applications. This constructor
should be used only when the developer explicitly wants this string to
not be interned and stored in the PermGen space, i.e. it will be
stored in the heap space.
Your benchmark test tests exactly this - the heap space.
I'll try the app with MemoryMXBean to see whether the non-heap changes
after deserialization.
I'm not very into Java Serialization but indeed it seems the Strings
are deserialized in the heap. But even in this case they go in the
Eden space, i.e. they are reclaimed soon after.

On Sun, Jul 10, 2011 at 2:37 AM, richard emberson
richard.ember...@gmail.com  wrote:

I you run the little Java program I included, you will see that
there is an impact - de-serialized objects take more memory.

Richard

On 07/09/2011 05:23 PM, Igor Vaynberg wrote:


string literals are interned by the jvm so they should have a minimal
memory impact.

-igor

On Sat, Jul 9, 2011 at 5:10 PM, richard emberson
richard.ember...@gmail.comwrote:


Martin,

The reason I was interested was because it struck me a couple of
days ago that while each Page, tree of Components, is created
many (almost all?) of the non-end-user-generated Strings stored
as instance variables in the tree are shared
between all copies of the Page but that when such a Page is
serialized to disk and then de-serialized, each String becomes its own
copy unique to that particular Page. This means that if an
appreciable number of Pages in-memory are reanimated Pages, then
there could be a bunch of memory being used for all the String
copies.

In the attached simple Java file (yes, I still write Java when I must)
there are three different ways of creating an array of
Label objects (not Wicket Label) where each Label takes a String:
new Label(some_string)

The first is to share the same String over all instance of the Label.
new Label(the_string)
The second is to make a copy of the String when creating each
Label;
new Label(new String(the_string))
The third is to create a single Label, serialize it to an array of
bytes and then generate the Labels in the array by de-serialized
the byte array for each Label.

Needless to say, the first uses the least memory; the label string
is shared by all Labels while the second and third approach
uses more memory. Also, if during the de-serialization process, the
de-serialized String is replaced with the original instance of the
String, then the third approach uses only as much memory as the
first approach.

No rocket science here, but it does seem to imply that if a
significant number of Pages in-memory are actually reanimated Pages,
then there could be a memory saving by
making de-serialization smarter about possible shared objects.
Even it it is only, say, a 5% saving for only certain Wicket
usage patterns, it might be worth looking into.

Hence, my question to the masters of Wicket and 

Re: Page De-Serialization and memory

2011-07-11 Thread Martin Grigorov
On Mon, Jul 11, 2011 at 5:12 PM, richard emberson
richard.ember...@gmail.com wrote:
 When you say 1 times, you set NOS_TIMES to 1?
I mean NOS_TRIALS.
 (NOS_TIMES should have been called ARRAY_SIZE).

 Richard

 On 07/11/2011 05:38 AM, Martin Grigorov wrote:

 Running the third method (the 'problematic' one) 1 times shows no
 changes in the PermGen space in VisualVM graphics.
 The value is stable at 7.9Mb.

 MemoryMXBean shows that non-heap space increases more than heap space
 but I didn't find any resource explaining what is included in this
 non-heap statistics.

 The proof that PermGen is quite stable can be seen with:  -verbose:gc
 -XX:+PrintGCDetails

 It produces something like:
 [Full GC (System) [PSYoungGen: 0K-0K(76480K)] [PSOldGen:
 1372K-1372K(174784K)] 1372K-1372K(251264K) [PSPermGen:
 6746K-6746K(16384K)], 0.0198550 secs] [Times: user=0.01 sys=0.00,
 real=0.02 secs]

 Comparing several such outputs shows that PermGen is stable (not
 increasing, not decreasing).

 Almost all of the memory allocation happens in the YoungGen and rarely
 in the OldGen. This is normal because Label objects are created and
 then discarded.

 On Sun, Jul 10, 2011 at 11:37 AM, Martin Grigorovmgrigo...@apache.org
  wrote:

 Hi,

 About the use cases: my experience is that most of the time the uses
 the in-memory pages (for each listener callback execution, for ajax
 requests,...).
 Previous version of a page, or previous page is needed when the user
 clicks browser back button. Even in this case most of the time the
 in-memory cache is hit. Only when the user goes several pages back and
 this page is not in-memory then the disk store is used.

 So far so good, but...! Even in-memory store contains serialized
 versions of the Page, named SerializedPage. This is a struct which
 contains
 {
  sessionId: String,
  pageId: int,
  data: byte[]
 }
 so the Page is serialized back and forth when stored in *any*
 IPageStore/IDataStore.

 This is the current state in Wicket 1.5.

 Me and Pedro noticed that IPageStore impl (DefaultPageStore) can be
 improved to work with Page instances but we decided to postpone this
 optimization for 1.5.0+.

 About new String(someLiteral): I don't remember lately seeing this
 code neither in libraries, nor in applications. This constructor
 should be used only when the developer explicitly wants this string to
 not be interned and stored in the PermGen space, i.e. it will be
 stored in the heap space.
 Your benchmark test tests exactly this - the heap space.
 I'll try the app with MemoryMXBean to see whether the non-heap changes
 after deserialization.
 I'm not very into Java Serialization but indeed it seems the Strings
 are deserialized in the heap. But even in this case they go in the
 Eden space, i.e. they are reclaimed soon after.

 On Sun, Jul 10, 2011 at 2:37 AM, richard emberson
 richard.ember...@gmail.com  wrote:

 I you run the little Java program I included, you will see that
 there is an impact - de-serialized objects take more memory.

 Richard

 On 07/09/2011 05:23 PM, Igor Vaynberg wrote:

 string literals are interned by the jvm so they should have a minimal
 memory impact.

 -igor

 On Sat, Jul 9, 2011 at 5:10 PM, richard emberson
 richard.ember...@gmail.com    wrote:

 Martin,

 The reason I was interested was because it struck me a couple of
 days ago that while each Page, tree of Components, is created
 many (almost all?) of the non-end-user-generated Strings stored
 as instance variables in the tree are shared
 between all copies of the Page but that when such a Page is
 serialized to disk and then de-serialized, each String becomes its own
 copy unique to that particular Page. This means that if an
 appreciable number of Pages in-memory are reanimated Pages, then
 there could be a bunch of memory being used for all the String
 copies.

 In the attached simple Java file (yes, I still write Java when I must)
 there are three different ways of creating an array of
 Label objects (not Wicket Label) where each Label takes a String:
    new Label(some_string)

 The first is to share the same String over all instance of the Label.
    new Label(the_string)
 The second is to make a copy of the String when creating each
 Label;
    new Label(new String(the_string))
 The third is to create a single Label, serialize it to an array of
 bytes and then generate the Labels in the array by de-serialized
 the byte array for each Label.

 Needless to say, the first uses the least memory; the label string
 is shared by all Labels while the second and third approach
 uses more memory. Also, if during the de-serialization process, the
 de-serialized String is replaced with the original instance of the
 String, then the third approach uses only as much memory as the
 first approach.

 No rocket science here, but it does seem to imply that if a
 significant number of Pages in-memory are actually reanimated Pages,
 then there could be a memory saving by
 making de-serialization 

Re: Basic question on Developing FormComponentPanels

2011-07-11 Thread Igor Vaynberg
we override convertinput() so code like this still works

formcomponentpanelfoo p=new formcomponentpanelfoo(...);
p.add(new ivalidatorfoo() { })

if we do not override convertinput then the validator will not have a
value to validate

-igor

On Mon, Jul 11, 2011 at 6:28 AM, Nazaret Kazarian
nazaret.kazar...@gmail.com wrote:
 The recommended way for developing a FormComponentPanel is to override
 onBeforeRender and convertInput. My question is my not override
 updateModel() to synchronize the model of the custom
 FormComponentPanel with the models of the nested components instead of
 overriding convertInput? Wouldn't that be more symmetrical with
 onBeforeRender?

 model - nestedModels (onBeforeRender)
 nestedModel - model (onUpdate).

 Thanks!

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



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



Re: Getting A Random Localized Resource (CSS Image) Instead Of Page

2011-07-11 Thread Horacio Natyural
is this sort of related to wicket-2204 ?
i've seen this issue in the tracker

On Mon, Jul 11, 2011 at 9:41 PM, Horacio Natyural
horacio.natyu...@gmail.com wrote:
 btw,

 before the error occurrs,
 there would be instances in which the server would not reply
 here's an example scenario.

  a. Was able to login ppoerly
                        b. Updated a client info (changed the
 alternate email address)
                        c. Clicked the Transfer link, inputted  the
 necessary information and clicked the Submit button, nothing
                                   d. Clicked again the submit button,
 nothing happend again.
                        5. Clicked the Refresh button

 The CSS image then appears
 there awere also instances in which the link was clicked, did not
 reply. then after clicking again, the css image appeared again.

 any ideas?




 On Mon, Jul 11, 2011 at 8:41 PM, Horacio Natyural
 horacio.natyu...@gmail.com wrote:
 does it have any effect?

 On Mon, Jul 11, 2011 at 7:45 PM, Horacio Natyural
 horacio.natyu...@gmail.com wrote:
 thanks for the info..

 martin,

 someone used

 getRequestCycle().setRedirect(true);

 Thanks for all the help


 On Mon, Jul 11, 2011 at 6:05 PM, Wilhelmsen Tor Iver toriv...@arrive.no 
 wrote:
 From: Horacio Natyural [mailto:horacio.natyu...@gmail.com]
 What are the implications of this error message?

 Wicket will ignore any overriding (on the Page level) of the property, 
 only the component's own (and the Application's?) properties files will be 
 used.

 E.g. if FooComponent.properties has
 fie=Some default

 and FooPage.properties has
 myfoocomponent.fie=Another value

 then calling getString(fie) in the constructor will return Some 
 default because there is no FooPage in the hierarchy yet.

 - Tor Iver

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






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



Re: Skip validation on nested form's form level validators

2011-07-11 Thread Christian Huber

Hi,

well i _could_ decouple the two forms but that would kinda break my 
usecase and also the layout due to the changed component hierarchy.


Removing and readding the validators does not strike me as a good idea 
though, that would mean that the outer form would have knowledge about 
the internals of the inner form, which would break not only cohesion but 
also the law of demeter.


I was thinking that since there is a defined way to let a form decide 
for itself if it's component's validators should be executed that there 
might also be a similar way to do this for form level validators. But it 
seems that this is not the case. So I guess I will try disabling the 
default form processing on the outer form and call it's component's 
validators manually in the onsubmit method of the corresponding button.


Anyway thanks for your time.

Am 11.07.2011 15:01, schrieb Andrea Del Bene:

Hi,

why don't simply put the inner form out of the outer one? Anyway, you 
could remove inner form's validators before the outer form is 
submitted and add them again when submit process is over 
(onFormSubmitted() )

Hi all,

I have two forms nested within each other (wicket 1.4.17). The inner 
form adds data to the model of the outer form via ajax when it's 
button is pressed while the outer form saves the data to the database 
when the outer form's submit button is pressed.


Both forms have validators attacehd to them and their components. and 
of course the inner form's validators must not be executed when the 
outer form is submitted. Having the inner form implement 
IFormVisitorParticipant and then check if the submitting button was 
it's own avoids the inner form's component's validators to be 
executed. But validators applied to the inner form directly (e.g. 
EqualInputValidators etc.) are still executed and in my case causing 
the request to die horribly because the requred data just is not there.


I was looking for an elegant way to solve this but since all validate 
methods in the hierarchy are final I cannot hook any code into the 
form's on validation cycle. The method onValidate is not called (I 
guess that is because the form is validated as the outer form's 
child). All other methods that allow me to achieve the deisred 
behavior (like isEnabled) are too general cause side effects like 
disabling the form. At the moment the only way I can think of is to 
disable default form processing and then call the validators manually 
which is not very appealing to me.


Is there another way how this can be done?

Cheers,
Chris




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



--
The Sanity Resort http://sanityresort.blogspot.com/


Sessions and Login Redirection

2011-07-11 Thread Dan Retzlaff
Hi all,

Our application's home / login page is stateless, so its initial request
doesn't establish a session. In the login form's onSubmit the user is
authenticated, his credentials are put into the session, and he is
redirected to a page that requires the user to be authenticated. The problem
is that the onSubmit response (an HTTP redirection) does not set the session
cookie, so the credentials get lost.

Is this an HTTP or servlet limitation associated with redirects? Is there a
solution that doesn't require the page to be stateful?

Thanks!
Dan


Re: Sessions and Login Redirection

2011-07-11 Thread Martijn Dashorst
Use session.bind() to actually bind the session. Otherwise WIcket is
in the dark that you actually want to keep the session around...

Martijn

On Mon, Jul 11, 2011 at 10:10 PM, Dan Retzlaff dretzl...@gmail.com wrote:
 Hi all,

 Our application's home / login page is stateless, so its initial request
 doesn't establish a session. In the login form's onSubmit the user is
 authenticated, his credentials are put into the session, and he is
 redirected to a page that requires the user to be authenticated. The problem
 is that the onSubmit response (an HTTP redirection) does not set the session
 cookie, so the credentials get lost.

 Is this an HTTP or servlet limitation associated with redirects? Is there a
 solution that doesn't require the page to be stateful?

 Thanks!
 Dan




-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: Sessions and Login Redirection

2011-07-11 Thread Dan Retzlaff
That's it. I now call session.bind() in requestCycle.onEndRequest() if
credentials are set. I thought I'd tried that before, but I must have
deployed or tested incorrectly. Thanks, Martijn.

On Mon, Jul 11, 2011 at 1:35 PM, Martijn Dashorst 
martijn.dasho...@gmail.com wrote:

 Use session.bind() to actually bind the session. Otherwise WIcket is
 in the dark that you actually want to keep the session around...

 Martijn

 On Mon, Jul 11, 2011 at 10:10 PM, Dan Retzlaff dretzl...@gmail.com
 wrote:
  Hi all,
 
  Our application's home / login page is stateless, so its initial request
  doesn't establish a session. In the login form's onSubmit the user is
  authenticated, his credentials are put into the session, and he is
  redirected to a page that requires the user to be authenticated. The
 problem
  is that the onSubmit response (an HTTP redirection) does not set the
 session
  cookie, so the credentials get lost.
 
  Is this an HTTP or servlet limitation associated with redirects? Is there
 a
  solution that doesn't require the page to be stateful?
 
  Thanks!
  Dan
 



 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com

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




Re: YSlow still complaining Add Expires headers

2011-07-11 Thread Peter Karich
 Am 11.07.2011 14:44, schrieb Martin Grigorov:
 See what happens in
 org.apache.wicket.markup.html.WebResource.setHeaders(WebResponse).
 Then check the response headers for your resources.

 I guess that your resources are located next to WEB-INF folder and are
 delivered directly by the web container and thus Wicket doesn't set
 the headers.
 If this is the case then you here are two options:
 - check your web container documentation
 - add a filter in web.xml that will set the headers for all requests
 to /css/*.css, /js/*.js, ...

Thanks Martin, that helped! I wrote a filter:

@Override public void doFilter(ServletRequest request, ServletResponse
response,
FilterChain chain) throws IOException, ServletException {

HttpServletResponse rsp = (HttpServletResponse) response;
SimpleDateFormat formatter = new
SimpleDateFormat(Helper.cacheDateFormatString);
formatter.setTimeZone(TimeZone.getTimeZone(GMT));
int minutes = 30 * 24 * 60;
rsp.setHeader(Cache-Control, public, max-age= + minutes * 60);
chain.doFilter(request, response);
}

Also this helped with all the confusing options in the header:
http://onjava.com/pub/a/onjava/2004/03/03/filters.html?page=2

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



RE: [ANNOUNCE] Wicketopia 0.9 Released...

2011-07-11 Thread androidcoolguy

I am working on making it works on GAE/J. But stuck at
bean id=dataSource 
class=org.springframework.jdbc.datasource.DriverManagerDataSource  property 
name=driverClassName value=org.vnetcon.blobdb.driver.jdbc.BlobDBDriver /  
property name=url 
value=blobdb|http://localhost:/blobdb/ws|username=username|password=password
 /  property name=username value=sa /  property name=password 
value= //bean
And the partial error -
WARNING: Could not obtain connection to query metadatajava.sql.SQLException: 
URL is not in the correct format: 
blobdb|http://localhost:/blobdb/ws|username=username|password=password  
 at 
com.google.cloud.sql.jdbc.internal.Exceptions.driverUrlNotInCorrectFormat(Exceptions.java:103)
   at com.google.cloud.sql.jdbc.Driver.connect(Driver.java:47) at 
com.google.cloud.sql.jdbc.Driver.connect(Driver.java:24) at 
java.sql.DriverManager.getConnection(DriverManager.java:582) at 
java.sql.DriverManager.getConnection(DriverManager.java:154) at 
org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:173)
I posted the error with GAE forum :)
Will let you know how it goes.
J
Date: Sun, 10 Jul 2011 20:21:13 -0700
From: ml-node+3658631-962999233-250...@n4.nabble.com
To: androidcool...@hotmail.com
Subject: Re: [ANNOUNCE] Wicketopia 0.9 Released...



Hi James

Great effort mate thanks, Haven't had a look as yet am sure it will be

useful. If you need help with documentation do let us know


Cheers



On Mon, Jul 11, 2011 at 8:51 AM, androidcoolguy

[hidden email]wrote:


 Ok after some struggling, I managed to get it work. I noticed that

 Wicketopia

 has a tight coupling with Hibernate, especially -



bean id=persistenceProvider

 class=org.wicketopia.persistence.hibernate.HibernatePersistenceProvider

property name=sessionFactory ref=sessionFactory/

/bean



 And the codes needs sessionFactory to be initialized (not null), in order

 to

 work. That was why I were having NPE.



 Is there any plan to support Google App Engine for Java? I can help out if

 you can give me some guidelines.



 Thanks for such an awesome framework!



 --

 View this message in context:

 http://apache-wicket.1842946.n4.nabble.com/ANNOUNCE-Wicketopia-0-9-Released-tp3418771p3658471.html
 Sent from the Users forum mailing list archive at Nabble.com.



 -

 To unsubscribe, e-mail: [hidden email]

 For additional commands, e-mail: [hidden email]













If you reply to this email, your message will be added to the 
discussion below:

http://apache-wicket.1842946.n4.nabble.com/ANNOUNCE-Wicketopia-0-9-Released-tp3418771p3658631.html



To unsubscribe from [ANNOUNCE] Wicketopia 0.9 Released..., 
click here.
Insert mode   

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ANNOUNCE-Wicketopia-0-9-Released-tp3418771p3661170.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Help with path mounting and static asset expiration

2011-07-11 Thread Todd Nine
Hi guys,
  We've just finished our first wicket app using wicket 1.4.17.

Everything works well, but we get a lot of resource requests for resource
that rarely change.  I've read a few blogs on the subject, and this one is
the closest to what I want to do, however it's not quite right.


http://techblog.molindo.at/2008/08/wicket-interface-speed-up-caching-resources-forever.html


This explicitly calls the code to wrap the resource, I don't want our
developers to have to do this.  We have several templates that use wicket's
autolinking feature, so I would like them to be able to use it as well.


Here's what I currently have.


A Custom resource loader that is simply a wrapper and delegates to
WebApplicationPath for resource loading.

Once the resource is loaded, if it ends in .js, .css, or .png an SHA sum is
calculated on the file contents.I then want to create a mount path in
the format of original file_sha256.original extension


I also then need to wrap the created resource with an expiration time of now
+ 1 month.  This way, our images can be cached completely on the client.  In
the event the file changes, the sha256 sum will change, and hence so will
the file name's url, forcing the client to re-download the new content.

Any thoughts on how I can do this?  I'd prefer to only do it once the first
time the resource is loaded, but I can only seem to override the
ResourceFinder using the above logic,  which does not give me access to the
created ResourceReference itself with wicket expiration and other
properties.

I thought about using a listener, but this requires the mapping to happen
with each request, which seems very inefficient since it will only change at
deploy time.

Any help would be greatly appreciated, I'm at a bit of a loss on this one.

Thanks,
Todd


RE: [ANNOUNCE] Wicketopia 0.9 Released...

2011-07-11 Thread androidcoolguy
More good news. I used JPA provider instead of hibernate by looking at your
latest codes to make Wicketopia works on GAEJ.

Also have to change the JpaPersistenceProvider in such a way -

public int getCount(Class? entityType)
{
  Integer results = (Integer) entityManager.createQuery(select
count(obj) from  + entityType.getName() +  obj).getSingleResult();
  return results.intValue();
//List results = entityManager.createQuery(select count(*) from  +
entityType.getName()).getResultList();
//return ((Number)results.get(0)).intValue();
  
}

I left off at the create method while saving the Person. Error is -

java.lang.UnsupportedOperationException: This feature isn't available until
JPA 2.0

You can try yourself at http://cloudserviceapi.appspot.com/app/ to see the
error. Note that I removed some fields like start date and end date as they
were on my way to complete the port :(

I have proven my track record, could you make me a committer of project
Wicketopia now :) ?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ANNOUNCE-Wicketopia-0-9-Released-tp3418771p3661400.html
Sent from the Users forum mailing list archive at Nabble.com.

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