Re: Can the ILinkListener on-click URL be made case insensitive?

2014-05-15 Thread Ian Marshall
Thanks for the info, Martin.



Martin Grigorov-4 wrote
 Hi,
 
 There is no way provided by Wicket itself.
 You can setup custom root IRequestMapper that fixes this before passing
 the
 Request to be handled by Wicket's default mappers.
 Fixing 'ibehaviorlistener to IBehaviorListener will be easy. But
 inkmylink (a random component id in your app) to  InkMyLink won't be
 that easy.
 
 Martin Grigorov
 Wicket Training and Consulting
 
 
 On Tue, May 6, 2014 at 3:52 PM, Ian Marshall lt;

 IanMarshall.UK@

 gt;wrote:
 
 Hello,

 I have a standard stateless link with an on-click handler.

 Does anyone know of a way to either allow case-insensitivity for URLs of
 components and their listeners or else for the application to render
 these
 in all lower case? (This is because web requests by bots can be made to a
 link listener all in lower case after the page version number:
 /main/MyPage?-2.ilinklistener-lnkmylink.)

 The HTML and code for my link follows:

 HTML
 


 Java code
 -
 public class MyPageBase extends org.apache.wicket.markup.html.WebPage
 {
   [...]

   StatelessLink lnkMyLink = new StatelessLink(lnkMyLink)
   {
 private static final long serialVersionUID = 1L;

 @Override
 public void onClick()
 {
   [...]
 }
   };
   add(lnkMyLink);
 }


 This results in the following HTML being sent to a web browser:




 I have discovered that the web site is crawled by a bot that uses URLs
 all
 in lower case after the page version number. So the web server produces
 an
 error of the form:

 /main/PageHome?-2.iLinkListener-lnkMyLink 404 77ms 0kb Mozilla/5.0
 (Windows
 NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0 module=default
 version=51-vaxmk2od

 92.18.236.103 - - [06/May/2014:03:50:44 -0700] GET
 /main/MyPage?-2.ilinklistener-lnkmylink HTTP/1.1 404 263 - Mozilla/5.0
 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0 [URI]
 ms=78
 cpu_ms=43 cpm_usd=0.29 app_engine_release=1.9.4
 instance=00c61b117c8b6bedc38e2c09ba2915c08a572f

 org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper
 processListener: Unknown listener interface 'ilinklistener'

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Can-the-ILinkListener-on-click-URL-be-made-case-insensitive-tp4665709.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: 

 users-unsubscribe@.apache

 For additional commands, e-mail: 

 users-help@.apache






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Can-the-ILinkListener-on-click-URL-be-made-case-insensitive-tp4665709p4665731.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



Can the ILinkListener on-click URL be made case insensitive?

2014-05-06 Thread Ian Marshall
Hello,

I have a standard stateless link with an on-click handler. 

Does anyone know of a way to either allow case-insensitivity for URLs of
components and their listeners or else for the application to render these
in all lower case? (This is because web requests by bots can be made to a
link listener all in lower case after the page version number:
/main/MyPage?-2.ilinklistener-lnkmylink.)

The HTML and code for my link follows:

HTML



Java code
-
public class MyPageBase extends org.apache.wicket.markup.html.WebPage
{
  [...]

  StatelessLink lnkMyLink = new StatelessLink(lnkMyLink)
  {
private static final long serialVersionUID = 1L;

@Override
public void onClick()
{
  [...]
}
  };
  add(lnkMyLink);
}


This results in the following HTML being sent to a web browser:




I have discovered that the web site is crawled by a bot that uses URLs all
in lower case after the page version number. So the web server produces an
error of the form:

/main/PageHome?-2.iLinkListener-lnkMyLink 404 77ms 0kb Mozilla/5.0 (Windows
NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0 module=default
version=51-vaxmk2od

92.18.236.103 - - [06/May/2014:03:50:44 -0700] GET
/main/MyPage?-2.ilinklistener-lnkmylink HTTP/1.1 404 263 - Mozilla/5.0
(Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0 [URI] ms=78
cpu_ms=43 cpm_usd=0.29 app_engine_release=1.9.4
instance=00c61b117c8b6bedc38e2c09ba2915c08a572f

org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper
processListener: Unknown listener interface 'ilinklistener'

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Can-the-ILinkListener-on-click-URL-be-made-case-insensitive-tp4665709.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: Twenty-Six Wicket Tricks Book

2013-02-15 Thread Ian Marshall
You could always visit the Coding: On Software Design Process section of
Jonathan's blog (it's an excellent book, by the way) and ask him your
question from there.

Ian


Sebastian Gaul wrote
 I cannot find anything related there. His blog started long after the
 book.
 Am 14.02.2013 14:51 schrieb Ian Marshall lt;

 IanMarshall.UK@

 gt;:
 
 Perhaps a good source of information is Jonathan's blog at:

http://codeact.wordpress.com lt;http://codeact.wordpress.comgt;

 Ian


 Sebastian Gaul wrote
  Does anyone know what happened to the book Twenty-Six Wicket Tricks
  by Jonathan Locke? Some code looks very promising and I would like to
  read it. However, the code seems to be very old and I cannot find any
  way to purchase the book. Is the project still alive?
 
  http://code.google.com/p/twenty-six-wicket-tricks/
 
  -
  To unsubscribe, e-mail:

  users-unsubscribe@.apache

  For additional commands, e-mail:

  users-help@.apache





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656367.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: 

 users-unsubscribe@.apache

 For additional commands, e-mail: 

 users-help@.apache








--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656414.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: Twenty-Six Wicket Tricks Book

2013-02-14 Thread Ian Marshall
Perhaps a good source of information is Jonathan's blog at:

   http://codeact.wordpress.com http://codeact.wordpress.com  

Ian


Sebastian Gaul wrote
 Does anyone know what happened to the book Twenty-Six Wicket Tricks
 by Jonathan Locke? Some code looks very promising and I would like to
 read it. However, the code seems to be very old and I cannot find any
 way to purchase the book. Is the project still alive?
 
 http://code.google.com/p/twenty-six-wicket-tricks/
 
 -
 To unsubscribe, e-mail: 

 users-unsubscribe@.apache

 For additional commands, e-mail: 

 users-help@.apache





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656367.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



Want to override FeedbackPanel to use GAE/J memcache in addition to the session

2013-02-04 Thread Ian Marshall
I am having trouble with intermittently missing Wicket session flash
messages. I refer to my post on StackOverflow at:

 
http://stackoverflow.com/questions/14344740/intermittently-missing-wicket-session-flash-messages

I would like to try to fix my problem by overriding FeedbackPanel to use
GAE/J's memory cache in addition to the session, in order to fill in flash
messages missing from the session with those in the GAE/J memory cache.

I failed in my attempt since, in my inexperienced view, the required methods
in FeedbackPanel were declared final.

Is there a way for me to override FeedbackPanel (or otherwise) to use a
complementary store in addition to the session, and for me to fill in any
flash messages that I deem to be missing?


Java code
-


HTML mark-up



My software environment
---
  Web framework: Apache Wicket 6.5.0
  Web server: Google App Engine for Java version 1.7.4
  Java version: 1.6.0_37; Java HotSpot(TM) Client VM 20.12-b01
  Operating system: Microsoft Windows XP version 5.1 running on x86



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Want-to-override-FeedbackPanel-to-use-GAE-J-memcache-in-addition-to-the-session-tp4656047.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: Wicket 6 API docs incomplete

2012-12-21 Thread Ian Marshall
That's good to hear, Martin. All seems to be fine now.

Ian


Martin Grigorov-4 wrote
 Hi,
 
 Thanks!
 This is known. It is because the last Javadoc build failed due to No
 space
 left on device:
 http://ci.apache.org/builders/wicket-master/builds/950/steps/MasterShellCommand/logs/stdio
 
 
 On Thu, Dec 20, 2012 at 7:27 PM, Ian Marshall lt;

 IanMarshall.UK@

 gt;wrote:
 
 Hello,

 I just wanted to let people know that the above javadocs are incomplete
 for
 me.

 Reproduction steps
 --
   ·  Visit the Apache Wicket home page at: http://wicket.apache.org
   ·  Follow the link API Docs | Wicket 6 at:
 http://ci.apache.org/projects/wicket/apidocs/6.0.x
   ·  Follow the link to the classes CheckBox or Label
   ·  I get the web response (404 -) No Such Resource - File not found.
   ·  The javadocs for Wicket 1.5 are fine for me.

 I hope this helps.

 Ian Marshall



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-6-API-docs-incomplete-tp4654977.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: 

 users-unsubscribe@.apache

 For additional commands, e-mail: 

 users-help@.apache



 
 
 -- 
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com lt;http://jweekend.com/gt;





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-6-API-docs-incomplete-tp4654977p4655011.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



Wicket 6 API docs incomplete

2012-12-20 Thread Ian Marshall
Hello,

I just wanted to let people know that the above javadocs are incomplete for
me.

Reproduction steps
--
  ·  Visit the Apache Wicket home page at: http://wicket.apache.org
  ·  Follow the link API Docs | Wicket 6 at:
http://ci.apache.org/projects/wicket/apidocs/6.0.x
  ·  Follow the link to the classes CheckBox or Label
  ·  I get the web response (404 -) No Such Resource - File not found.
  ·  The javadocs for Wicket 1.5 are fine for me.

I hope this helps.

Ian Marshall



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-6-API-docs-incomplete-tp4654977.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: Manual procedure to update Wicket for NetBeans

2012-11-22 Thread Ian Marshall
Martin Grigorov-4 wrote
 Hi,
 
 Please paste it here.
 Isn't it just download the jars from Maven repos or from Apache Dist and
 put them in your project structure ?
 
 
 On Wed, Nov 21, 2012 at 4:49 PM, Ian Marshall lt;

 IanMarshall.UK@

 gt;wrote:
 
 I develop my Wicket application using NetBeans and Ant (not Maven).
 ...
 
 
 -- 
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com lt;http://jweekend.com/gt;

Almost. I write a procedure to ensure that I do not forget anything. Perhaps
I am over-complicating things and am unaware of a much simpler way to do
this. Anyway, I copy my procedure below (edited for possible public
consumption).


UPDATING THE WICKET WEB FRAMEWORK WITHIN NETBEANS FOR ANT-BASED PROJECTS –
PROCEDURE


INTRODUCTION
This procedure assumes that the following Wicket .jar files only are needed:
wicket-core, wicket-request, wicket-util, wicket-devutils. It also assumes
that slf4j-jdk14 logging is needed by your web application.

Adjust the files to be lownloaded/used if you require a different set of
files.


PROCEDURE
Visit the Apache Wicket home web site to find out the latest version of
Wicket (or subscribe to Nabble Wicket announcements and find out that way).
If a new version of Wicket is to be used for your NetBeans project, then:
·  download:
   ·  apache-wicket-N.N.N.zip   (for source files)
   ·  apache-wicket-N.N.N-bin.zip   (for .jar files)
·  visit www.SLF4J.org to check for a new version of the SLF4J .jar files
used by Wicket and your web application.

If the latest version of Wicket is to be updated, then create a new NetBeans
Wicket Ant library. This will require the creation of a bespoke .zip file.
As a flexible guide only:

  lib files
  -
  Into a folder (such as
C:\Program Files\Apache Software Foundation\Wicket\NetBeans library\libs)
copy the files:

  ·  apache-wicket-N.N.N-bin\wicket-core-N.N.N.jar
  ·  apache-wicket-N.N.N-bin\wicket-request-N.N.N.jar
  ·  apache-wicket-N.N.N-bin\wicket-util-N.N.N.jar
  ·  apache-wicket-N.N.N-bin\wicket-devutils-N.N.N.jar
  ·  slf4j-api-N.N.N.jar and slf4j-jdkNN-N.N.N.jar.

  Under the NetBeans Wicket Ant library Classpath tag go all these new
files.

  
  src files
  -
  Into the bespoke .jar file wicket-N.N.N-sources-NB.jar in a folder (such
as
C:\Program Files\Apache Software Foundation\Wicket\NetBeans library\sources)
compress all files in:

  ·  apache-wicket-N.N.N\wicket-core\src\main\java
  ·  apache-wicket-N.N.N\wicket-request\src\main\java
  ·  apache-wicket-N.N.N\wicket-util\src\main\java
  ·  apache-wicket-N.N.N\wicket-devutils\src\main\java.
  
  Under the NetBeans Wicket Ant library Sources tag goes
wicket-N.N.N-sources-NB.jar.


  apidocs files
  -
  Visit http://maven.org and do an advanced search for group ID
“org.apache.wicket” and version “N.N.N”.

  Download the javadoc.jar files for the artifact IDs:

  ·  wicket-core
  ·  wicket-request
  ·  wicket-util
  ·  wicket-devutils

  of names of the form [Actifact ID]-N.N.N-javadoc.jar.

  Place these files into the a folder (such as
C:\Program Files\Apache Software Foundation\Wicket\NetBeans library\docs).


Adjust the new NetBeans Wicket Ant library to use the files copied/created
in the 3 folders as set out above.

Create and adjust your NetBeans project’s NetBeans libraries to use the new
Ant library you have just created (and to stop using the superseded Ant
library).

If NetBeans cannot find classes whilst compiling, editing an Ant library by
loading their files and/or folders anew may solve the problem.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Manual-procedure-to-update-Wicket-for-NetBeans-tp4654064p4654086.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: Manual procedure to update Wicket for NetBeans

2012-11-22 Thread Ian Marshall
Martin Grigorov-4 wrote
 Hi Ian,
 
 Thanks for sharing !
 
 May I ask you why you avoid Maven ?
 With Maven (and similar dependency management tools) I just change X.Y.Z
 to
 X.Y.Z+1 in one place and continue working without bothering with all these
 steps.

1.  The documentation for Google App Engine for Java (GAE/J) specifies
certain Ant scripts for doing useful things such as application building and
DataNucleus JDO datastore code enhancement, so I do not want to drop Ant.

2.  I know almost nothing above Maven, except that this seems to be simple
to use with little configuration required to obtain the .jar (and source?)
files needed (and perhaps build an application too?).

3.  I do not know if Maven and Ant are incompatible, although I feel that
they are.

To conclude, I feel that Maven is good and the modern, sensible way to go,
but for now I'll stick to Ant, in order to avoid the possible requirement to
change all my GAE/J Ant scripts to Maven things.

I'm happy to be told that I am wrong in all this!

I had to change my procedure for Wicket 6 to include the use of Maven.org,
in order to obtain source code files which I could no longer find in the
download mirrors. I shall be happy to update this procedure in the future to
reflect future changes or improvements if you want me to (just let me know
where it resides (if you want to use it)), even though I guess that Maven is
more the future than Ant is.


Ian



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Manual-procedure-to-update-Wicket-for-NetBeans-tp4654064p4654092.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: Manual procedure to update Wicket for NetBeans

2012-11-22 Thread Ian Marshall
Martin Grigorov-4 wrote
 [...]
 
 You can check http://ant.apache.org/ivy/. It adds dependency management to
 Ant.
 
 -- 
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com lt;http://jweekend.com/gt;

Thanks for the tip, Martin. I'll give Apache Ivy a look

Ian



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Manual-procedure-to-update-Wicket-for-NetBeans-tp4654064p4654096.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



Manual procedure to update Wicket for NetBeans

2012-11-21 Thread Ian Marshall
I develop my Wicket application using NetBeans and Ant (not Maven).

I have a manual procedure, which I use whenever I update my IDE to a new
version of Wicket (comprising downloading files and then creating a new
NetBeans Ant library). I have recently amended this to cater for changes
needed for Wicket 6.

(I maintain this procedure in the form of a LibreOffice Writer document.)

I am happy to show this procedure for review and possible subsequent
inclusion in a sensible place in the Wiki (or wherever), if any Wicket
developer so desires. Or I can simply paste it here.

Ian Marshall



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Manual-procedure-to-update-Wicket-for-NetBeans-tp4654064.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



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 codeDefaultPageManagerProvider/code 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 codenull/code.
   * @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



Re: Cookies not getting deleted

2012-07-30 Thread Ian Marshall
As well as setting the max age to zero, I also set the cookie's path to /.


kshitiz wrote
 
 Hi,
 
 I am trying to delete 2 cookies by using the code:
 
 
 *Cookie emailIdCookie = ((WebRequest)
 getRequestCycle()
   
 .getRequest()).getCookie(emailId);
 
   Cookie passwordCookie = ((WebRequest) 
 getRequestCycle()
   
 .getRequest()).getCookie(password);
 
   if (emailIdCookie != null  
 passwordCookie != null) {
 
   emailIdCookie.setMaxAge(0);
   ((WebResponse) 
 getRequestCycle().getResponse())
   
 .addCookie(emailIdCookie);
 
   passwordCookie.setMaxAge(0);
   ((WebResponse) 
 getRequestCycle().getResponse())
   
 .addCookie(passwordCookie);
 
   }
 *
 
 But they are not being removed. I have seen a post related to it but the
 person missed out path setting of the cookie. In my case,I am not setting
 any path. Do I need to set it?
 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Cookies-not-getting-deleted-tp4650876p4650877.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: Determine session size for Wicket 1.5

2012-07-17 Thread Ian Marshall
Thanks for the tip, Jochen.

I'm already doing that now, using Oracle's Java VisualVM


Jochen Mader wrote
 
 Get a heapdump, use yourkit/visualvm.
 
 On Mon, Jul 16, 2012 at 11:14 AM, Ian Marshall lt;IanMarshall.UK@gt;
 wrote:
 I don't think that I am getting the session size in the right place.
 Despite
 my session sizes being logged as very small at ~1.7kB using the Google
 App
 Engine (GAE) web development server, in GAE production I am getting
 session
 sizes approaching 1MB (and attempting to breach this GAE-imposed limit of
 1MB too).

 I shall have to try and find somewhere else to get a meaningful session
 size.



 Ian Marshall wrote

 Thanks Martin,

 I could not find onDetach() but found detach() so I have done this in my
 WebSession subclass:

   @Override
   public void detach()
   {
 long loSize = getSizeInBytes();
 m_logger.log(Level.FINE, String.format(Session size = %,dB.,
 loSize));
 super.detach();
   }

 This seems to be fine (my sessions seem very small at ~1.7kB - I must be
 doing something wrong) except that this method can be called several
 times
 as a result of one request.

 Thanks again,

 Ian



 Martin Grigorov-4 wrote

 Override Session#onDetach() and do it before calling super.onDetach().

 On Fri, Jul 13, 2012 at 2:01 PM, Ian Marshall lt;IanMarshall.UK@gt;
 wrote:
 Hello,

 Is there a good way to discover my serialised or
 about-to-be-serialised
 session size without adding the debug bar to my page?

 I currently use

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

 CloudSession ssnSession = (CloudSession)getSession();
 long loSize = ssnSession.getSizeInBytes();
 m_logger.log(Level.FINE, String.format(Session size = %,dB.,
 loSize));
   }

 in my WebPage subclass, but I suspect that this is the wrong place to
 examine the session size.

 My software environment is:

 Web framework: Wicket 1.5.7
 Web server system: Google App Engine for Java version 1.7.0
 Java: 1.6.0_33; Java HotSpot(TM) Client VM 20.8-b03
 Operating system: Microsoft Windows XP Home Edition version 2002
 SP3
 (version 5.1 running on x86; Cp1252; en_GB)


 Ian Marshall


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Determine-session-size-for-Wicket-1-5-tp4650050p4650543.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache

 
 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Determine-session-size-for-Wicket-1-5-tp4650050p4650569.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: Determine session size for Wicket 1.5

2012-07-16 Thread Ian Marshall
I don't think that I am getting the session size in the right place. Despite
my session sizes being logged as very small at ~1.7kB using the Google App
Engine (GAE) web development server, in GAE production I am getting session
sizes approaching 1MB (and attempting to breach this GAE-imposed limit of
1MB too).

I shall have to try and find somewhere else to get a meaningful session
size.



Ian Marshall wrote
 
 Thanks Martin,
 
 I could not find onDetach() but found detach() so I have done this in my
 WebSession subclass:
 
   @Override
   public void detach()
   {
 long loSize = getSizeInBytes();
 m_logger.log(Level.FINE, String.format(Session size = %,dB.,
 loSize));
 super.detach();
   }
 
 This seems to be fine (my sessions seem very small at ~1.7kB - I must be
 doing something wrong) except that this method can be called several times
 as a result of one request.
 
 Thanks again,
 
 Ian
 
 
 
 Martin Grigorov-4 wrote
 
 Override Session#onDetach() and do it before calling super.onDetach().
 
 On Fri, Jul 13, 2012 at 2:01 PM, Ian Marshall lt;IanMarshall.UK@gt;
 wrote:
 Hello,

 Is there a good way to discover my serialised or about-to-be-serialised
 session size without adding the debug bar to my page?

 I currently use

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

 CloudSession ssnSession = (CloudSession)getSession();
 long loSize = ssnSession.getSizeInBytes();
 m_logger.log(Level.FINE, String.format(Session size = %,dB.,
 loSize));
   }

 in my WebPage subclass, but I suspect that this is the wrong place to
 examine the session size.

 My software environment is:

 Web framework: Wicket 1.5.7
 Web server system: Google App Engine for Java version 1.7.0
 Java: 1.6.0_33; Java HotSpot(TM) Client VM 20.8-b03
 Operating system: Microsoft Windows XP Home Edition version 2002 SP3
 (version 5.1 running on x86; Cp1252; en_GB)


 Ian Marshall
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Determine-session-size-for-Wicket-1-5-tp4650050p4650543.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: Generic for FileUploadField model

