Incorrect session handling in a GAE environment

2012-10-03 Thread Ian Marshall
I get what appears to me to be incorrect session handling when the Apache
Wicket session size of my application approaches my self-imposed limit of
900kB (which itself is near the Google App Engine (GAE) limit of 1MB).

I see flash messages set during the composition of a web response using

  org.apache.wicket.Session#info(Serializable message)

occur again after the subsequent web response, even though no flash message
was set subsequently.

I believe that this effect might be due to the large session size and
either:

  ·  the Wicket app's interplay of:
 ·  IStoreSettings#setMaxSizePerSession(...)
 ·  DefaultPageManagerProvider
 ·  MemorySizeEvictionStrategy

  or

  ·  GAE's session handling

causing incorrect operation.

Has anyone else encountered this problem or does anyone have any suggestion
as to what I can do?



*My code*
public class MyApplication extends WebApplication
{

  ...

  // GAE has a maximum session size of 1MB
  private static final Bytes G_BY_MAXIMUM_SIZE_SESSION_PAGE_INSTANCES =
   Bytes.kilobytes(900);

  @Override
  protected void init()
  {
super.init();

...

IStoreSettings ssStoreSettings = getStoreSettings();
ssStoreSettings.setMaxSizePerSession(
 G_BY_MAXIMUM_SIZE_SESSION_PAGE_INSTANCES);

// This prevents use of a new AsynchronousDataStore instance,
// which attempts to start a new thread. This is forbidden by GAE.
ssStoreSettings.setAsynchronous(false);

IPageManagerContext pmcPageManagerContext = getPageManagerContext();
DataStoreEvictionStrategy dsevEvictionStrategy =
 new
MemorySizeEvictionStrategy(G_BY_MAXIMUM_SIZE_SESSION_PAGE_INSTANCES);
GaePageManagerProvider pmpPageManagerProvider = new
GaePageManagerProvider(
 this, pmcPageManagerContext, dsevEvictionStrategy);
setPageManagerProvider(pmpPageManagerProvider);

...
  }

  ...
}


...


/**
 * This class extends DefaultPageManagerProvider as required to
 * conform to Google App Engine restrictions.
 */
public class GaePageManagerProvider extends DefaultPageManagerProvider
{
  private static final Logger m_logger = Logger.getLogger(
   GaePageManagerProvider.class.getName());

  private IPageManagerContext m_pmcPageManagerContext = null;
  private DataStoreEvictionStrategy m_dsevEvictionStrategy = null;

  /**
   * The constructor.
   * @param app
   *   The instance of the application.
   *   This must not be null.
   * @param pmcPageManagerContext
   *   The application's page manager context.
   * @param dsevEvictionStrategy
   *   The data store eviction strategy to be used.
   */
  public GaePageManagerProvider(Application app,
   IPageManagerContext pmcPageManagerContext,
   DataStoreEvictionStrategy dsevEvictionStrategy)
  {
super(app);
m_pmcPageManagerContext = pmcPageManagerContext;
m_dsevEvictionStrategy = dsevEvictionStrategy;
  }

  @Override
  protected IDataStore newDataStore()
  {
IDataStore dsResult = null;

dsResult = new HttpSessionDataStore(m_pmcPageManagerContext,
 m_dsevEvictionStrategy)
{
  // This method override is for logging purposes only
  @Override
  public void storeData(String sessionId, int pageId,
   byte[] pageAsBytes)
  {
int nPageSize = -1;
if (pageAsBytes != null)
  nPageSize = pageAsBytes.length;

final int N_SIZE_FINE= 10;
final int N_SIZE_INFO= 50;
final int N_SIZE_WARNING = 80;
if (nPageSize >= N_SIZE_FINE)
{
  Level lvl;
  if (nPageSize >= N_SIZE_WARNING)
lvl = Level.WARNING;
  else if (nPageSize >= N_SIZE_INFO)
lvl = Level.INFO;
  else
lvl = Level.FINE;

  m_logger.log(lvl, String.format("Storing a page in the"
   + " application's DefaultPageManagerProvider's"
   + " HttpSessionDataStore with parameters:"
   + "\n sessionId  = %s,"
   + "\n pageId = %d,"
   + "\n pageAsBytes.length = %d", sessionId, pageId, nPageSize));
}

super.storeData(sessionId, pageId, pageAsBytes);
  }
};

return dsResult;
  }
}



*My development environment*
Java: 1.6.0_35; Java HotSpot(TM) Client VM 20.10-b01
GAE/J SDK:1.7.2
Web framework:Apache Wicket 1.5.8
Web browser:  Mozilla Firefox 15.0.1
Operating system: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
IDE:  NetBeans 7.2 (build 201207171143)




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Incorrect-session-handling-in-a-GAE-environment-tp4652636.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