2012-07-16 Thread Ian Marshall
For my FileUploadField field in a form, I use the model type

  Listorg.apache.wicket.markup.html.form.upload.FileUpload.


meduolis wrote
 
 Wicket version: 1.5.3
 Java version: 1.7.0_02
 
 Hello, how to properly set generic for FilUploadField model?
 
 I try like this, but it does not compile:
 
 
 I get error message
 
 
 If I make it ArrayList:
 
 
 Then it says:
 
 
 I'm really confused :)
 
 help, please
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Generic-for-FileUploadField-model-tp4650519p4650545.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: Generic for FileUploadField model

2012-07-16 Thread Ian Marshall
To explain better

My form has the component

  FileUploadField fufUploadImage = new FileUploadField(fufUploadImage);
  frmForm.add(fufUploadImage);

The form's model is a compound property model, constructed using a
LoadableDetachableModelMyModel.

MyModel includes the data member

  public transient ListFileUpload fufUploadImage = null;

I hope that this helps. Also, do visit

 
http://apache-wicket.1842946.n4.nabble.com/Converter-for-FileUpload-tp3881522p3882908.html

where Martin G helped me out on an allied issue.



For my FileUploadField field in a form, I use the model type

  Listorg.apache.wicket.markup.html.form.upload.FileUpload.


meduolis wrote
 
 Wicket version: 1.5.3
 Java version: 1.7.0_02
 
 Hello, how to properly set generic for FilUploadField model?
 
 I try like this, but it does not compile:
 
 
 I get error message
 
 
 If I make it ArrayList:
 
 
 Then it says:
 
 
 I'm really confused :)
 
 help, please


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Generic-for-FileUploadField-model-tp4650519p4650546.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: Determine session size for Wicket 1.5

2012-07-13 Thread Ian Marshall
Hello,

Is there a good way to discover my serialised or about-to-be-serialised
session size without adding the debug bar to my page?

I currently use

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

CloudSession ssnSession = (CloudSession)getSession();
long loSize = ssnSession.getSizeInBytes();
m_logger.log(Level.FINE, String.format(Session size = %,dB., loSize));
  }

in my WebPage subclass, but I suspect that this is the wrong place to
examine the session size.

My software environment is:

Web framework: Wicket 1.5.7
Web server system: Google App Engine for Java version 1.7.0
Java: 1.6.0_33; Java HotSpot(TM) Client VM 20.8-b03
Operating system: Microsoft Windows XP Home Edition version 2002 SP3
(version 5.1 running on x86; Cp1252; en_GB)


Ian Marshall



Walter Rugora wrote
 
 Thanks Jeremy, works great!!!
 
 On 23/06/12 23:23, Jeremy Thomerson wrote:
 On Fri, Jun 22, 2012 at 11:28 PM, Walter Rugora lt;mist@gt; wrote:
 
 Hi,

 when I apply the Wicket 1.3 way to determine session size,
 RequestCycle.get().getSession().getSizeInBytes()
 it results in an around 3000bytes value in my case. And adding or
 removing Labels changed the session size.

 Now with Wicket 1.5 using
 Session.get().getSizeInBytes()
 session size is 857bytes. And I can add or remove as many Lables as I
 wish, that size stays the same. Obviously I use it wrong. Currently I
 just add the session size result to a Label added to my single WebPage:
 public HomePage(final PageParameters parameters) {
  ...
  add(new Label(ssize,
 String.valueOf(Session.get().getSizeInBytes(;
  ...
 }

 
 Here you're doing it in the constructor.  So, if this is the first page
 you
 visit there won't be any (Wicket) stuff in the session yet.
 
 Have you tried just adding the debug bar to your page?  Add a dependency
 to
 wicket-devutils in your pom.xml and then add(new DebugBar(someID)); to
 your page (and add it to the markup obviously).
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Determine-session-size-for-Wicket-1-5-tp4650050p4650510.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: Determine session size for Wicket 1.5

2012-07-13 Thread Ian Marshall
Thanks Martin,

I could not find onDetach() but found detach() so I have done this in my
WebSession subclass:

  @Override
  public void detach()
  {
long loSize = getSizeInBytes();
m_logger.log(Level.FINE, String.format(Session size = %,dB., loSize));
super.detach();
  }

This seems to be fine (my sessions seem very small at ~1.7kB - I must be
doing something wrong) except that this method can be called several times
as a result of one request.

Thanks again,

Ian



Martin Grigorov-4 wrote
 
 Override Session#onDetach() and do it before calling super.onDetach().
 
 On Fri, Jul 13, 2012 at 2:01 PM, Ian Marshall lt;IanMarshall.UK@gt;
 wrote:
 Hello,

 Is there a good way to discover my serialised or about-to-be-serialised
 session size without adding the debug bar to my page?

 I currently use

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

 CloudSession ssnSession = (CloudSession)getSession();
 long loSize = ssnSession.getSizeInBytes();
 m_logger.log(Level.FINE, String.format(Session size = %,dB.,
 loSize));
   }

 in my WebPage subclass, but I suspect that this is the wrong place to
 examine the session size.

 My software environment is:

 Web framework: Wicket 1.5.7
 Web server system: Google App Engine for Java version 1.7.0
 Java: 1.6.0_33; Java HotSpot(TM) Client VM 20.8-b03
 Operating system: Microsoft Windows XP Home Edition version 2002 SP3
 (version 5.1 running on x86; Cp1252; en_GB)


 Ian Marshall


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Determine-session-size-for-Wicket-1-5-tp4650050p4650513.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: setResponsePage swallows my session feedback messages

2012-06-29 Thread Ian Marshall
Hello Bertrand,

Where is your Page2 code fragment called? Is in the page constructor, in a
page component onSubmit() method, or somewhere else?

My guess is that your code fragment is called in the page constructor. If
this is so, then:

  ·  I might expect the differences in behaviour you experience between
setResponsePage(WebPage.class) and using a RestartResponseException (as
always, I am open to contradiction).
  ·  If possible, can you move your code to a component onSubmit() method
(of Page2 or the previous page, if any)?

Regards,

Ian



Bertrand Guay-Paquet wrote
 
 Hi,
 
 I have 2 pages, each with a feedback panel. Page2 does the following:
 setACookie();
 Session.get().info(blah);
 setResponsePage(Page1.class);
 
 The problem I have is that blah is never displayed in the feedback 
 panel of Page1. I stepped in the request processing code and found that 
 setResponsePage() actually renders the full current page before throwing 
 that away and issuing a 302 redirect. During this first (unused) 
 rendering of Page2, its feedback panel consumes all the session 
 messages. After the client follows the 302 and requests Page1, there are 
 no more session messages to display.
 
 Instead of setResponsePage, I can use a RestartResponseException to 
 redirect to Page1 and the session messages will then be displayed on 
 Page1 because Page2 is never rendered. However this has the important 
 downside of also throwing away all header information (e.g. cookies like 
 setACookie() above).
 
 Is there a way to both set a cookie and display the session message on 
 the response page?
 
 Bonus!
 I'm also wondering why, when setResponsePage() is used, the current page 
 is still rendered. I can think of 3 reasons why this should be avoided:
 1-Performance; it's wasteful to render components to discard them right
 away
 
 2-Components hierarchy; even if setResponsePage() is used in a page 
 constructor (e.g. when redirecting depending on page parameters), since 
 the page is rendered, all of its components or some substitutes must be 
 added to the page. Otherwise Wicket will throw a missing component 
 exception in dev mode.
 
 3-My use case; feedback messages registered in the session can be 
 swallowed by a feedback panel in the thrown away page rendering.
 
 Of course, I definitely don't have the complete picture and am just now 
 making some sense of how Wicket handles redirects and responses.
 
 Regards,
 Bertrand
 
 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-swallows-my-session-feedback-messages-tp4650274p4650278.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: setResponsePage swallows my session feedback messages

2012-06-29 Thread Ian Marshall
Hi Bertrand,

If you use

and then one of

in your Page2 constructor you should be able to pass (your cookie?) data to
your Page1, and you will see by trial and error whether your flash message
makes it to Page1 or not.

Regards,

Ian


Bertrand Guay-Paquet wrote
 
 Hi Ian,
 
 Thanks for your reply. By the way, I forgot to mention I'm using Wicket 
 1.5.7.
 
 The (pseudo) code I wrote in my previous email is in Page2's 
 constructor. I tried both approaches and here are the results:
 setResponsePage in page constructor:
 -Cookie not set === Cookie SET with patch from WICKET-4358
 -Session message not displayed on Page1
 
 setResponsePage in form onSubmit:
 -Cookie set
 -Session message displayed on Page1
 
 So you were right.
 
 However, I really need to redirect from a page constructor because Page2 
 is a callback url for an OAuth provider (Facebook in this case). It's 
 actually Facebook who redirects to Page1 and they don't allow query 
 parameters in the callback url so I can't use a link listener as a 
 workaround.
 
 Bertrand
 
 On 29/06/2012 4:21 AM, Ian Marshall wrote:
 Hello Bertrand,

 Where is your Page2 code fragment called? Is in the page constructor, in
 a
 page component onSubmit() method, or somewhere else?

 My guess is that your code fragment is called in the page constructor. If
 this is so, then:

·  I might expect the differences in behaviour you experience between
 setResponsePage(WebPage.class) and using a RestartResponseException (as
 always, I am open to contradiction).
·  If possible, can you move your code to a component onSubmit()
 method
 (of Page2 or the previous page, if any)?

 Regards,

 Ian



 Bertrand Guay-Paquet wrote
 Hi,

 I have 2 pages, each with a feedback panel. Page2 does the following:
 setACookie();
 Session.get().info(blah);
 setResponsePage(Page1.class);

 The problem I have is that blah is never displayed in the feedback
 panel of Page1. I stepped in the request processing code and found that
 setResponsePage() actually renders the full current page before throwing
 that away and issuing a 302 redirect. During this first (unused)
 rendering of Page2, its feedback panel consumes all the session
 messages. After the client follows the 302 and requests Page1, there are
 no more session messages to display.

 Instead of setResponsePage, I can use a RestartResponseException to
 redirect to Page1 and the session messages will then be displayed on
 Page1 because Page2 is never rendered. However this has the important
 downside of also throwing away all header information (e.g. cookies like
 setACookie() above).

 Is there a way to both set a cookie and display the session message on
 the response page?

 Bonus!
 I'm also wondering why, when setResponsePage() is used, the current page
 is still rendered. I can think of 3 reasons why this should be avoided:
 1-Performance; it's wasteful to render components to discard them right
 away

 2-Components hierarchy; even if setResponsePage() is used in a page
 constructor (e.g. when redirecting depending on page parameters), since
 the page is rendered, all of its components or some substitutes must be
 added to the page. Otherwise Wicket will throw a missing component
 exception in dev mode.

 3-My use case; feedback messages registered in the session can be
 swallowed by a feedback panel in the thrown away page rendering.

 Of course, I definitely don't have the complete picture and am just now
 making some sense of how Wicket handles redirects and responses.

 Regards,
 Bertrand

 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/setResponsePage-swallows-my-session-feedback-messages-tp4650274p4650278.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache


 
 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-swallows-my-session-feedback-messages-tp4650274p4650284.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: setResponsePage swallows my session feedback messages

2012-06-29 Thread Ian Marshall
Sorry,

raw HTML tag content did not make it to the E-mail

I meant:

If you use

  Session.get().info(blah);

and then one of

  throw new RestartResponseException(Page1.class, PageParameters params);
  throw new RestartResponseException(new Page1(...));

in your Page2 constructor you should be able to pass (your cookie?) data to
your Page1, and you will see by trial and error whether your flash message
makes it to Page1 or not (but without your cookies).

You're better off listening to Martin G: he knows what he is talking about
;)



Bertrand Guay-Paquet wrote
 
 Hi Ian,
 
 I'm sorry, I don't understand. Perhaps some parts of your message didn't 
 make it to the mailing list? (see If you use and and then one of).
 
 On 29/06/2012 9:39 AM, Ian Marshall wrote:
 Hi Bertrand,

 If you use

 and then one of

 in your Page2 constructor you should be able to pass (your cookie?) data
 to
 your Page1, and you will see by trial and error whether your flash
 message
 makes it to Page1 or not.

 Regards,

 Ian


 Bertrand Guay-Paquet wrote
 Hi Ian,

 Thanks for your reply. By the way, I forgot to mention I'm using Wicket
 1.5.7.

 The (pseudo) code I wrote in my previous email is in Page2's
 constructor. I tried both approaches and here are the results:
 setResponsePage in page constructor:
 -Cookie not set=== Cookie SET with patch from WICKET-4358
 -Session message not displayed on Page1

 setResponsePage in form onSubmit:
 -Cookie set
 -Session message displayed on Page1

 So you were right.

 However, I really need to redirect from a page constructor because Page2
 is a callback url for an OAuth provider (Facebook in this case). It's
 actually Facebook who redirects to Page1 and they don't allow query
 parameters in the callback url so I can't use a link listener as a
 workaround.

 Bertrand

 On 29/06/2012 4:21 AM, Ian Marshall wrote:
 Hello Bertrand,

 Where is your Page2 code fragment called? Is in the page constructor,
 in
 a
 page component onSubmit() method, or somewhere else?

 My guess is that your code fragment is called in the page constructor.
 If
 this is so, then:

 ·  I might expect the differences in behaviour you experience
 between
 setResponsePage(WebPage.class) and using a RestartResponseException (as
 always, I am open to contradiction).
 ·  If possible, can you move your code to a component onSubmit()
 method
 (of Page2 or the previous page, if any)?

 Regards,

 Ian



 Bertrand Guay-Paquet wrote
 Hi,

 I have 2 pages, each with a feedback panel. Page2 does the following:
 setACookie();
 Session.get().info(blah);
 setResponsePage(Page1.class);

 The problem I have is that blah is never displayed in the feedback
 panel of Page1. I stepped in the request processing code and found
 that
 setResponsePage() actually renders the full current page before
 throwing
 that away and issuing a 302 redirect. During this first (unused)
 rendering of Page2, its feedback panel consumes all the session
 messages. After the client follows the 302 and requests Page1, there
 are
 no more session messages to display.

 Instead of setResponsePage, I can use a RestartResponseException to
 redirect to Page1 and the session messages will then be displayed on
 Page1 because Page2 is never rendered. However this has the important
 downside of also throwing away all header information (e.g. cookies
 like
 setACookie() above).

 Is there a way to both set a cookie and display the session message on
 the response page?

 Bonus!
 I'm also wondering why, when setResponsePage() is used, the current
 page
 is still rendered. I can think of 3 reasons why this should be
 avoided:
 1-Performance; it's wasteful to render components to discard them
 right
 away

 2-Components hierarchy; even if setResponsePage() is used in a page
 constructor (e.g. when redirecting depending on page parameters),
 since
 the page is rendered, all of its components or some substitutes must
 be
 added to the page. Otherwise Wicket will throw a missing component
 exception in dev mode.

 3-My use case; feedback messages registered in the session can be
 swallowed by a feedback panel in the thrown away page rendering.

 Of course, I definitely don't have the complete picture and am just
 now
 making some sense of how Wicket handles redirects and responses.

 Regards,
 Bertrand

 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/setResponsePage-swallows-my-session-feedback-messages-tp4650274p4650278.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache


 -
 To unsubscribe, e-mail

Re: Adding Cookie in 1.5.5

2012-06-28 Thread Ian Marshall
Have you tried



wicket user wrote
 
 Hi, 
 
 I was trying to add a cookie 
  getWebRequestCycle().getWebResponse().addCookie() 
 
 but couldnt find getWebRequestCycle() in 1.5.5. 
 
 i found getRequestCycle() but did not find addCookie in getResponse(). 
 ((WebResponse)getRequestCycle().getResponse()).addCookie() should ideally
 work 
 not sure why isnt working
 Please suggest how to add/get cookie in 1.5.5 
 
 Thanks
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-Cookie-in-1-5-5-tp4650265p4650272.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: Wicket Page constructor getting called twice

2012-06-27 Thread Ian Marshall
Hello Nick and Martin,

Thank you for your replies.

I have added the following code in my subclassed WebApplication#init()
method, to be called when my application's RuntimeConfigurationType is
RuntimeConfigurationType.DEVELOPMENT:


I find no resultant


entry in my logs (created by EmptySrcAttributeCheckFilter). Thanks for
pointing out EmptySrcAttributeCheckFilter; I never knew it existed, and I
use it in development mode from now on. I have also searched my HTML for
empty src attributes, but I can find none.

I believe that I have found the reason for my subclassed WebPage constructor
being called twice. Whilst returning from the exernal web site, my browser
shows the dialog



It is my clicking of the Continue button which causes the 2nd call to the
WebPage constructor. The 1st call is already made when the dialog appears.

Thank you again for your help and tip, and have a good day,

Ian



Martin Grigorov-4 wrote
 
 Right,can lead to such behavior.
 Newer versions of Wicket (1.5+) have a preconfigured IResponseFilter
 which notifies you about such problem in DEV mode.
 You can also use CSS like: a[src = ] {color:red;} to see them easily.
 
 No matter what is the configured render strategy Wicket will call the
 page's constructor just once.
 _to_buffer strategy renders the page in the first request and save the
 html in a temporary place and just writes the plain html in the second
 request's response.
 
 
 On Mon, Jun 25, 2012 at 9:53 PM, Nick Heudecker lt;nheudecker@gt; wrote:
 I've only seen this type of behavior if I have an empty   
 element or something similar.



 On Mon, Jun 25, 2012 at 11:45 AM, Ian Marshall
 lt;IanMarshall.UK@gt;wrote:

 Hello All,

 My web application uses the default request cycle render strategy
 IRequestCycleSettings.RenderStrategy.REDIRECT_TO_BUFFER.

 An external web site calls a web page on my web application using a URL
 with
 page parameters (all of which I set before I hand over to the external
 web
 site). I find that the relevant WebPage constructor gets called twice
 during
 the request-response process, which I presume is expected behaviour:
 once
 to
 handle the action part of the request, again to handle the render part
 of
 the request.

 In the past, I bypassed this issue by showing an option with an OK
 button
 for action, so it didn't matter if the page constructor was called
 twice;
 no
 persistence code got executed until the user clicked OK subsequently.

 Now, however, I need to act on the request from the external web site
 straight away, in order to ensure that the database is updated before
 the
 user moves to another page without clicking OK (or away from my
 application altogether). Currently, I code this to happen in the page's
 constructor, so my database persistence code get called twice too. Not
 good,
 especially with Google App Engine, which does not like rapid updating of
 the
 same persistent entity group.

 My question is: is there a (simple) way for me to know whether my page
 is
 being constructed during the action part of the request as opposed to
 the
 render part of the request?

 (I have a work-around in mind, which is to store relevant details in the
 session, and use a check on these to prevent a second database
 persistence
 operation for the same data, but I would have thought that a simpler,
 more
 direct solution exists.)

 Any hints would be greatly appreciated.


 MY DEVELOPMENT ENVIRONMENT
 Web framework:     Wicket 1.5.7
 Java:              1.6.0_33; Java HotSpot(TM) Client VM 20.8-b03
 Web server system: Google App Engine for Java version 1.6.6
 Operating system:  Microsoft Windows XP Home Edition version 2002 SP3
                   (version 5.1 running on x86; Cp1252; en_GB) (nb)
 IDE:               NetBeans IDE 7.1.2 (Build 201204101705)


 Ian Marshall

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Page-constructor-getting-called-twice-tp4650225.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache


 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Page-constructor-getting-called-twice-tp4650225p4650254.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



Wicket Page constructor getting called twice

2012-06-25 Thread Ian Marshall
Hello All,

My web application uses the default request cycle render strategy
IRequestCycleSettings.RenderStrategy.REDIRECT_TO_BUFFER.

An external web site calls a web page on my web application using a URL with
page parameters (all of which I set before I hand over to the external web
site). I find that the relevant WebPage constructor gets called twice during
the request-response process, which I presume is expected behaviour: once to
handle the action part of the request, again to handle the render part of
the request.

In the past, I bypassed this issue by showing an option with an OK button
for action, so it didn't matter if the page constructor was called twice; no
persistence code got executed until the user clicked OK subsequently.

Now, however, I need to act on the request from the external web site
straight away, in order to ensure that the database is updated before the
user moves to another page without clicking OK (or away from my
application altogether). Currently, I code this to happen in the page's
constructor, so my database persistence code get called twice too. Not good,
especially with Google App Engine, which does not like rapid updating of the
same persistent entity group.

My question is: is there a (simple) way for me to know whether my page is
being constructed during the action part of the request as opposed to the
render part of the request?

(I have a work-around in mind, which is to store relevant details in the
session, and use a check on these to prevent a second database persistence
operation for the same data, but I would have thought that a simpler, more
direct solution exists.)

Any hints would be greatly appreciated.


MY DEVELOPMENT ENVIRONMENT
Web framework: Wicket 1.5.7
Java:  1.6.0_33; Java HotSpot(TM) Client VM 20.8-b03
Web server system: Google App Engine for Java version 1.6.6
Operating system:  Microsoft Windows XP Home Edition version 2002 SP3
   (version 5.1 running on x86; Cp1252; en_GB) (nb)
IDE:   NetBeans IDE 7.1.2 (Build 201204101705)


Ian Marshall

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Page-constructor-getting-called-twice-tp4650225.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: Favicon best practice

2012-04-27 Thread Ian Marshall
Thanks Jeffrey,

I put my favicon.ico where you suggested and made this my sole favicon file.
I did keep

  link rel=shortcut icon type=image/x-icon href=favicon.ico/

in the HTML of my base page in the hope that Microsoft will make Internet
Explorer 8 or above able to read the favicon in the future.

Mozilla Firefox 12.0 reads this fine. I see that IE8 may require an href
starting http://www.; for it to show the favicon. If so, to this
requirement I shall not bow.



Jeffrey Schneller wrote
 
 I just put the favicon.ico at the root of the WebContent directory and
 don't specify anything in the HTML.  I believe browsers look in the root
 unless specified differently in the html (like you are doing).
 
 BTW... app is on Apache + Tomcat and runs as the root app of the tomcat
 instance.
 
 
 
 -Original Message-
 From: Ian Marshall [mailto:IanMarshall.UK@] 
 Sent: Friday, March 30, 2012 4:14 PM
 To: users@.apache
 Subject: Re: Favicon best practice
 
 With Wicket 1.5.5, I have tried:
 
 In the HTML of my base page I have:
 
   link rel=shortcut icon type=image/x-icon href=favicon.ico/
 
 and in my WebApplication-descended application class, I have:
 
   @Override
   protected void init()
   {
 super.init();
 ...
 PackageResourceReference prrFavicon = new PackageResourceReference(
  ResourcesLocator.class, favicon.ico);
 mountResource(favicon.ico, prrFavicon);
   }
 
 Sadly, the favicon shown remains that stored in web/favicon.ico, not the
 favicon.ico file stored in the same folder as my ResourcesLocator class.
 
 Oh well, I shall just live with the favicon in my web folder, and leave
 the other one in place just in case.
 
 
 Ian Marshall wrote
 
 Alas I am getting MidasTouchCodingExceptions.
 
 I tried
 
   protected void init()
   {
 super.init();
 ...
 
 // New code
 ResourceReference rrefFavicon = new ResourceReference(
  ResourcesLocator.class, favicon.ico);
 IMountableRequestTargetUrlCodingStrategy mrtURLCodingStrategy =
  new SharedResourceRequestTargetUrlCodingStrategy(favicon.ico,
  rrefFavicon.getSharedResourceKey());
 
 // One of:
 mount(mrtURLCodingStrategy);
 mountSharedResource(favicon.ico,
 mrtURLCodingStrategy.getMountPath());
   }
 
 with
 
   link rel=shortcut icon href=[/]favicon.ico 
 type=image/x-icon/
 
 but to no avail.
 
 I shall try your suggestion when 1.5 comes out, which I am looking 
 forward to. Thank you again for your suggestions.
 
 
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386789p4520242.html
 Sent from the Users forum mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache
 
 
 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386789p4593097.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: Favicon best practice

2012-03-30 Thread Ian Marshall
With Wicket 1.5.5, I have tried:

In the HTML of my base page I have:

  link rel=shortcut icon type=image/x-icon href=favicon.ico/

and in my WebApplication-descended application class, I have:

  @Override
  protected void init()
  {
super.init();
...
PackageResourceReference prrFavicon = new PackageResourceReference(
 ResourcesLocator.class, favicon.ico);
mountResource(favicon.ico, prrFavicon);
  }

Sadly, the favicon shown remains that stored in web/favicon.ico, not the
favicon.ico file stored in the same folder as my ResourcesLocator class.

Oh well, I shall just live with the favicon in my web folder, and leave the
other one in place just in case.


Ian Marshall wrote
 
 Alas I am getting MidasTouchCodingExceptions.
 
 I tried
 
   protected void init()
   {
 super.init();
 ...
 
 // New code
 ResourceReference rrefFavicon = new ResourceReference(
  ResourcesLocator.class, favicon.ico);
 IMountableRequestTargetUrlCodingStrategy mrtURLCodingStrategy =
  new SharedResourceRequestTargetUrlCodingStrategy(favicon.ico,
  rrefFavicon.getSharedResourceKey());
 
 // One of:
 mount(mrtURLCodingStrategy);
 mountSharedResource(favicon.ico,
 mrtURLCodingStrategy.getMountPath());
   } 
 
 with
 
   link rel=shortcut icon href=[/]favicon.ico type=image/x-icon/
 
 but to no avail.
 
 I shall try your suggestion when 1.5 comes out, which I am looking forward
 to. Thank you again for your suggestions.
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386789p4520242.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: [1.5.4] DropDownChoice is not presenting value if equals is not overwritten

2012-03-02 Thread Ian Marshall
I too received log warnings as mentioned in the newly-changed code mentioned
above. My relevant Java code extract is:

  ChoiceRendererListChoiceItem crRenderer =
   new ChoiceRendererListChoiceItem(sName, nOrdinal);

  RadioChoiceListChoiceItem rcFieldsMode =
   new RadioChoiceListChoiceItem(rcFieldsMode, lciItems, crRenderer);
  rcFieldsMode.setRequired(true);
  frmForm.add(rcFieldsMode);

My ListChoiceItem class is descended from Object but did not override
equals(...) nor hashCode(). I now have done this and my warnings disappear.
Excellent for the start of the weekend!



Per Newgro wrote
 
 Thanks Sven,
 
 https://issues.apache.org/jira/browse/WICKET-4353
 
 Cheers
 Per
 
 Am 24.01.2012 11:31, schrieb Sven Meier:
 Hi,

 Igor's commit statements says improved inconsistency handling in 
 choice components.
 This change prevents IChoiceRenderer#getIdValue() being called with -1 
 as the index argument.

 I assume you are using a custom IChoiceRenderer which doesn't use the 
 index but a custom identifier?

 Try overriding #getModelValue():

 @Override
 public String getModelValue()
 {
 final Foo object = getModelObject();
 if (object != null)
 {
 return  + object.getBar();
 }
 else
 {
 return ;
 }
 }

 And create a jira issue please. We might have to revert this change.

 Sven

 Am 24.01.2012 10:52, schrieb Per Newgro:
 Maybe a usecase helps :-)

 I load my choices in a LDM. The selected choice is located in the 
 domain model.
 So the objects are equal by semantic but not by instance.

 Dropdown choices are lt;d, Germany; dk, Danmarkgt; hashcodes are 1 and
 2
 selected value is d, Germany hashcode is 3

 Cheers
 Per

 Am 24.01.2012 10:42, schrieb Per Newgro:
 Hi,

 with 1.5.4 the implementation of 
 org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.java
 has changed from

 code

 /**
  * @see FormComponent#getModelValue()
  */
 @Override
 public String getModelValue()
 {
   final T object = getModelObject();
   if (object != null)
   {
 int index = getChoices().indexOf(object);
 return getChoiceRenderer().getIdValue(object, index);
   }
 else
   {
 return ;
   }
 }

 /code

 to

 code
 /**
  * @see FormComponent#getModelValue()
  */
 @Override
 public String getModelValue()
 {
 final T object = getModelObject();
 if (object != null)
 {
 int index = getChoices().indexOf(object);

 if (index  0)
 {
 // the model is returning a choice that is not in 
 the available choices collection

 logger.warn(
 Detected inconsistency in choice component: 
 {}/{}. Model returned object: {}, but this object is not available 
 in the list of selected objects.,
 new Object[] { getPage().getClass(), 
 getPageRelativePath(), object });

 // pretend like nothing is selected

 return ;
 }

 return getChoiceRenderer().getIdValue(object, index);
 }
 else
 {
 return ;
 }
 }
 /code

 I don't see why this changed. Release notes don't provide a task for 
 that. But now i have to overwrite equals in my objects to get that 
 to work.
 Is there another way of selecting the object?

 Thanks
 Per
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5-4-DropDownChoice-is-not-presenting-value-if-equals-is-not-overwritten-tp4323310p4439341.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: How to write an HTTP header (to detect cookie disablement)?

2012-02-23 Thread Ian Marshall
Hi Martin,

Many thanks for your explanation and tip!

Regards,

Ian


Martin Grigorov-4 wrote
 Hi,
 
 Headers are not cookies.
 By setting a header in the response you should not expect that it will
 come in the next request.
 
 A request header is set by the client (the browser in this case). You
 can use UrlConnection or Apache HttpClient to set header request
 which will be available thru WebRequest.getHeader().
 
 Cookies work as you want - set it once in the response and then it
 will travel around in the next requests/responses until expire.
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-write-an-HTTP-header-to-detect-cookie-disablement-tp4397827p4413526.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: Link URLs (with JSessionID) truncated during URL rewriting

2012-02-23 Thread Ian Marshall
I fixed the problem by going around it.

All my web pages are descended from my PageBase class, which in turn
descends from Wicket's WebPage.

  ·  I disable my automatic removal of JSessionID by overriding

   public String ServletWebResponse.encodeURL(CharSequence url)

 in my WebApplication.

  ·  In my PageBase constructor, I determine whether (session) cookies are
 detected are being stored or not.

  ·  If not, then I raise an

   org.apache.wicket.RestartResponseException(final ClassC pageClass)

 to show my PageCookiesDisabled. This interrupts a Not found error
from
 an invalid URL containing .. characters, which I encountered
previously.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4414037.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: Link URLs (with JSessionID) truncated during URL rewriting

2012-02-23 Thread Ian Marshall
I run my Wicket app on Google App Engine for Java, which I believe uses Jetty
(or modified Jetty?) not Tomcat as its web application server.

The JIRA ticket states

  The bug does only show up when using tomcat (6.0.29) and not in jetty,

so I'll dip out of testing this particular ticket if that's OK.


Martin Grigorov-4 wrote
 https://issues.apache.org/jira/browse/WICKET-4401
 There is a patch attached to this ticket. Try it and send feedback.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4414160.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: How to write an HTTP header (to detect cookie disablement)?

2012-02-22 Thread Ian Marshall
Hi Martin,


COOKIES
---
I'm fine for this. My cookie code actually works. (But if the user's browser
disables cookies, then I want to use HTTP headers to be able to say The
user is on his/her second page, and still no cookie, so cookies are
definitely disabled (I cannot tell this on the first page).)