Reseting a textField of an upload form

2012-10-03 Thread antechrestos
Hello,

I have an upload form with a TextField and a FileUploadField. When the user
fill the form and press an AjaxButton, it refreshes the RefreshingView
listing the files already uploaded.
What I would like to do is clear the textfield when the form is submitted.
I already tried to add the text field in the AjaxRequestTarget of the
submitting button after having cleared the model object. Apparently it works
but when I try to submit a new time, it keeps sending null value in my model
object.
I also tried to update the model object by adding a
AjaxFormComponentUpdatingBehavior to the TextField and update the model
object from there: I see the new value entered, but when the user presses
the submit button, it keeps sending me null
I must be missing a things but I am totally lost :(




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Reseting-a-textField-of-an-upload-form-tp4652632.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



BackButton support Browser Compatibility issue

2012-10-03 Thread vidhi
Hello everyone,

  I am a newbie evaluating wicket framework for development and I have
encountered a problem while trying to implement the Browser BackButton
support feature of wicket.

  After reading the documentation and forum discussions on the same topic I
tried to put my components and everything in a form and used the -

 form.setVersioned(true); 

for enabling the Browser BackButton Support.

  This works fine for Mozilla Firefox. However, the Back Button of Chrome
and Internet Explorer fails to deliver the same functionality. This issue
has created concern in my further exploration of wicket. Please help.

Thanks in advance.

Vidhi



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/BackButton-support-Browser-Compatibility-issue-tp4652629.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: Configurable Resource's url (use CDN or not)

2012-10-03 Thread David Loidolt
Dear All,

I'm currently experiencing some problems using SimpleCDN in Wicket 1.5.4 in
combination with mountResource for image/texttemplate/css resources. 
When used, the according resources are then no longer resolved via CDN but
served from the origin host as relative paths.

Works:
-- Inside WebPage constructor
add(new Image("Logo",new
PackageResourceReference(ResourcesImagesScope.class, "images/logo.png")));

-- Markup


-- Result

 

Does not work:

-- Inside WebPage constructor
add(new Image("Logo",new
PackageResourceReference(ResourcesImagesScope.class, "images/logo.png")));

-- Inside init() of extended WebApplication (for a nice url-path)
mountResource("images/images/logo.png", new
PackageResourceReference(ResourcesImagesScope.class, "images/logo.png"));

-- Result
  (-->
https://www.mydomain.com/images/logo-ver-1349261626000.png)


So as you can see, as soon as I remove the mountResource the image is
resolved correctly.
Also when I set a break point insides SimpleUrl mapUrl function, the
resource never shows up if mountResource has been called for it bevore.

Any ideas on why mountResource is causing this impact?

Thanks,
Cheers, David



-
“In the middle of difficulty lies opportunity.” Albert Einstein 
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Configurable-Resource-s-url-use-CDN-or-not-tp3899388p4652638.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: Add bottom row to editable tree table

2012-10-03 Thread Martin Grigorov
Hi,

I think you just need to update its model with an additional
entry/node and repaint it.

On Wed, Oct 3, 2012 at 9:36 PM, grazia  wrote:
> Would it be possible to modify a tree table by adding the "Add" and "Delete"
> functionality ?
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Add-bottom-row-to-editable-tree-table-tp4652637.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: Appending to CSS url to prevent caching.

2012-10-03 Thread Jeffrey Schneller
You could just add your own cache buster.  You could do something like:

  String cachebuster = "something that will always be unique - maybe time 
stamp";
  response.renderCSSReference("style/theme.css?" + cachebuster);

not sure if this will bust the cache because the file is really the same.

-or-

  String cachebuster = "something that will always be unique - maybe time 
stamp";
  response.renderCSSReference("style/theme-" + cachebuster + ".css");

Then you just need a url rewrite rule to change it back to style/theme.css on 
the server.  I use something similar to this and it works great.



-Original Message-
From: dickster [mailto:derek.i...@gmail.com] 
Sent: Tuesday, October 02, 2012 5:09 PM
To: users@wicket.apache.org
Subject: Re: Appending to CSS url to prevent caching.

sorry, i didn't give a great example.

here's something better.
  response.renderCSSReference("style/theme.css");
it renders the
   html without 
the version parameter appended.

maybe i need to do something like...
response.renderCssReference(new CachingReference("style/theme.css"))???


thanks,
derek.





On Tue, Oct 2, 2012 at 4:31 PM, Martin Grigorov-4 [via Apache Wicket] <
ml-node+s1842946n4652625...@n4.nabble.com> wrote:

> On Tue, Oct 2, 2012 at 6:46 PM, dickster <[hidden 
> email]>
> wrote:
> > i tried using...
> > getResourceSettings().setCachingStrategy(new
> > FilenameWithVersionResourceCachingStrategy(new
> > MessageDigestResourceVersion()));
> >
> > ...but not all of my urls are rewritten.  the wiquery ones are but 
> > the
> one's
> > i've added via...
> >  renderHead(response) {
> >response.renderCssReference("blah");
>
> What kind of CSS this produces ?
> I think this generates:
> 
> blah
> 
> directly in the page markup. If I'm correct then there is no need to 
> add anti-caching here because next render of the page will deliver 
> whatever is needed.
> Only external file resources can be cached.
>
> > }
> > ...don't get appended with version MD5.
> > do i have to use different technique for adding them?  (is my 
> > current
> way of
> > adding them not the preferred way?)
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Appending-to-CSS-url-to-pre
> vent-caching-tp4652508p4652618.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]
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.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/Appending-to-CSS-url-to-pre
> vent-caching-tp4652508p4652625.html
>  To unsubscribe from Appending to CSS url to prevent caching., click 
> here tp?macro=unsubscribe_by_code&node=4652508&code=ZGVyZWsuaXBvZEBnbWFpbC5
> jb218NDY1MjUwOHwtMjM5OTAwMTA0>
> .
> NAML tp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabbl
> e.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamesp
> ace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscrib
> ers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_in
> stant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Appending-to-CSS-url-to-prevent-caching-tp4652508p4652626.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: Reseting a textField of an upload form

2012-10-03 Thread Andrea Del Bene

Hi,

can you show the code you use to clear the model object of the textfield?

Hello,

I have an upload form with a TextField and a FileUploadField. When the user
fill the form and press an AjaxButton, it refreshes the RefreshingView
listing the files already uploaded.
What I would like to do is clear the textfield when the form is submitted.
I already tried to add the text field in the AjaxRequestTarget of the
submitting button after having cleared the model object. Apparently it works
but when I try to submit a new time, it keeps sending null value in my model
object.
I also tried to update the model object by adding a
AjaxFormComponentUpdatingBehavior to the TextField and update the model
object from there: I see the new value entered, but when the user presses
the submit button, it keeps sending me null
I must be missing a things but I am totally lost :(




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Reseting-a-textField-of-an-upload-form-tp4652632.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: Reseting a textField of an upload form

2012-10-03 Thread Paul Bors
I would also suggest getting familiar with Wicket's home page and making use
of the Live example from under the Learn left navigation section:
http://wicket.apache.org/learn/examples/

follow the examples Wicket has at:
http://www.wicket-library.com/wicket-examples/index.html

Start from the component examples at:
http://www.wicket-library.com/wicket-examples/compref/

Or the Ajax ones:
http://www.wicket-library.com/wicket-examples/ajax/

More precisely the one on File Upload via Ajax:
http://www.wicket-library.com/wicket-examples/ajax/upload

And take a look at its source code:
http://www.wicket-library.com/wicket-examples/ajax/wicket/bookmarkable/org.a
pache.wicket.examples.source.SourcesPage;jsessionid=CD0504C6E5FC8905084418BD
3FCF45A0?0&SourcesPage_class=org.apache.wicket.examples.ajax.builtin.Index&s
ource=FileUploadPage.java

~ Thank you,
  Paul Bors

-Original Message-
From: Andrea Del Bene [mailto:an.delb...@gmail.com] 
Sent: Wednesday, October 03, 2012 4:34 PM
To: users@wicket.apache.org
Subject: Re: Reseting a textField of an upload form

Hi,

can you show the code you use to clear the model object of the textfield?
> Hello,
>
> I have an upload form with a TextField and a FileUploadField. When the 
> user fill the form and press an AjaxButton, it refreshes the 
> RefreshingView listing the files already uploaded.
> What I would like to do is clear the textfield when the form is submitted.
> I already tried to add the text field in the AjaxRequestTarget of the 
> submitting button after having cleared the model object. Apparently it 
> works but when I try to submit a new time, it keeps sending null value 
> in my model object.
> I also tried to update the model object by adding a 
> AjaxFormComponentUpdatingBehavior to the TextField and update the 
> model object from there: I see the new value entered, but when the 
> user presses the submit button, it keeps sending me null
> I must be missing a things but I am totally lost :(
>
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Reseting-a-textField-of-an-
> upload-form-tp4652632.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



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