HTTP HEADERS

Many thanks for your tip about FireBug! Grand. (I had never thought about
that.)

All my web pages are descended from my PageBase class, which in turn
descends from Wicket's WebPage. I set my HTTP header in code in my PageBase
constructor using

  org.​apache.​wicket.​request.​http.WebResponse.addHeader(...);

In the first call to the app (which shows the home page), I can see this
header in the response headers using FireBug under GET PageHome?0. Sadly,
I cannot detect this in my PageBase constructor using

  import org.apache.wicket.request.cycle.RequestCycle;
  import org.apache.wicket.request.http.WebRequest;

  RequestCycle rcRequestCycle = getRequestCycle();
  WebRequest wreqRequest = (WebRequest)rcRequestCycle.getRequest();
  String sHeaderValue = wreqRequest.getHeader(X-MyApp-NotFirstPageBase-1);

since I get sHeaderValue to be null. Also, I cannot see this header in the
request headers using FireBug.

After clicking the link on my home page to the About us page, I can see
this header in the response headers using FireBug under GET PageAbout?1,
but nowhere else (including request headers even though I believe that I add
this to each web request unconditionally).

If I add

  org.​apache.​wicket.​request.​http.WebResponse.addHeader(...);

to my PageHome's form's onSubmit() method, then after form submission I do
see this header, but in the response only in

  POST page?1-1.IFormSubmitListener-frmForm

of

  http://localhost:8080/wicket/page?1-1.IFormSubmitListener-frmForm

(I am running locally).

Am I looking in the wrong place in my code (and thus in the request cycle)
to find my header in a request?



Martin Grigorov-4 wrote
 
 Hi Ian,
 
 If you add/set a header in the HttpServletResponse (even thru Wicket's
 WebResponse) then it will be written to the browser. You can verify
 that by investigating the request in Firebug's Net panel.
 
 If you want to send a cookie you should either use #addCookie() or
 set/addHeader(Set-Cookie). Check in google for more info.
 So you set the cookie in the current response and if not expired it
 should be available in the next *request* (HttpServletRequest or
 Wicket's WebRequest).
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-write-an-HTTP-header-to-detect-cookie-disablement-tp4397827p4411061.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: How to write an HTTP header (to detect cookie disablement)?

2012-02-21 Thread Ian Marshall
Hello Jeff,

Thanks for the tip. I have tried to detect my header in the HTTP response
headers using, in my web application class:

  @Override
  protected WebResponse MyWebApplicationnewWebResponse(final WebRequest
webRequest,
   final HttpServletResponse httpServletResponse)
{
  ServletWebResponse swrResponse = new ServletWebResponse(
   (ServletWebRequest)webRequest, httpServletResponse)
  {
private static final long serialVersionUID = 1L;
...
  }

  String sHeaderValue =
webRequest.getHeader(X-MyApp-NotFirstPageBase-1);
   // Show sHeaderValue in the logger

  return swrResponse;
}

but sadly with no header detected. (I know little about the details of
request and response, which is one reason why I selected Wicket for my
application.)

Thanks anyway for your input,

Ian



Jeff Schneller wrote
 
 The header won't appear in the browser's page source but will be in the
 http response header. 
 
 Sent from my iPhone
 
 On Feb 17, 2012, at 12:01 PM, Ian Marshall lt;IanMarshall.UK@gt; wrote:
 
 I am having trouble with JSessionIDs in my URLs (my post at
 
 
 http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4381881.html
 
 refers). So my plan is to detect the case where a web browser has
 disabled
 (session) cookies and react accordingly (for example: show a page to ask
 for
 cookie enablement). I plan to detect cookie disablement by writing a
 cookie
 during each client request from my common page PageBase (almost all of my
 web pages are sub-classed from PageBase, which in turn is sub-classed
 from
 org.apache.wicket.markup.html.WebPage). If any server response after the
 first does not have this cookie then I know that cookies are disabled.
 But
 how to know that a client request is not the first?
 
 I want to explore adding/setting an HTML header to each server response.
 I
 can use this to know whether or not this is the client's first request.
 
 In my application class, which is a sub-class of
 org.apache.wicket.protocol.http.WebApplication, I override
 newWebResponse(...) like this:
 
@Override
protected WebResponse newWebResponse(final WebRequest webRequest,
 final HttpServletResponse httpServletResponse)
{
  httpServletResponse.addHeader(X-MyApp-NotFirstPageBase-1, true);
  httpServletResponse.setHeader(X-MyApp-NotFirstPageBase-2, true);
 
  return super.newWebResponse(webRequest, httpServletResponse);
}
 
 No such headers appear in the browser's page source. I tried the
 following
 code in my About us page.
 
public PageAbout()
{
  super();
 
  Form frmForm = new Form(frmForm)
  {
private static final long serialVersionUID = 1L;
 
@Override
protected void onSubmit()
{
  setResponsePage(PageHome.class);
 
  WebResponse wrResponse = (WebResponse)getResponse();
  wrResponse.addHeader(X-MyApp-NotFirstPageBase-1, true);
  wrResponse.setHeader(X-MyApp-NotFirstPageBase-2, true);
}
  };
  add(frmForm);
 
  ...
}
 
 Again no such header appeared.
 
 Can anyone see what I am doing wrong?
 
 Regards,
 
 Ian Marshall
 
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-write-an-HTTP-header-to-detect-cookie-disablement-tp4397827p4397827.html
 Sent from the Users forum mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache
 
 
 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-write-an-HTTP-header-to-detect-cookie-disablement-tp4397827p4407998.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: JavaSerializer in 1.5.4 causes exceptions with GAE

2012-02-20 Thread Ian Marshall
Thanks for pointing me to WicketStuff and the fix it gives. Strangely enough,
for me I only encountered this problem for 1.5.4 but not before then.

Thanks too for the link to the GAE/J issue. I already had it starred, and
had already noted the lack of attention it receives.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JavaSerializer-in-1-5-4-causes-exceptions-with-GAE-tp4404222p4404553.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



How to write an HTTP header (to detect cookie disablement)?

2012-02-17 Thread Ian Marshall
I am having trouble with JSessionIDs in my URLs (my post at

 
http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4381881.html

refers). So my plan is to detect the case where a web browser has disabled
(session) cookies and react accordingly (for example: show a page to ask for
cookie enablement). I plan to detect cookie disablement by writing a cookie
during each client request from my common page PageBase (almost all of my
web pages are sub-classed from PageBase, which in turn is sub-classed from
org.apache.wicket.markup.html.WebPage). If any server response after the
first does not have this cookie then I know that cookies are disabled. But
how to know that a client request is not the first?

I want to explore adding/setting an HTML header to each server response. I
can use this to know whether or not this is the client's first request.

In my application class, which is a sub-class of
org.apache.wicket.protocol.http.WebApplication, I override
newWebResponse(...) like this:

@Override
protected WebResponse newWebResponse(final WebRequest webRequest,
 final HttpServletResponse httpServletResponse)
{
  httpServletResponse.addHeader(X-MyApp-NotFirstPageBase-1, true);
  httpServletResponse.setHeader(X-MyApp-NotFirstPageBase-2, true);

  return super.newWebResponse(webRequest, httpServletResponse);
}

No such headers appear in the browser's page source. I tried the following
code in my About us page.

public PageAbout()
{
  super();

  Form frmForm = new Form(frmForm)
  {
private static final long serialVersionUID = 1L;

@Override
protected void onSubmit()
{
  setResponsePage(PageHome.class);

  WebResponse wrResponse = (WebResponse)getResponse();
  wrResponse.addHeader(X-MyApp-NotFirstPageBase-1, true);
  wrResponse.setHeader(X-MyApp-NotFirstPageBase-2, true);
}
  };
  add(frmForm);

  ...
}

Again no such header appeared.

Can anyone see what I am doing wrong?

Regards,

Ian Marshall

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-write-an-HTTP-header-to-detect-cookie-disablement-tp4397827p4397827.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



Link URLs (with JSessionID) truncated during URL rewriting

2012-02-14 Thread Ian Marshall
Hello All,

Has anyone else apart from me suffered from this problem of URLs being
truncated to become invalid?

I would appreciate it if anyone else shared my pain!

Ian Marshall


Ian Marshall wrote
 
 Hello All,
 
 A user's first visit to my app's home page results in the URL
 
   http://[My domain]/main/PageHome;jsessionid=v_qqIGVQlKBbkNSOcHkAQw?0
 
 Each org.apache.wicket.markup.html.link.Link on my home page has the URL
 of the form
 
   http://[My
 domain]/main/..;jsessionid=v_qqIGVQlKBbkNSOcHkAQw?0-1.ILinkListener-lnkAbout
 
 (of length 102 characters for the particular link URL copied here). These
 URLs are invalid, because of the two dots present instead of the completed
 path.
 
 Is there any way I can configure Wicket to suppress this URL abbreviation,
 or is this operation the province of the web application server or web
 browser?
 
 As a work-around, I have already coded the supression of JSessionIDs in my
 links' URLs, and am coding the app to give a warning if session cookies
 are disabled. But I would appreciate any pointers.
 
 Ian Marshall
 
 
 My operating environment
 -
 Web application server: (Jetty? in) Google App Engine
 Wicket version: 1.5.3 (I know: it's not the very latest version!)
 Web browsers:   Mozilla Firefox 10.0.1
 Microsoft Internet Explorer 8.0.6001.18702
 as found on my HTC Wildfire S running Google
 Android 2.3.5
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4386619.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: Link URLs with JSessionID truncated

2012-02-13 Thread Ian Marshall
Wicket version: 1.5.3.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4383252.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: Link URLs with JSessionID truncated

2012-02-13 Thread Ian Marshall

Chris Colman-2 wrote
 
 I was going to suggest that the relative URL problem might be caused by:
 
 https://issues.apache.org/jira/browse/WICKET-4138
 
 but that was fixed in 1.5.3.
 
 Maybe it's related to https://issues.apache.org/jira/browse/WICKET-4138
 , fixed in 1.5.4.
Both links are identical. What was the issue solved in 1.5.4? (I had already
scanned the 1.5.4 change log and could not see a bug which might have
already fixed my problem.)



Chris Colman-2 wrote
 
 In any case I would build the latest 1.5.x snapshot and see if your
 problem goes away. 1.5.3 is a few months old now which, with the rapid
 pace of Wicket development, is quite old ;)
 
I shall migrate to 1.5.4 soon and see if my problem will be fixed, but I do
not hope.

I wonder if anyone else has encountered this issue.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4385209.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



Link URLs with JSessionID truncated

2012-02-12 Thread Ian Marshall
Hello All,

A user's first visit to my app's home page results in the URL

  http://[My domain]/main/PageHome;jsessionid=v_qqIGVQlKBbkNSOcHkAQw?0

Each org.apache.wicket.markup.html.link.Link on my home page has the URL of
the form

  http://[My
domain]/main/..;jsessionid=v_qqIGVQlKBbkNSOcHkAQw?0-1.ILinkListener-lnkAbout

(of length 102 characters for the particular link URL copied here). These
URLs are invalid, because of the two dots present instead of the completed
path.

Is there any way I can configure Wicket to suppress this URL abbreviation,
or is this operation the province of the web application server or web
browser?

As a work-around, I have already coded the supression of JSessionIDs in my
links' URLs, and am coding the app to give a warning if session cookies are
disabled. But I would appreciate any pointers.

Ian Marshall


My operating environment
-
Web application server: (Jetty? in) Google App Engine
Wicket version: 1.5.3 (I know: it's not the very latest version!)
Web browsers:   Mozilla Firefox 10.0.1
Microsoft Internet Explorer 8.0.6001.18702
as found on my HTC Wildfire S running Google Android
2.3.5

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4381881.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: Link URLs with JSessionID truncated

2012-02-12 Thread Ian Marshall
Hi Chris,

I suppressed JSessionIDs in my links' URLs, not because I dislike them, but
solely because I found that my links' URLs were not working because the ..
strings were appearing.

So, unless I can find a better way, I need to suppress the JSessionIDs and
require session cookie enablement. It's pants, but better than Not found
errors being presented to users following my links.

Cheers,

Ian

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4382081.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: How do I write my first Apache Wicket program on NetBeans IDE?

2012-01-19 Thread Ian Marshall
The answer might depend in part upon which web server you want to use.

NetBeans ships with Tomcat. There are others which one can use. I stopped
using Tomcat and now use Google App Engine's (GAE's) development web server
to run my Wicket application outside of NetBeans.

If that is want you want to do, please let me know. Otherwise, other
people's advice will be better. Have you visited

  https://cwiki.apache.org/WICKET/#Index-DevelopmentEnvironment

yet?

As regards class libraries for NetBeans, I have set up and use a NetBeans
Wicket library which has the following files in the classpath:

  ·  wicket-core-1.5.3.jar
  ·  wicket-request-1.5.3.jar
  ·  wicket-util-1.5.3.jar
  ·  slf4j-jdk14-1.6.4.jar
  ·  slf4j-api-1.6.4.jar

(my application uses Java's own logging class).

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-do-i-write-my-first-apache-wicket-program-on-netbeans-IDE-tp4309226p4309582.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



PageParameters in 1.5: a sanity check request

2011-11-23 Thread Ian Marshall
I have ported my app from 1.4.18 to 1.5.1 (I haven't used 1.5.3 yet).

As part of my porting, I had to adjust the use of page parameters. I would
like to mention my changes for parameter extraction and existence
determination below, in case someone can mention a cleaner way to do these
things...

  import org.apache.wicket.util.string.StringValue;

Replace

  if (params.containsKey([Param name]))
  {
String sValue = params.getString([Param name]);
...
  }

with

  ListStringValue liSVs = params.getValues([Param name]);
  if ((liSVs != null)  !liSVs.isEmpty())
  {
StringValue svValue = liSVs.get(0);
String sValue = svValue.toOptionalString();
...
  }

and replace

  String sUserName = params.getString([Key name], [Empty default string]);
  if (!sUserName.isEmpty())
...

with

  ListStringValue liSVs = params.getValues([Param name]);
  if ((liSVs != null)  !liSVs.isEmpty())
...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PageParameters-in-1-5-a-sanity-check-request-tp4099136p4099136.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: PageParameters in 1.5: a sanity check request

2011-11-23 Thread Ian Marshall
Thanks for your comments, Guys.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PageParameters-in-1-5-a-sanity-check-request-tp4099136p4099956.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: Forum vs list question

2011-11-17 Thread Ian Marshall
Hi Neill,

I am in the same position as you. I prefer not to receive E-mails of all the
posts and look via my browser instead.

Once you have signed up, log in and:

  Visit the Apache Wicket › Users forum page
  Go to Options | Your subscription: Users forum (edit)
  Either
Select Receive new topics only and Daily digest and click the Save
Subscription button.
  or
Click the Unsubscribe button.

Believe it or not, if you follow the Save Subscription button step, then
you will then receive no E-mails (well, I don't get any anyway)!

Enjoy?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Forum-vs-list-question-tp4076276p4079663.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: NonCachingImage not showing image with GAE

2011-10-14 Thread Ian Marshall
I have solved my problem by using a class that descends from
ByteArrayResource and which overrides getData(IResource.Attributes). I
supply an instance of this class to my NonCachingImage instead of a model.

I thank Martin Grigorov for his reply to a vaguely-related posting last
month which solved my problem!



Ian Marshall wrote:
 
 Hello everyone,
 
 I use a NonCachingImage component to show an image in a form. The image
 shows correctly when using the Google App Engine for Java (GAE/J)
 development application server but fails to show when the code is running
 on Google App Engine (GAE) proper.
 
 I believe that this may be due to the image's src tag not being
 interpreted by GAE's cloud, whereas it is rendered properly by the dev app
 server.
 
 Has anyone had this happening to them? Can anyone think of a solution or
 suggestion? (Can I remove the src attribute?)
 
 Regards,
 
 Ian
 
 
 HTML
 
 lt;img wicket:id=imgImage alt=[None] width=100% height=100%/gt;
 
 
 Java code
 -
 // ImageModel extends LoadableDetachableModelItemImageResource
 // ItemImageResource extends DynamicImageResource
 ImageModel imodImage = new ImageModel(pidmModel);
 NonCachingImage imgImage = new NonCachingImage(imgImage, imodImage);
 frmForm.add(imgImage);
 
 
 Sample HTML output
 --
 // This output shows an image with the GAE dev app server,
 // but [None] when served by a GAE/J production server.
 lt;img wicket:id=imgImage alt=[None] width=100% height=100%
 
 src=page?8-IResourceListener-frmForm-imgImageamp;antiCache=1318502670796/gt;
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NonCachingImage-not-showing-image-with-GAE-tp3901604p3905671.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



Converter for FileUpload

2011-10-07 Thread Ian Marshall
Hello All,

I am porting my Wicket 1.4.18 application to 1.5.1.

I am now getting the following exception when I use a
org.apache.wicket.markup.html.form.upload.FileUploadField to upload a file,
when all worked well in 1.4.18:

  ... 43 more
Caused by: org.apache.wicket.util.convert.ConversionException: Could not
convert value:
[org.apache.wicket.markup.html.form.upload.FileUpload@1b3d1e5] to type:
org.apache.wicket.markup.html.form.upload.FileUpload. Could not find
compatible converter.
  at
org.apache.wicket.ConverterLocator$DefaultConverter.convertToObject(ConverterLocator.java:109)
  ... 63 more

Does anyone know of an org.apache.wicket.util.convert.IConverter? for
org.apache.wicket.markup.html.form.upload.FileUpload, or will I have to roll
my own?

My development environment is:
  ∙  Web framework: Apache Wicket 1.5.1 using libraries (I am an Ant user):
 ∙  wicket-core-1.5.1.jar
 ∙  wicket-request-1.5.1.jar
 ∙  wicket-util-1.5.1.jar
  ∙  Web server environment: Google App Engine
  ∙  Java: 1.6.0_27; Java HotSpot(TM) Client VM 20.2-b06
  ∙  System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
  ∙  IDE: NetBeans 7.0.1 (Build 201107282000)
  ∙  Web browser: Mozilla Firefox 7.0.1


Regards,

Ian Marshall

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Converter-for-FileUpload-tp3881522p3881522.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: Converter for FileUpload

2011-10-07 Thread Ian Marshall
Fantastic, Martin!

I have changed the model for my FileUploadField from FileUpload to
ListFileUpload and all works fine, without me having to roll my own
converter. (I didn't spot that the constructor for FieldUploadField which
takes a model now takes a model of type IModellt;Listlt;FileUploadgt;.)

Thanks very much, and have a good weekend,

Ian



Martin Grigorov-4 wrote:
 
 The difference in FileUploadField from 1.4.x to 1.5.x is that now it
 supports input type=file multiple/ (HTML5 standards) and it works
 with ListFileUpload instead of just FileUpload.
 You need to update your getConverter() impl to expect ListFileUpload
 
 On Fri, Oct 7, 2011 at 12:39 PM, Ian Marshall lt;IanMarshall.UK@gt;
 wrote:
 Hello All,

 I am porting my Wicket 1.4.18 application to 1.5.1.

 I am now getting the following exception when I use a
 org.apache.wicket.markup.html.form.upload.FileUploadField to upload a
 file,
 when all worked well in 1.4.18:

  ... 43 more
 Caused by: org.apache.wicket.util.convert.ConversionException: Could not
 convert value:
 [org.apache.wicket.markup.html.form.upload.FileUpload@1b3d1e5] to type:
 org.apache.wicket.markup.html.form.upload.FileUpload. Could not find
 compatible converter.
  at
 org.apache.wicket.ConverterLocator$DefaultConverter.convertToObject(ConverterLocator.java:109)
  ... 63 more

 Does anyone know of an org.apache.wicket.util.convert.IConverter? for
 org.apache.wicket.markup.html.form.upload.FileUpload, or will I have to
 roll
 my own?

 My development environment is:
  ∙  Web framework: Apache Wicket 1.5.1 using libraries (I am an Ant
 user):
     ∙  wicket-core-1.5.1.jar
     ∙  wicket-request-1.5.1.jar
     ∙  wicket-util-1.5.1.jar
  ∙  Web server environment: Google App Engine
  ∙  Java: 1.6.0_27; Java HotSpot(TM) Client VM 20.2-b06
  ∙  System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
  ∙  IDE: NetBeans 7.0.1 (Build 201107282000)
  ∙  Web browser: Mozilla Firefox 7.0.1


 Regards,

 Ian Marshall

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Converter-for-FileUpload-tp3881522p3881522.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache


 
 
 
 -- 
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com
 
 -
 To unsubscribe, e-mail: users-unsubscribe@.apache
 For additional commands, e-mail: users-help@.apache
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Converter-for-FileUpload-tp3881522p3882908.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



Very minor amendment in the 1.5.0 Javadocs for StringResourceModel

2011-09-22 Thread Ian Marshall
In the 1.5.0 documentation for org.apache.wicket.model.StringResourceModel,
one constructor is

  public StringResourceModel(String resourceKey,
   Component component,
   IModel? model,
   String defaultValue,
   Object... parameters)


EXTRACT FROM EXISTING DOCUMENTATION
  ...
  Parameters:
resourceKey - The resource key for this string resource
component - The component that the resource is relative to
model - The model to use for property substitutions
parameters - The parameters to substitute using a Java MessageFormat
object
defaultValue - The default value if the resource key is not found.


COMMENT
All I am saying is that the ordering of the Parameters section above might
want to be tweaked to match the order of the constructor's parameters -
particularly since the last parameter is now vararg in 1.5.

(I did say Minor typo - but I guess that this issue is not a typo at all -
just a very minor tweak.)



Martin Grigorov-4 wrote:
 
 you can paste a patch here
 I'm not sure that I understand you
 
 On Thu, Sep 22, 2011 at 5:15 PM, Ian Marshall
 lt;ianmarshall...@gmail.comgt; wrote:
 Hello there,

 I believe that I have spotted a minor typo in the 1.5.0 Javadocs for
 org.apache.wicket.model.StringResourceModel whilst fettling my app for
 1.5.

 For the documentation for the constructor

  StringResourceModel(String resourceKey, Component component, IModel?
 model, String defaultValue, Object... parameters)

 the Parameters section is unchanged from 1.4 and does not reflect the
 modified method signature.

 I don't think that I can change this so I submit this post for comment.

 Ian

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Minor-typo-in-the-1-5-0-Javadocs-for-StringResourceModel-tp3833555p3833555.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
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Minor-typo-in-the-1-5-0-Javadocs-for-StringResourceModel-tp3833555p3833702.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



Creating a resource from a byte array and its content type

2011-09-15 Thread Ian Marshall
In Wicket 1.4, I used an org.apache.wicket.resource.ByteArrayResource to
create a resource from a byte array and its content type. I then used this
object's getResourceStream() method to return an IResourceStream, to get an
InputStream and read it into a byte array.

(I do this as part of my prepation of an image into a NonCachingImage
component, whilst minimising the session size.)

In Wicket 1.5, I find ByteArrayResource as
org.apache.wicket.request.resource.ByteArrayResource. It is now an abstract
class and no longer has the ability to convert a byte array and its content
type into a resource stream (as far as I can see).

Can anyone recommend a good way for me to generate a resource stream from a
byte array and its content type? I would appreciate any assistance greatly.

Ian Marshall


My essential 1.4 Java code
--
  String sContentTypeWithPrefix = [...];
  byte[] baData = [...];

  ByteArrayResource barImage = new ByteArrayResource(
   sContentTypeWithPrefix, baData);
  IResourceStream rs = barImage.getResourceStream();
  long loLengthInBytes = rs.length();
  byte[] baTemp = new byte[nLengthInBytes];
  InputStream is = rs.getInputStream();
  int nReadResult = is.read(baTemp, 0, nLengthInBytes);

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Creating-a-resource-from-a-byte-array-and-its-content-type-tp3815188p3815188.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: Creating a resource from a byte array and its content type

2011-09-15 Thread Ian Marshall
I don't know why I said that ByteArrayResource was abstract. Sorry about
that; I got it mixed up with another class.

I need to keep my byte array wrapped in a LoadableDetachableModel, in order
to prevent the array being stored in the page and session, so I do not
supply an IResource to the NonCachingImage component constructor; I use
NonCachingImage(String id, IModel? myLDM) instead.

After looking at what my use of the Wicket and Java classes did, which,
despite all the streams and content type, was just to copy an image byte
array, I shall now do a direct copy and see what happens.

Thank you very much for your pointers, Martin; in my view, two minds do
indeed make three.

Ian

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Creating-a-resource-from-a-byte-array-and-its-content-type-tp3815188p3815697.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: Creating a resource from a byte array and its content type

2011-09-15 Thread Ian Marshall
I used my other method instead of using ByteArrayResource directly, in order
to reduce session size. I therefore presume that I was using
ByteArrayResource incorrectly for that reduction to happen!



Martin Grigorov-4 wrote:
 
 On Thu, Sep 15, 2011 at 5:13 PM, Ian Marshall
 lt;ianmarshall...@gmail.comgt; wrote:
 I don't know why I said that ByteArrayResource was abstract. Sorry about
 that; I got it mixed up with another class.

 I need to keep my byte array wrapped in a LoadableDetachableModel, in
 order
 to prevent the array being stored in the page and session, so I do not
 supply an IResource to the NonCachingImage component constructor; I use
 NonCachingImage(String id, IModel? myLDM) instead.
 With the dynamic nature of ByteArrayResource you also can load the
 byte[] on demand without storing it.

 After looking at what my use of the Wicket and Java classes did, which,
 despite all the streams and content type, was just to copy an image byte
 array, I shall now do a direct copy and see what happens.

 Thank you very much for your pointers, Martin; in my view, two minds do
 indeed make three.

 Ian

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Creating-a-resource-from-a-byte-array-and-its-content-type-tp3815188p3815697.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
 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Creating-a-resource-from-a-byte-array-and-its-content-type-tp3815188p3815727.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



Minor typo in the Migration to Wicket 1.5 guide?

2011-09-15 Thread Ian Marshall
Under the final section List of renamed classes and methods, should the
first 1.4 class listed not be

  org.apache.wicket.request.resource.ResourceReference

but

  org.apache.wicket.ResourceReference?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Minor-typo-in-the-Migration-to-Wicket-1-5-guide-tp3816035p3816035.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: Minor typo in the Migration to Wicket 1.5 guide?

2011-09-15 Thread Ian Marshall
Good point, Martin. I never noticed the Edit Page link at the top of the
migration guide until your post.

Next time, I'll (register and) log on to the Apache Software Foundation and
submit minor typo corrections myself.



Martin Grigorov-4 wrote:
 
 fixed
 
 the wiki is editable by everyone. improve it! ;-)
 
 On Thu, Sep 15, 2011 at 7:03 PM, Ian Marshall
 lt;ianmarshall...@gmail.comgt; wrote:
 Under the final section List of renamed classes and methods, should the
 first 1.4 class listed not be

  org.apache.wicket.request.resource.ResourceReference

 but

  org.apache.wicket.ResourceReference?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Minor-typo-in-the-Migration-to-Wicket-1-5-guide-tp3816035p3816035.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
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Minor-typo-in-the-Migration-to-Wicket-1-5-guide-tp3816035p3816542.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



Successor to StyleSheetReference in 1.5

2011-09-14 Thread Ian Marshall
Hello there,

Most of my web pages descend from my class PageBase, which itself descends
from WebPage.

In 1.4, these pages accessed my CSS file (in the same folder as my file
ResourcesLocator.java) by using the code given below.

I have looked, but cannot see how to do this in 1.5 (where
StyleSheetReference disappears).

I would appreciate any help.

Regards,

Ian


HTML

  ...
  html xmlns:wicket
wicket:head
  link wicket:id=stylesheet rel=stylesheet type=text/css
href=style.css/
  ...
/wicket:head
...
  /html


Java (in a PageBase constructor)

  add(new StyleSheetReference(stylesheet, ResourcesLocator.class,
style.css));

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Successor-to-StyleSheetReference-in-1-5-tp3812796p3812796.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: Successor to StyleSheetReference in 1.5

2011-09-14 Thread Ian Marshall
Thanks Martin.

I shall try

  CssResourceReference rrefCSS = new CssResourceReference(
   ResourcesLocator.class, style.css);
  ResourceLinkCssResourceReference rlnkCSS =
   new ResourceLinkCssResourceReference(stylesheet, rrefCSS);
  add(rlnkCSS);

in order to keep my HTML mark-up unchanged. If this does not work, I shall
look into overriding my page's renderHead(...) method (and removing the
relevant part of my HTML mark-up?) as shown in the /Migration guide/.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Successor-to-StyleSheetReference-in-1-5-tp3812796p3812963.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



PackageResource changes in 1.5

2011-09-09 Thread Ian Marshall
Hello there,

I know that this is not an ideal time (Friday afternoon and all that), but I
have a problem migrating from 1.4.18 to 1.5.0.

I have a business class which reads properties from its .xml properties
file. I used org.apache.wicket.markup.html.PackageResource to start doing
this, but I find that this class is now in a different package
(org.apache.wicket.request.resource.PackageResource) without the methods
that I use.

Does anyone know a good way to read an .xml properties file in 1.5? (I set
out a code summary followed by a fuller code extract below.)

Any help would be much appreciated,

Ian




1.4.8 code summary
--
  import org.apache.wicket.markup.html.PackageResource;
  import org.apache.wicket.request.resource.PackageResource;

  ...

  Properties propProperties = new Properties();
  boolean bLoadSuccess = false;

 
/
  // This code will not compile
  //
  PackageResource prResource =
   PackageResource.get(MyClass.class, MyClass.class.getSimpleName() +
.xml);

  IResourceStream rsStream = prResource.getResourceStream();
  //
 
/
  try
  {
try
{
  InputStream isStream = rsStream.getInputStream();
  propProperties.loadFromXML(isStream);
  bLoadSuccess = true;
}
catch (...)
{
  ...
  }
  finally
  {
try
{
  rsStream.close();
}
...
  }




1.4.8 fuller code extract
-
import org.apache.wicket.markup.html.PackageResource;
import org.apache.wicket.request.resource.PackageResource;

public class MailBusiness
{
  ...

  private static final Logger g_logger =
   Logger.getLogger(MailBusiness.class.getName());

  // The .properties extension for package resources gets blocked
  // by the Wicket framework by default, so use something else.
  private static final String G_S_PROPERTIES_FILE_NAME =
   MailBusiness.class.getSimpleName() + .xml;

  private static String G_S_ADDRESS_FROM = ;
  private static boolean g_bPropertiesLoaded = false;

  ...

  /**
   * Load the properties from this class's related properties file.
   * @return
   *   codetrue/code if the properties have been loaded successfully
   *   before or during the call to this method, otherwise
codefalse/code.
   */
  private static boolean loadProperties()
  {
if (!g_bPropertiesLoaded)
{
  Properties propProperties = new Properties();
  boolean bLoadSuccess = false;
  PackageResource prResource =
   PackageResource.get(MailBusiness.class, G_S_PROPERTIES_FILE_NAME);

  IResourceStream rsStream = prResource.getResourceStream();
  try
  {
try
{
  InputStream isStream = rsStream.getInputStream();
  propProperties.loadFromXML(isStream);
  bLoadSuccess = true;
}
catch (ResourceStreamNotFoundException e)
{
  g_logger.log(Level.SEVERE, null, e);
}
catch (IOException e)
{
  g_logger.log(Level.SEVERE, null, e);
}
  }
  finally
  {
try
{
  rsStream.close();
}
catch (IOException e)
{
  g_logger.log(Level.SEVERE, null, e);
}
  }

  if (bLoadSuccess)
  {
G_S_ADDRESS_FROM = propProperties.getProperty(G_S_KEY_ADDRESS_FROM,
);

...

g_bPropertiesLoaded = true;
  }
}

return g_bPropertiesLoaded;
  }

  ...
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PackageResource-changes-in-1-5-tp3801683p3801683.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



PackageResource changes in 1.5

2011-09-09 Thread Ian Marshall
I have now coded:

  import org.apache.wicket.request.resource.PackageResource;
  import org.apache.wicket.request.resource.PackageResourceReference;

  PackageResourceReference prrResource = new PackageResourceReference(
   MailBusiness.class, MailBusiness.class.getSimpleName() + .xml);
  PackageResource prResource = (PackageResource)prrResource.getResource();

  IResourceStream rsStream = prResource.getCacheableResourceStream();
  ...
  InputStream isStream = rsStream.getInputStream();
  propProperties.loadFromXML(isStream);
  ...

I have not run this yet (I cannot build since I am still fettling my 1.4.18
into 1.5.0) but does anyone know whether am I on the right lines or not?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PackageResource-changes-in-1-5-tp3801683p3801827.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: PackageResource changes in 1.5

2011-09-09 Thread Ian Marshall
Thanks for the tip, Igor.

I have coded with

  MailBusiness.class.getResourceAsStream(...)

and I shall verify this after I fettle my app for building.

Ian



Igor Vaynberg-2 wrote:
 
 InputStream
 in=MailBusiness.class.getResource(MailBusiness.class.getSimpleName()+.xml);
 
 no need to use wicket at all
 
 -igor
 
 On Fri, Sep 9, 2011 at 7:23 AM, Ian Marshall
 lt;ianmarshall...@gmail.comgt; wrote:
 I have now coded:

  import org.apache.wicket.request.resource.PackageResource;
  import org.apache.wicket.request.resource.PackageResourceReference;

  PackageResourceReference prrResource = new PackageResourceReference(
   MailBusiness.class, MailBusiness.class.getSimpleName() + .xml);
  PackageResource prResource = (PackageResource)prrResource.getResource();

  IResourceStream rsStream = prResource.getCacheableResourceStream();
  ...
  InputStream isStream = rsStream.getInputStream();
  propProperties.loadFromXML(isStream);
  ...

 I have not run this yet (I cannot build since I am still fettling my
 1.4.18
 into 1.5.0) but does anyone know whether am I on the right lines or not?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/PackageResource-changes-in-1-5-tp3801683p3801827.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
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PackageResource-changes-in-1-5-tp3801683p3802148.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



Broken link in Download Wicket releases web page

2011-09-08 Thread Ian Marshall
Hello,

I am excited to see that Wicket 1.5 is released!

Whilst starting to prepare my migration from 1.4.18, I have noticed that on
the web page

  http://wicket.apache.org/start/download.html;

the link to the migration guide
(http://cwiki.apache.org/WICKET/migrating-to-wicket-15.html;) results in
the error 404 Not Found.

Should the link be http://s.apache.org/wicket-1.5-migration; or
https://cwiki.apache.org/WICKET/migration-to-wicket-15.html; instead?

Cheers,

Ian

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Broken-link-in-Download-Wicket-releases-web-page-tp3798224p3798224.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: Broken link in Download Wicket releases web page

2011-09-08 Thread Ian Marshall
No problem.

I join others in giving a big thank you to all involved in the Wicket
project. What a great framework!


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Broken-link-in-Download-Wicket-releases-web-page-tp3798224p3798237.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: Users, sessions, data...

2011-06-16 Thread Ian Marshall
Hi Zeldor,


Zeldor wrote:
 
 Well, I'm hosting it on GAE and with new pricing model I have to worry
 about instances, not memcache or things like that.

In GAE/J your sessions are persisted to both the BigTable datastore (for
guaranteed persistence) and the memcache (for speed of access). Retrieving
data from the datastore is relatively fast (compared to writing to it) and
from memcache even faster, so each of my session instances stores the user
ID (only) of any logged-on user (or null if none). The session then
retrieves any data from the datastore as needed (for example: user name,
is-administrator-or-not).

Be aware of the maximum session data size of 1MB for GAE/J (= maximum
persistent entity data size). Don't fall into the trap I did by not using
loadable detachable models for large amounts of data like photographs.

Ian

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Users-sessions-data-tp3598626p3601823.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



Using GAE/J deferred tasks in Apache Wicket

2011-06-07 Thread Ian Marshall
I have tried using Google App Engine for Java (GAE/J) deferred tasks in
Apache Wicket.

They do indeed run, but I cannot access the bulk of my data exchange code
since it needs the context of an application and/or a session to work. I
presume that the underlying cause of this is because when the task fires, it
calls a default servlet as opposed to one of my web pages (which results in
the page's code running in the context of an application and a session).

I have reverted to using GAE/J enqueued tasks to fire up a web page and do
my processing from there. But I was interested in using DeferredTask since I
wanted to:

  ·  bypass the GAE/J 30-second web page response limit and use the GAE/J
10-minute task processing limit instead
  ·  obviate having to code new web pages and just implement the
DeferredTask.run() method.

Has anyone got to use DeferredTask within the context of an application and
session successfully?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-GAE-J-deferred-tasks-in-Apache-Wicket-tp3578949p3578949.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



Models in a bookmarkable page

2011-04-12 Thread Ian Marshall
I have two questions - a minor one then my main one.

Minor question
--
Am I correct that the calls

  PageParameters params = ...
  MyPage pgNext = new MyPage(PageParameters params);
  setResponsePage(pgNext);

result in the creation of a session-relative page, whereas the calls

  PageParameters params = ...
  setResponsePage(MyPage.class, params);

result in the creation of a bookmarkable page?


Main question
-
My WebPage has one Form, the model of which is wrapped in a
LoadableDetachableModel (LDM). This LDM nulls most, but not all, of its
data.

If this page is called into being in a bookmarkable way, would I be correct
to think that none of this page's LDM's data would be stored in the user's
session (in a PageMap or otherwise)?


Regards,

Ian Marshall

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Models-in-a-bookmarkable-page-tp3444176p3444176.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: Models in a bookmarkable page

2011-04-12 Thread Ian Marshall
Thank you, Martin. That's just what I wanted to know.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Models-in-a-bookmarkable-page-tp3444176p3444612.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: Apache Wicket Cookbook Published!

2011-03-29 Thread Ian Marshall
I have this book on order; I look forward to studying it.

My Wicket in Action and Coding: On Software Design Process books are
eager to welcome a new member to their high quality book area.

Ian Marshall

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Cookbook-Published-tp3406012p3414357.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: Choice of Resource for my Image component

2011-03-29 Thread Ian Marshall
3.  All I need to do now is find out why my use of a NonCachingImage
together with my descended LoadableDetachableModel in the form of my web
page still results in huge session size (1MB), which is forbidden in Google
App Engine.

I have fixed my problem of a WebPage's NonCachingImage holding onto an
image's data and thus causing a user's session size to get very large
indeed. The model passed to the NonCachingImage was descended from
LoadableDetachableModel.

Instead, I now descend my model from LoadableDetachableModel.
ItemImageResource is a class I descend from DynamicImageResource by
implementing its abstract method

  protected byte[] getImageData().

This method:
  ·  constructs a ByteArrayResource instance
  ·  using this instance to yield a IResourceStream
  ·  uses the resource stream to yield an InputStream
  ·  reads from this input stream into the byte array, which is returned by
the method.

This shrinks the session size to much closer to where I want it, with no
image data being included in it.

If anyone wants any sample code, then I shall post it here. Alternatively,
if anyone shouts No: this is not the way to do it! then I shall be
listening

Ian Marshall

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Choice-of-Resource-for-my-Image-component-tp3342289p3414698.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: Choice of Resource for my Image component

2011-03-25 Thread Ian Marshall
1.  I changed the image component from Image to NonCachingImage. This seems
to have eliminated my issue of images being shown which were a
previously-shown image instead of the correct one.

2.  The model which I pass to my NonCachingImage is descended from
LoadableDetachableModel. This model class's load() method returned null if
there was no image to display. I believe that this is the cause of the
exception which I was getting. If there is no image, load() now returns

  new ByteArrayResource(null, new byte[0]);

instead. I have yet to see the exception since this change.

3.  All I need to do now is find out why my use of a NonCachingImage
together with my descended LoadableDetachableModel in the form of my web
page still results in huge session size (1MB), which is forbidden in Google
App Engine.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Choice-of-Resource-for-my-Image-component-tp3342289p3405585.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



Choice of Resource for my Image component

2011-03-25 Thread Ian Marshall
Hello Jim,

Could I ask you to post this in a separate topic? This one is for my choice
of resource for my Image component.

Cheers,

Ian

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Choice-of-Resource-for-my-Image-component-tp3342289p3406000.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



Favicon best practice

2011-03-18 Thread Ian Marshall
I would appreciate some advice on best practice for favicons in Wicket

I subclass most of my web pages from a subclass of WebPage. I implement my
favicon in the way set out at the foot of this posting. I have two types of
problem.

1.  When testing the URL http://localhost:8080/favicon.ico; on my local
machine (and a similar, production URL in deployment) I get the error like:

  HTTP ERROR 404 Problem accessing /favicon.ico. Reason: NOT_FOUND


2.  When accessing one of my pages descended from MyBasePage (itself
subclassed from WebPage and incorporating  ...  in its HTML mark-up), I
sometimes get the Google App Engine for Java warning:

  org.apache.wicket.markup.html.PackageResource getResourceStream:
  Unable to find package resource
  [path = ..., style = null, locale = en_GB]


I suspect that I am doing something wrong. Can anyone point me in the right
direction? Any advice would be greatly appreciated.


HTML mark-up

?xml version=1.0 encoding=UTF-8?
lt;!DOCTYPE HTML PUBLIC quot;-//W3C//DTD HTML 4.01//ENquot;
quot;http://www.w3.org/TR/html4/strict.dtdquot;gt;

  
...

...
  



Java code
-
public class MyBasePage extends WebPage
{
  ...

  public MyBasePage(IModel model)
  {
super(model);

// Both the do-nothing ResourcesLocator.java file and my favicon.ico
// file are in the same resources package.

ResourceReference rrefFavicon = new ResourceReference(
 ResourcesLocator.class, favicon.ico);

ResourceLink rlnkFavicon =
 new ResourceLink(lnkFavicon, rrefFavicon);

add(rlnkFavicon);
  }

  ...
}


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386779p3386779.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



Favicon best practice

2011-03-18 Thread Ian Marshall
I would appreciate some advice on best practice for favicons in Wicket

I subclass most of my web pages from a subclass of WebPage. I implement my
favicon in the way set out at the foot of this posting. I have two types of
problem.

1.  When testing the URL http://localhost:8080/favicon.ico; on my local
machine (and a similar, production URL in deployment) I get the error like:

  HTTP ERROR 404 Problem accessing /favicon.ico. Reason: NOT_FOUND


2.  When accessing one of my pages descended from MyBasePage (itself
subclassed from WebPage and incorporating  ...  in its HTML mark-up), I
sometimes get the Google App Engine for Java warning:

  org.apache.wicket.markup.html.PackageResource getResourceStream:
  Unable to find package resource
  [path = ..., style = null, locale = en_GB]


I suspect that I am doing something wrong. Can anyone point me in the right
direction? Any advice would be greatly appreciated.


HTML mark-up

?xml version=1.0 encoding=UTF-8?
lt;!DOCTYPE HTML PUBLIC quot;-//W3C//DTD HTML 4.01//ENquot;
quot;http://www.w3.org/TR/html4/strict.dtdquot;gt;

  
...

...
  



Java code
-
public class MyBasePage extends WebPage
{
  ...

  public MyBasePage(IModel model)
  {
super(model);

// Both the do-nothing ResourcesLocator.java file and my favicon.ico
// file are in the same resources package.

ResourceReference rrefFavicon = new ResourceReference(
 ResourcesLocator.class, favicon.ico);

ResourceLink rlnkFavicon =
 new ResourceLink(lnkFavicon, rrefFavicon);

add(rlnkFavicon);
  }

  ...
}


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386786p3386786.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



Favicon best practice

2011-03-18 Thread Ian Marshall
I would appreciate some advice on best practice for favicons in Wicket

I subclass most of my web pages from a subclass of WebPage. I implement my
favicon in the way set out at the foot of this posting. I have two types of
problem.

1.  When testing the URL http://localhost:8080/favicon.ico; on my local
machine (and a similar, production URL in deployment) I get the error like:

  HTTP ERROR 404 Problem accessing /favicon.ico. Reason: NOT_FOUND


2.  When accessing one of my pages descended from MyBasePage (itself
subclassed from WebPage and incorporating  ...  in its HTML mark-up), I
sometimes get the Google App Engine for Java warning:

  org.apache.wicket.markup.html.PackageResource getResourceStream:
  Unable to find package resource
  [path = ..., style = null, locale = en_GB]


I suspect that I am doing something wrong. Can anyone point me in the right
direction? Any advice would be greatly appreciated.


HTML mark-up

?xml version=1.0 encoding=UTF-8?
lt;!DOCTYPE HTML PUBLIC quot;-//W3C//DTD HTML 4.01//ENquot;
quot;http://www.w3.org/TR/html4/strict.dtdquot;gt;

  
...

...
  



Java code
-
public class MyBasePage extends WebPage
{
  ...

  public MyBasePage(IModel model)
  {
super(model);

// Both the do-nothing ResourcesLocator.java file and my favicon.ico
// file are in the same resources package.

ResourceReference rrefFavicon = new ResourceReference(
 ResourcesLocator.class, favicon.ico);

ResourceLink rlnkFavicon =
 new ResourceLink(lnkFavicon, rrefFavicon);

add(rlnkFavicon);
  }

  ...
}


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386789p3386789.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: Favicon best practice

2011-03-18 Thread Ian Marshall
MOUNTING

In my WebApplication-descended class I tried

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

// New code
ResourceReference rrefFavicon = new ResourceReference(
 ResourcesLocator.class, favicon.ico);
mountSharedResource([path], rrefFavicon.getSharedResourceKey());
  }

where for [path] I tried favicon.ico, /favicon.ico and /favicon.ico/
but not / since that is reserved for the home page, with HTML mark-up

  

but this did not work for me.


PUTTING NEXT TO /WEB-INF

Thanks for this tip; it worked for me!


CONCLUSION
--
Thank you, Martin, for your response. This should have fixed my problem. My
solution is not the neatest one, since I now have two favicon.ico files in
my deployment, but the main thing is that it works.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386789p3387600.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



Choice of Resource for my Image component

2011-03-08 Thread Ian Marshall
Hello,

I have been a naughty boy; I designed my form without using a
LoadableDetachableModel. Serves me right. I have now changed my page's
domain object so that it is used in the form and the form's WebPage using a
LoadableDetachableModel.

So far so good, but I have a problem with my Image component. I used to use
my page's domain object to populate my image component's model like this:

ByteArrayResource resImage = null;
if ((g_pidData.sUploadFileContentType != null)
  (g_pidData.baUploadFileData != null))
  resImage = new ByteArrayResource(g_pidData.sUploadFileContentType,
   g_pidData.baUploadFileData);

Image g_imgImage = new Image(imgImage, resImage);
frmForm.add(g_imgImage);

Basically, I used the return value of

  ByteArrayResource(String sUploadFileContentType, byte[] baUploadFileData);

as the model of my Image component, with g_pidData as my domain object.

Now I have replaced my domain object with a LoadableDetachableModel. This
model's load() method returns a ByteArrayResource instance, created by using
the data members of a g_pidData instance which is local to the page's
constructor. I copy the byte array using Arrays.copyOf(...) before
constructing my ByteArrayResource instance.

I now get the following exception once my page has shown:

  08-Mar-2011 21:24:15 org.apache.wicket.RequestCycle logRuntimeException
  SEVERE: Unable to write the response
  org.apache.wicket.WicketRuntimeException: Unable to write the response
at org.apache.wicket.Response.handleException(Response.java:286)
at org.apache.wicket.Response.write(Response.java:310)
...
  Caused by: java.io.IOException: Closed
at
org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:629)
at
org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:579)
at org.apache.wicket.util.io.Streams.copy(Streams.java:159)
at org.apache.wicket.util.io.Streams.copy(Streams.java:126)
at org.apache.wicket.Response.write(Response.java:306)
... 32 more


Am I using the correct resource for my image component, or should I use a
better one?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Choice-of-Resource-for-my-Image-component-tp3342289p3342289.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



The disabling of sessions during a datastore down-time period

2011-02-11 Thread Ian Marshall

Hello All,

I am developing an application which runs on Google App Engine (GAE). I have
my persistent datastore such that every so often there are scheduled
down-times, during which nothing can be persisted to the datastore without
an error being thrown.

Currently, my web application class extends
org.apache.wicket.protocol.http.WebApplication and has the relevant method
override:

  @Override
  protected ISessionStore newSessionStore()
  {
return new HttpSessionStore(this);
  }

so the app does not store sessions to file (write to file are not allowed in
GAE) but to the datastore instead.

I love Wicket and I know that it stores stuff server-side to work its magic.

Does anyone know a way for my app to suspend Wicket's use of sessions at
run-time?

For background information on my question, I invite you to visit:

 
http://groups.google.com/group/google-appengine-java/browse_thread/thread/7744eef8e1e39684

Many thanks for anyone's attention,

Ian
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/The-disabling-of-sessions-during-a-datastore-down-time-period-tp3301011p3301011.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: FOSDEM 2011 presentation online

2011-02-08 Thread Ian Marshall

Informative slides, excellent web application development framework, looking
forward to Apache Wicket version 1.5.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FOSDEM-2011-presentation-online-tp3264941p3275633.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: How to Replace Choose One with Blank () in DropDown

2011-02-03 Thread Ian Marshall

Hi James,

Thanks for the tip about

  Form1.choice1.null=Something Else

I was always wondering how to change that text but now I can do it.

Thanks again,

Ian
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-Replace-Choose-One-with-Blank-in-DropDown-tp3256149p3257817.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



What governs how component validators are formatted?

2010-12-10 Thread Ian Marshall

I have overridden my org.apache.wicket.protocol.http.WebApplication's
newConverterLocator() method by setting my own custom IConverter for the
Float class in this method's returned ConverterLocator object.

This has the desired affect for my TextFieldFloat components. However, I
have noticed that this custom conversion is not applied to feedback messages
resulting from these components' RangeValidatorFloat(...) validators.

Does anyone know how I can adjust the formatting of validators, or am I just
stuck with what I get? (I set out relevant output and code snippets below.)


Feedback message displayed
--
Your entered value is either less than the minimum of £0.01 or greater than
the maximum of £1.0E7 that we allow.


HTML mark-up

input type=text wicket:id=flMinPriceInPounds size=12/


Java code
-
TextFieldFloat txtMinPriceInPounds =
 new TextFieldFloat(flMinPriceInPounds, Float.class);
txtMinPriceInPounds.add(new RangeValidatorFloat(Float.valueOf(0.01f),
 Float.valueOf(1000.00f)));
frmForm.add(txtMinPriceInPounds);


Property for component validator

frmForm.flMinPriceInPounds.RangeValidator = Your entered value is \
either less than the minimum of £${minimum} \
or greater than the maximum of £${maximum} that we allow.


Feedback message generated mark-up
--
div wicket:id=fbpnlFeedbackPanel
wicket:panel
ul wicket:id=feedbackul class=feedbackPanel
li wicket:id=messages 
class=feedbackPanelERROR
Your entered value is either less than 
the minimum of £0.01 or greater
than the maximum of £1.0E7 that we allow.
/li
/ul
/wicket:panel
/div

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/What-governs-how-component-validators-are-formatted-tp3081781p3081781.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



Displaying decimal places using a TextFieldFloat

2010-12-06 Thread Ian Marshall

I use a TextFieldFloat as shown below. Since this field represents a
currency unit (in this case, pound sterling) I want to have two decimal
places shown always. For example:
  0.00
  5.00
  6.10
  3.28.

What I find when I run my web application is that, after form submission,
the model's Float value is always shown without any trailing zeroes in the
decimals. To use the same examples again, I get:
  0
  5
  6.1
  3.28.

Is there anything simple I can do to get my component to display two decimal
places always?

(Failing this, I intend to work around my problem by changing the
TextFieldFloat to a TextField with a String for its model, and converting
this String to a Float value myself after form submission.)


HTML mark-up

  lt;input type=text wicket:id=flPriceInPounds size=10/gt;


Java code (within a WebPage)

  Form frmForm = new Form(frmForm)
  {
[...]
  };
  frmForm.setModel(new CompoundPropertyModel([...]));
  add(frmForm);

  TextFieldFloat txtMriceInPounds =
   new TextFieldFloat(flPriceInPounds, Float.class);
  frmForm.add(txtPriceInPounds);


Java code: declaration within the form's compound property model

  public Float flPriceInPounds = null;


Regards,

Ian Marshall
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Displaying-decimal-places-using-a-TextField-Float-tp3074547p3074547.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: Displaying decimal places using a TextFieldFloat

2010-12-06 Thread Ian Marshall

Thanks Igor and Pedro. I'll do that.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Displaying-decimal-places-using-a-TextField-Float-tp3074547p3074627.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: Preventing user input script-injection attacks

2010-11-29 Thread Ian Marshall

Igor

I was unaware of the class org.apache.wicket.util.string.Strings, let alone
that package. The Strings.escapeMarkup(...) method you mentioned fits my
needs exactly. Thank you.


Michał
--
Thank you also for your tip. I shall be using the Wicket method that Igor
mentioned. I shall also be having a play with that package to see what else
is there!


Regards,

Ian
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Preventing-user-input-script-injection-attacks-tp3059119p3064004.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: Preventing user input script-injection attacks

2010-11-26 Thread Ian Marshall

Hello Igor,

I remain an Ant person for now and not a Maven person, so instead of a
quickstart project I attach HTML and Java code for a Wicket test page:

  
http://apache-wicket.1842946.n4.nabble.com/file/n3060397/PageSpecificTest.html
PageSpecificTest.html 
  
http://apache-wicket.1842946.n4.nabble.com/file/n3060397/PageSpecificTest.java
PageSpecificTest.java 

I commented out the log output in case you use a different log output method
to me.

This web page accepts input in a TextField and TextAreaString component,
and after form submission it renders this input in both the original
components and also as copied to a Label and TextArea component
respectively.

My results are that Wicket does indeed escape the mark-up in rendered
components automatically. However, the strings stored in the components'
models are not escaped.

To save you running the attached Wicket web page, I set out my
post-submission results below. Firstly is some log output from the component
models, and then the page source of the four components mentioned above:


  26-Nov-2010 13:43:14 [...].PageSpecificTest doSubmit
   FINE: g_pstdData data member values are:
sSingleLineInput  = /body
sMultiLineInput   = !--.


input type=text wicket:id=sSingleLineInput size=40 tabindex=1
value=amp;lt;/bodyamp;gt; name=sSingleLineInput/

lt;span wicket:id=sSingleLineOutputamp;lt;/bodyamp;gt;

textarea wicket:id=sMultiLineInput cols=50 rows=10 tabindex=2
name=sMultiLineInputamp;lt;!--/textarea

textarea wicket:id=sMultiLineOutput cols=50 rows=10 tabindex=4
name=sMultiLineOutputamp;lt;!--/textarea


Is this expected Wicket behaviour? If so, then I shall need to strip
scripting from the model strings myself (hopefully using one of the examples
kindly supplied already in this topic). If not, then I submit this post for
your evaluation.

(I raise this topic because I build an address in Java code from several
address elements, each one gathered by a TextField component. I then output
the resultant address, which currently allows scripting through without
having been escaped.)

I looking forward to hearing any views,

Ian
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Preventing-user-input-script-injection-attacks-tp3059119p3060397.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



Preventing user input script-injection attacks

2010-11-25 Thread Ian Marshall

If a user has entered some HTML in a TextField or TextAreaString when I do
not want HTML to be entered, what is a good way to prevent this?

Currently, I store the offending strings and then render them using a Label
or MultiLineLabel, but for neither component does

  Component.setEscapeModelStrings(true);

have an effect (presumably since this setting is already true by default).

Am I condemned to coding a method to examine the models of my TextField and
TextAreaString components at form-submission-time and remove any HTML code
manually?

Any comments would be appreciated,

Ian
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Preventing-user-input-script-injection-attacks-tp3059119p3059119.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: Preventing user input script-injection attacks

2010-11-25 Thread Ian Marshall

Sorry about that. By I do not want HTML to be entered I meant character
strings which are rendered by a browser additional to, or instead of, being
displayed as that character string. Examples are:

  !--

  /body

  onclick='[Some nasty JavaScript]';

Basically, I want to remove nasty code being injected into future rendered
HTML by user input.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Preventing-user-input-script-injection-attacks-tp3059119p3059321.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: Preventing user input script-injection attacks

2010-11-25 Thread Ian Marshall

Thanks for that, Patrick.

I'll take a look at these tomorrow to see what they have got.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Preventing-user-input-script-injection-attacks-tp3059119p3059322.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: How can I reload HTML in app engine?

2010-10-21 Thread Ian Marshall

If you don't get an answer here, do you want to try posting on

  http://groups.google.com/group/google-appengine-java

then then click the Discussions link to see if you get any joy there?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-tp3005241p3005424.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: My New Book: Now in Dead Tree Format

2010-10-18 Thread Ian Marshall

Will there be any chance of this book being available on www.Amazon.co.uk?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/My-New-Book-Now-in-Dead-Tree-Format-tp2998832p2999880.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: Feedback message does not show in new WebPage

2010-10-14 Thread Ian Marshall

(Sorry for the delay in responding. I was tied up in some coding which I
wanted to get done to save having to relearn it all again to finish it.)

Thanks for the code tip. I added

  IPageSettings ipsSettings = getPageSettings();
  ipsSettings.setAutomaticMultiWindowSupport(false);

to my WebApplication#init() method.

In my first test with the stale link, I kept getting my session expired web
page (called through my code

  IApplicationSettings isSettings = getApplicationSettings();
  isSettings.setPageExpiredErrorPage(PageErrorSessionExpired.class);

in the same init() method).

In my second test, all worked well and I got the required feedback message.
I'll keep an eye on this expired session issue: it might be a red herring
and a one-off occurrence. I test against a local instance of a Google App
Engine development server and I almost never get an expired session during
my testing.

Thank you again for your tip - it got my stale link feedback message to
show!

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Feedback-message-does-not-show-in-new-WebPage-tp2993413p2995909.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



Feedback message does not show in new WebPage

2010-10-13 Thread Ian Marshall

Hello All,

I have a link, which when clicked causes a new web page to be shown.


HTML fragment
--
lt;a wicket:id=lnkPay href=#gt;Paylt;/agt;


Java fragment
-
LinkString lnkPay = new LinkString(lnkPay, new ModelString())
{
private static final long serialVersionUID = 1L;

@Override
public void onClick()
{
PageBuyOptions pgNext = new PageBuyOptions(...);
setResponsePage(pgNext);
}
};
lnkPay.setVisible(...);
liItem.add(lnkPay);


This new page has some validation code to ensure that the relevant status is
such that the page can offer the next step to the user. Should the status
have advanced (and so the link to get there is stale and should no longer
be visible, but it is visible since it was rendered to the user before the
status advanced) the new page (disables its OK button and) displays a
feedback message to the user.

HTML fragment
--
div wicket:id=fbpnlFeedbackPanel/


Java fragment
-
FeedbackPanel fbpnlFeedbackPanel = new FeedbackPanel(fbpnlFeedbackPanel);
add(fbpnlFeedbackPanel);

public PageBuyOptions(String sItemEncodedKey)
{
super();

if ([status has changed])
{
// MySession extends WebSession
MySession ssnSession = (MySession)getSession();

ssnSession.error([Link is stale]);
...
}

FormPageBuyOptionsData frmForm = new 
FormPageBuyOptionsData(frmForm)
{
...
}

...
}


This all works fine, and the feedback message shows as expected in the new
page. But there are two use cases when the new page is shown without the
expected feedback message: when the stale link is clicked using Open Link
in New Window or Open Link in New Tab.

Is this non-appearance of a feedback message in these two cases expected
Wicket behaviour? Am I missing something or doing something wrong? I would
appreciate any tips.

Ian Marshall
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Feedback-message-does-not-show-in-new-WebPage-tp2993413p2993413.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: Coding - On Software Design Process

2010-10-04 Thread Ian Marshall

I have stored the sole (Kindle) edition in my Amazon wish list, as my
reminder object to search for the future paperback edition from time to
time.

I am looking forward to a good read.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Coding-On-Software-Design-Process-tp2720854p2953979.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: Preventing warnAboutFormComponentInsideEnclosure log entries

2010-09-27 Thread Ian Marshall

Thanks Igor.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Preventing-warnAboutFormComponentInsideEnclosure-log-entries-tp2549176p2715101.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



Preventing warnAboutFormComponentInsideEnclosure log entries

2010-09-21 Thread Ian Marshall

I make moderate use of the wicket:enclosure/ tag in my Wicket HTML. I
notice now that (in development mode) I get log entries of the form

  21-Sep-2010 11:04:04 org.apache.wicket.markup.html.internal.Enclosure
  warnAboutFormComponentInsideEnclosure
  WARNING: Found a form component RadioChoice/frmForm:rcWebSiteMode inside
an enclosure.
  Form components do not work well inside wicket:enclosure tags, use
EnclosureContainer instead

whereas a while before now I did not.

To prevent such log entries being made without changing my
logging.properties file, I change my code as per my example below, using
instances of org.apache.wicket.markup.html.basic.EnclosureContainer instead
of wicket:enclosure/ tags.

Since I am aware of no problem with my wicket:enclosure/ tags, can I just
silence these new log messages, or am I condemned to replace all my
wicket:enclosure/ tags which enclose form components with
EnclosureContainer instances (with all the HTML and Java code changes that
this will require)?


  Old HTML code
  -
wicket:enclosure child=rcWebSiteMode
tr
td
br/
/td
/tr

tr
td
Web sites to search:
nbsp;nbsp;nbsp;nbsp;
/td
td
sp_an wicket:id=rcWebSiteMode tabindex=5
input type=radio/Option 1br/
input type=radio/Option 2br/
/sp_an
/td
/tr
/wicket:enclosure

  Old Java code
  -
Form frmForm = new Form(...);
add(frmForm);

RadioChoiceListChoiceItem rcWebSiteMode =
 new RadioChoiceListChoiceItem(rcWebSiteMode, lciItems, crRenderer);
rcWebSiteMode.setRequired(true);
if (...)
rcWebSiteMode.setVisible(false);
frmForm.add(rcWebSiteMode);




  New HTML code
  -
wicket:container wicket:id=enclAddItem
tr
td
br/
/td
/tr

tr
td
Web sites to search:
nbsp;nbsp;nbsp;nbsp;
/td
td
sp_an wicket:id=rcWebSiteMode tabindex=5
input type=radio/Option 1br/
input type=radio/Option 2br/
/sp_an
/td
/tr
/wicket:container


  New Java code
  -
  import org.apache.wicket.markup.html.basic.EnclosureContainer;

Form frmForm = new Form(...);
add(frmForm);

RadioChoiceListChoiceItem rcWebSiteMode =
 new RadioChoiceListChoiceItem(rcWebSiteMode, lciItems, crRenderer);
rcWebSiteMode.setRequired(true);
if (...)
rcWebSiteMode.setVisible(false);

EnclosureContainer enclAddItem = new EnclosureContainer(enclAddItem,
 rcWebSiteMode);
enclAddItem.add(rcWebSiteMode);
frmForm.add(enclAddItem);
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Preventing-warnAboutFormComponentInsideEnclosure-log-entries-tp2549176p2549176.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: Best way to hide a component

2010-07-23 Thread Ian Marshall

Don't forget using the wicket:enclosure tag. For example:

  wicket:enclosure child=lnk1
 # One 
|
 # Two 
  /wicket:enclosure


  Link lnk1 = new Link(lnk1)
  {
private static final long serialVersionUID = 1L;

@Override
public void onClick()
{
  //
  // ...
  //
}
  };
  lnk1.setVisible(...);
  add(lnk1);


  Link lnk2 = new Link(lnk2)
  {
private static final long serialVersionUID = 1L;

@Override
public void onClick()
{
  //
  // ...
  //
}
  };
  // I want lnk1 and lnk2 to have the same visibility.
  // I do not need to set lnk2's visibility if I use the wicket:enclosure
tag instead.
  add(lnk2);


ensures that both links are visible if lnk1 is visible and neither link is
visible if lnk1 is invisible (whilst leaving the visibility of lnk2 to the
default of true).
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Best-way-to-hide-a-component-tp2299412p2299932.html
Sent from the Wicket - User 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: Best way to hide a component

2010-07-23 Thread Ian Marshall

My HTML code did not come out correctly. I wanted it displayed as:

  wicket:enclosure child=lnk1
lt;a wicket:id=lnk1 href=# tabindex=2001gt;Onelt;/agt;
|
lt;a wicket:id=lnk2 href=# tabindex=2002gt;Twolt;/agt;
  /wicket:enclosure
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Best-way-to-hide-a-component-tp2299412p2299938.html
Sent from the Wicket - User 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: Welcome Martin Grigorov as a core team member

2010-07-20 Thread Ian Marshall

Many congratulations Martin!

(In my extremely limited experience with web application frameworks, Wicket
is just so excellent. Developing with Wicket really is fun, too.)
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Welcome-Martin-Grigorov-as-a-core-team-member-tp2294324p2295166.html
Sent from the Wicket - User 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: Question - Does Wicket really initialize a page instance once?

2010-07-12 Thread Ian Marshall

I have solved my problem.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2286113.html
Sent from the Wicket - User 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: Question - Does Wicket really initialize a page instance once?

2010-07-09 Thread Ian Marshall


avrahamr wrote:
 
 But you can rely on object values, so if
 you correctly implement hash and equals it should be fine.
 

I too have a problem with multiple calls to a WebPage constructor

I have a bookmarkable page, a link to which can be followed from a
verification E-mail which the app has sent. Following the link results in my
page constructor being called: in it I check the parameters for correct
values and then update my persistent datastore, if appropriate.

During developer testing I find that the constructor is often called twice.

I have a basic silly question to ask: how can I use hash and equals (or any
other approach) to ensure that my parameter checking and datastore update
code is called once only?


Extract of my code
--
public class PageVerifyEMail extends PageBase// extends WebPage
{
  private static final long serialVersionUID = 1L;

  private static final Logger g_logger =
Logger.getLogger(PageVerifyEMail.class.getName());

  private int g_nConstructCount = 0;

  public PageVerifyEMail(PageParameters params)
  {
super();

g_nConstructCount++;
g_logger.log(Level.FINE, String.format(g_nConstructCount = %d.,
g_nConstructCount));

//
// Check parameters.
// If appropriate then update the persistent datastore.
// Set appropriate feedback text in the page's components.
//
  }

  //
  // Add components to the page
  //
}
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2283235.html
Sent from the Wicket - User 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: Request for how to process incoming E-mails on Google App Engine

2010-07-01 Thread Ian Marshall

I have set things up now to event code code in a new servlet, and I can now
access the in-coming E-mail message too. Thank you for the tip.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Request-for-how-to-process-incoming-E-mails-on-Google-App-Engine-tp2272758p2274988.html
Sent from the Wicket - User 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



Request for how to process incoming E-mails on Google App Engine

2010-06-30 Thread Ian Marshall

I am developing a Wicket application on Google App Engine for Java (GAE/J).

I want to process incoming E-mails, which GAE/J routes to addr...@[gae
application ID].appspotmail.com by sending a HTTP POST request to the
application-relative URL:

  /_ah/mail/[addr...@[gae application ID].appspotmail.com]

Can anyone tell me how I can adjust my web.xml file and
WebApplication-derived class so that I can use a filter to launch some Java
code on E-mail reception?

Google suggests that this code should include the fragment

import java.io.IOException;
import java.util.Properties;
import javax.mail.Session;
import javax.mail.internet.MimeMessage;
import javax.servlet.http.*;

public class MailHandlerServlet extends HttpServlet
{
  public void doPost(HttpServletRequest req, HttpServletResponse resp)
   throws IOException
  {
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
MimeMessage message = new MimeMessage(session,
req.getInputStream());
...
  }
}

which I may need to access the details of the E-mail message. Any pointers
that people could give me would be much appreciated!

Regards,

Ian Marshall
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Request-for-how-to-process-incoming-E-mails-on-Google-App-Engine-tp2272758p2272758.html
Sent from the Wicket - User 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



Wicket 1.4.9 release: is this a stable release?

2010-06-08 Thread Ian Marshall

Hello,

I apologise if my question above is out of date and therefore foolish

When I visit the Apache Wicket home page, I am told Apache Wicket 1.4.9
Released. However, when I follow the link Go and download Wicket, then I
am told that Apache Wicket 1.4.8 is the current stable release.

Can I assume that 1.4.9 is a stable release and it's just that the web page

  http://wicket.apache.org/getting-wicket.html

has not been updated yet?

Regards,

Ian Marshall
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-9-release-is-this-a-stable-release-tp2247599p2247599.html
Sent from the Wicket - User 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



Wicket GAE performance

2010-04-06 Thread Ian Marshall

Hi Tony,

I presume that you have studied the GAE/J documentation about datastore
transactions at

 
http://code.google.com/intl/en/appengine/docs/java/datastore/transactions.html;.


In particular, I note:

JDO performs all actions between the call to tx.begin() and the call to
tx.commit() in a single transaction. If any action fails due to the
requested entity group being in use by another process, JDO throws a
JDODataStoreException or a JDOException, cause by a
java.util.ConcurrentModificationException.


In essence, let the JDO transaction do all the work for you! This should
help you in the case where a maximum of one thread (= request) only is
allowed to update persistent data at any time. All you will need to do then
(apart from thinking though your design) is to handle the exceptions
mentioned properly.

Cheers,

Ian


Anton Veretennikov wrote:
 
 Thank you very much, Ian, you clarified some things to me.
 
 I'm trying to block some entity got for processing by one session from
 other
 possibly concurrent session.
 I know what i would do if it were RDBMS: lock my object with FOR UPDATE,
 if success, i would check if status field is still what i assume it must
 be
 and then update it to new status.
 
 But i'm not sure yet how to do this in GAE.
 
 -- Tony
 
-- 
View this message in context: 
http://old.nabble.com/Wicket-GAE-performance-tp28118591p28149943.html
Sent from the Wicket - User 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



  1   2   >