Re: Quick Start Error with 8.7.0 - The desired archetype does not exist

2020-04-10 Thread Bruce Lombardi
This worked after upgrade to latest version on Maven (3.6.30). 

Bruce

Sent from my iPad

> On Apr 10, 2020, at 8:36 AM, Martin Grigorov  wrote:
> 
> Hi,
> 
> It works fine for me:
> 
> mvn archetype:generate -DarchetypeGroupId=org.apache.wicket
> -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=8.7.0
> -DgroupId=4MyTestCompany -DartifactId=testWicket8 -DarchetypeRepository=
> https://repository.apache.org/ -DinteractiveMode=false
> [INFO] Scanning for projects...
> [INFO]
> [INFO] --< org.apache.maven:standalone-pom
>> ---
> [INFO] Building Maven Stub Project (No POM) 1
> [INFO] [ pom
> ]-
> [INFO]
> [INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) >
> generate-sources @ standalone-pom >>>
> [INFO]
> [INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) <
> generate-sources @ standalone-pom <<<
> [INFO]
> [INFO]
> [INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @
> standalone-pom ---
> [INFO] Generating project in Batch mode
> [INFO] Archetype repository not defined. Using the one from
> [org.apache.wicket:wicket-archetype-quickstart:9.0.0-M4] found in catalog
> remote
> [INFO] Downloading from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.pom
> [INFO] Downloaded from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.pom
> (2.7 kB at 21 kB/s)
> [INFO] Downloading from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-parent/8.7.0/wicket-parent-8.7.0.pom
> [INFO] Downloaded from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-parent/8.7.0/wicket-parent-8.7.0.pom
> (42 kB at 629 kB/s)
> [INFO] Downloading from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.jar
> [INFO] Downloaded from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.jar
> (30 kB at 475 kB/s)
> [INFO]
> 
> [INFO] Using following parameters for creating project from Archetype:
> wicket-archetype-quickstart:8.7.0
> [INFO]
> 
> [INFO] Parameter: groupId, Value: 4MyTestCompany
> [INFO] Parameter: artifactId, Value: testWicket8
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO] Parameter: package, Value: 4MyTestCompany
> [INFO] Parameter: packageInPathFormat, Value: 4MyTestCompany
> [INFO] Parameter: package, Value: 4MyTestCompany
> [INFO] Parameter: groupId, Value: 4MyTestCompany
> [INFO] Parameter: artifactId, Value: testWicket8
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO] Project created from Archetype in dir: /tmp/testWicket8
> [INFO]
> 
> [INFO] BUILD SUCCESS
> [INFO]
> ----
> [INFO] Total time:  2.944 s
> [INFO] Finished at: 2020-04-10T15:35:22+03:00
> [INFO]
> 
> 
>> On Fri, Apr 10, 2020 at 3:28 PM Bruce Lombardi  wrote:
>> 
>> Hi,
>> 
>> 
>> 
>> I tried to use the Quick Start to get wicket 8.7.0 .
>> 
>> 
>> 
>> The command line generated on the Wicked site is as follows (except I added
>> the -X switch and ran it again after getting the error to get more
>> information).
>> 
>> 
>> 
>> mvn -X archetype:generate -DarchetypeGroupId=org.apache.wicket
>> -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=8.7.0
>> -DgroupId=4MyTestCompany -DartifactId=testWicket8
>> -DarchetypeRepository=https://repository.apache.org/
>> -DinteractiveMode=false
>> 
>> 
>> 
>> 
>> 
>> The full trace is below, but the error seems to be:
>> 
>> 
>> 
>> "The desired archetype does not exist
>> (org.apache.wicket:wicket-archetype-quickstart:8.7.0)"
>> 
>> 
>> 
>> Is this really missing or is there something wrong with my Maven set up?
>> 
>> 
>> 
>> Bruce
>> 
>> 
>> 
>> 
>> 
>> [DEBUG]   Included: org.codehaus.groovy:groovy:jar:1.8.3
>> 
>> [DEBUG]   Included: antlr:antlr:jar

Re: Quick Start Error with 8.7.0 - The desired archetype does not exist

2020-04-10 Thread Bruce Lombardi



Bruce

Sent from my iPad

> On Apr 10, 2020, at 8:36 AM, Martin Grigorov  wrote:
> 
> Hi,
> 
> It works fine for me:
> 
> mvn archetype:generate -DarchetypeGroupId=org.apache.wicket
> -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=8.7.0
> -DgroupId=4MyTestCompany -DartifactId=testWicket8 -DarchetypeRepository=
> https://repository.apache.org/ -DinteractiveMode=false
> [INFO] Scanning for projects...
> [INFO]
> [INFO] --< org.apache.maven:standalone-pom
>> ---
> [INFO] Building Maven Stub Project (No POM) 1
> [INFO] [ pom
> ]-
> [INFO]
> [INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) >
> generate-sources @ standalone-pom >>>
> [INFO]
> [INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) <
> generate-sources @ standalone-pom <<<
> [INFO]
> [INFO]
> [INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @
> standalone-pom ---
> [INFO] Generating project in Batch mode
> [INFO] Archetype repository not defined. Using the one from
> [org.apache.wicket:wicket-archetype-quickstart:9.0.0-M4] found in catalog
> remote
> [INFO] Downloading from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.pom
> [INFO] Downloaded from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.pom
> (2.7 kB at 21 kB/s)
> [INFO] Downloading from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-parent/8.7.0/wicket-parent-8.7.0.pom
> [INFO] Downloaded from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-parent/8.7.0/wicket-parent-8.7.0.pom
> (42 kB at 629 kB/s)
> [INFO] Downloading from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.jar
> [INFO] Downloaded from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.jar
> (30 kB at 475 kB/s)
> [INFO]
> 
> [INFO] Using following parameters for creating project from Archetype:
> wicket-archetype-quickstart:8.7.0
> [INFO]
> 
> [INFO] Parameter: groupId, Value: 4MyTestCompany
> [INFO] Parameter: artifactId, Value: testWicket8
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO] Parameter: package, Value: 4MyTestCompany
> [INFO] Parameter: packageInPathFormat, Value: 4MyTestCompany
> [INFO] Parameter: package, Value: 4MyTestCompany
> [INFO] Parameter: groupId, Value: 4MyTestCompany
> [INFO] Parameter: artifactId, Value: testWicket8
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO] Project created from Archetype in dir: /tmp/testWicket8
> [INFO]
> 
> [INFO] BUILD SUCCESS
> [INFO]
> ----
> [INFO] Total time:  2.944 s
> [INFO] Finished at: 2020-04-10T15:35:22+03:00
> [INFO]
> 
> 
>> On Fri, Apr 10, 2020 at 3:28 PM Bruce Lombardi  wrote:
>> 
>> Hi,
>> 
>> 
>> 
>> I tried to use the Quick Start to get wicket 8.7.0 .
>> 
>> 
>> 
>> The command line generated on the Wicked site is as follows (except I added
>> the -X switch and ran it again after getting the error to get more
>> information).
>> 
>> 
>> 
>> mvn -X archetype:generate -DarchetypeGroupId=org.apache.wicket
>> -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=8.7.0
>> -DgroupId=4MyTestCompany -DartifactId=testWicket8
>> -DarchetypeRepository=https://repository.apache.org/
>> -DinteractiveMode=false
>> 
>> 
>> 
>> 
>> 
>> The full trace is below, but the error seems to be:
>> 
>> 
>> 
>> "The desired archetype does not exist
>> (org.apache.wicket:wicket-archetype-quickstart:8.7.0)"
>> 
>> 
>> 
>> Is this really missing or is there something wrong with my Maven set up?
>> 
>> 
>> 
>> Bruce
>> 
>> 
>> 
>> 
>> 
>> [DEBUG]   Included: org.codehaus.groovy:groovy:jar:1.8.3
>> 
>> [DEBUG]   Included: antlr:antlr:jar:2.7.7
>> 
>> [DEBUG]   Included

Re: Quick Start Error with 8.7.0 - The desired archetype does not exist

2020-04-10 Thread Bruce Lombardi
Thanks Martin,

I tried again and still no luck. I’ll have to look deeper into my maven 
configuration I guess.

Any other ideas would be appreciated.

Bruce

Sent from my iPad

> On Apr 10, 2020, at 8:36 AM, Martin Grigorov  wrote:
> 
> Hi,
> 
> It works fine for me:
> 
> mvn archetype:generate -DarchetypeGroupId=org.apache.wicket
> -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=8.7.0
> -DgroupId=4MyTestCompany -DartifactId=testWicket8 -DarchetypeRepository=
> https://repository.apache.org/ -DinteractiveMode=false
> [INFO] Scanning for projects...
> [INFO]
> [INFO] --< org.apache.maven:standalone-pom
>> ---
> [INFO] Building Maven Stub Project (No POM) 1
> [INFO] [ pom
> ]-
> [INFO]
> [INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) >
> generate-sources @ standalone-pom >>>
> [INFO]
> [INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) <
> generate-sources @ standalone-pom <<<
> [INFO]
> [INFO]
> [INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @
> standalone-pom ---
> [INFO] Generating project in Batch mode
> [INFO] Archetype repository not defined. Using the one from
> [org.apache.wicket:wicket-archetype-quickstart:9.0.0-M4] found in catalog
> remote
> [INFO] Downloading from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.pom
> [INFO] Downloaded from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.pom
> (2.7 kB at 21 kB/s)
> [INFO] Downloading from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-parent/8.7.0/wicket-parent-8.7.0.pom
> [INFO] Downloaded from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-parent/8.7.0/wicket-parent-8.7.0.pom
> (42 kB at 629 kB/s)
> [INFO] Downloading from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.jar
> [INFO] Downloaded from central:
> https://repo.maven.apache.org/maven2/org/apache/wicket/wicket-archetype-quickstart/8.7.0/wicket-archetype-quickstart-8.7.0.jar
> (30 kB at 475 kB/s)
> [INFO]
> 
> [INFO] Using following parameters for creating project from Archetype:
> wicket-archetype-quickstart:8.7.0
> [INFO]
> 
> [INFO] Parameter: groupId, Value: 4MyTestCompany
> [INFO] Parameter: artifactId, Value: testWicket8
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO] Parameter: package, Value: 4MyTestCompany
> [INFO] Parameter: packageInPathFormat, Value: 4MyTestCompany
> [INFO] Parameter: package, Value: 4MyTestCompany
> [INFO] Parameter: groupId, Value: 4MyTestCompany
> [INFO] Parameter: artifactId, Value: testWicket8
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO] Project created from Archetype in dir: /tmp/testWicket8
> [INFO]
> 
> [INFO] BUILD SUCCESS
> [INFO]
> ----
> [INFO] Total time:  2.944 s
> [INFO] Finished at: 2020-04-10T15:35:22+03:00
> [INFO]
> 
> 
>> On Fri, Apr 10, 2020 at 3:28 PM Bruce Lombardi  wrote:
>> 
>> Hi,
>> 
>> 
>> 
>> I tried to use the Quick Start to get wicket 8.7.0 .
>> 
>> 
>> 
>> The command line generated on the Wicked site is as follows (except I added
>> the -X switch and ran it again after getting the error to get more
>> information).
>> 
>> 
>> 
>> mvn -X archetype:generate -DarchetypeGroupId=org.apache.wicket
>> -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=8.7.0
>> -DgroupId=4MyTestCompany -DartifactId=testWicket8
>> -DarchetypeRepository=https://repository.apache.org/
>> -DinteractiveMode=false
>> 
>> 
>> 
>> 
>> 
>> The full trace is below, but the error seems to be:
>> 
>> 
>> 
>> "The desired archetype does not exist
>> (org.apache.wicket:wicket-archetype-quickstart:8.7.0)"
>> 
>> 
>> 
>> Is this really missing or is there something wrong with my Maven set up?
>> 
>> 
>> 
>> Bruce
>> 
>> 
>> 
>> 
>> 
>> [DEBUG]   Included: o

Quick Start Error with 8.7.0 - The desired archetype does not exist

2020-04-10 Thread Bruce Lombardi
Hi,

 

I tried to use the Quick Start to get wicket 8.7.0 .

 

The command line generated on the Wicked site is as follows (except I added
the -X switch and ran it again after getting the error to get more
information).

 

mvn -X archetype:generate -DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=8.7.0
-DgroupId=4MyTestCompany -DartifactId=testWicket8
-DarchetypeRepository=https://repository.apache.org/ -DinteractiveMode=false

 

 

The full trace is below, but the error seems to be:

 

"The desired archetype does not exist
(org.apache.wicket:wicket-archetype-quickstart:8.7.0)"

 

Is this really missing or is there something wrong with my Maven set up?

 

Bruce

 

 

[DEBUG]   Included: org.codehaus.groovy:groovy:jar:1.8.3

[DEBUG]   Included: antlr:antlr:jar:2.7.7

[DEBUG]   Included: asm:asm:jar:3.2

[DEBUG]   Included: asm:asm-commons:jar:3.2

[DEBUG]   Included: asm:asm-util:jar:3.2

[DEBUG]   Included: asm:asm-analysis:jar:3.2

[DEBUG]   Included: asm:asm-tree:jar:3.2

[DEBUG]   Included: org.beanshell:bsh:jar:2.0b4

[DEBUG]   Included: org.apache.maven.shared:maven-script-interpreter:jar:1.0

[DEBUG]   Included: org.apache.ant:ant:jar:1.8.1

[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.8

[DEBUG]   Excluded:
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1

[DEBUG]   Excluded: junit:junit:jar:4.8.2

[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-core:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.8

[DEBUG]   Excluded:
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-error-diagnostics:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.8

[DEBUG]   Excluded: org.apache.maven:maven-monitor:jar:2.0.8

[DEBUG]   Excluded: classworlds:classworlds:jar:1.1

[DEBUG] Configuring mojo
org.apache.maven.plugins:maven-archetype-plugin:2.2:generate from plugin
realm ClassRealm[plugin>org.apache.maven.plugins:maven-archetype-plugin:2.2,
parent: sun.misc.Launcher$AppClassLoader@4e25154f]

[DEBUG] Setting property: classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.

[DEBUG] Setting property: site.resource.loader.class =>
'org.codehaus.plexus.velocity.SiteResourceLoader'.

[DEBUG] Setting property: velocimacro.messages.on => 'false'.

[DEBUG] Setting property: resource.loader => 'classpath,site'.

[DEBUG] Setting property: runtime.log.invalid.references => 'false'.

[DEBUG] Setting property: resource.manager.logwhenfound => 'false'.

[DEBUG] ***

[DEBUG] Starting Apache Velocity v1.5 (compiled: 2007-02-22 08:52:29)

[DEBUG] RuntimeInstance initializing.

[DEBUG] Default Properties File:
org\apache\velocity\runtime\defaults\velocity.properties

[DEBUG] LogSystem has been deprecated. Please use a LogChute implementation.

[DEBUG] Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)

[DEBUG] ResourceLoader instantiated:
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader

[DEBUG] ResourceLoader instantiated:
org.codehaus.plexus.velocity.SiteResourceLoader

[DEBUG] ResourceCache: initialized (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)

[DEBUG] Default ResourceManager initialization complete.

[DEBUG] Loaded System Directive:
org.apache.velocity.runtime.directive.Literal

[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Macro

[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Parse

[DEBUG] Loaded System Directive:
org.apache.velocity.runtime.directive.Include

[DEBUG] Loaded System Directive:
org.apache.velocity.runtime.directive.Foreach

[DEBUG] Created '20' parsers.

[DEBUG] Velocimacro : initialization starting.

[DEBUG] Velocimacro : allowInline = true : VMs can be defined inline in
templates

[DEBUG] Velocimacro : allowInlineToOverride = false : VMs defined inline may
NOT replace previous VM definitions

[DEBUG] Velocimacro : allowInlineLocal = false : VMs defined inline will be
global in scope if allowed.

[DEBUG] Velocimacro : autoload off : VM system will not automatically reload
global library macros

[DEBUG] Velocimacro : Velocimacro : initialization complete.

[DEBUG] RuntimeInstance successfully initialized.

[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-archetype-plugin:2.2:generate' with basic
configurator 

Help with java.net.SocketException: Connection reset by peer: socket write error

2015-06-25 Thread Bruce Lombardi
Wehave deployed a Wicket  application that runs fine, but every once in a
while I see a stacktrace in my Tomcat logs that says

ERROR - DefaultExceptionMapper:mapExpectedExceptions.144 - Connection
lost, give up responding.

Which appears to be caused by:

java.net.SocketException: Connection reset by peer: socket write error

 

This often occurs when no users are logged into the application. I've
searched for an answer to this, but haven't been able to find anything
useful. A lot of information about this error if you are trying to do a file
transfer, but nothing related to my current situation.

 

I'd appreciate it if anyone could suggest a way of tracking this down. The
stacktrace isn't too helpful and none of the classes listed in it are
classes that we developed, they are all framework classes (Tomcat, Wicket.
Spring,etc.)  I've included the whole stacktrace below.

Could this be someone attempting to hack in, or something that happens when
a browser is closed?

 

Bruce

 

2015-06-24 11:23:34,922  ERROR - DefaultExceptionMapper
:mapExpectedExceptions.144 - Connection lost, give up responding. 

org.apache.wicket.protocol.http.servlet.ResponseIOException:
ClientAbortException:  java.net.SocketException: Connection reset by peer:
socket write error

at
org.apache.wicket.protocol.http.servlet.ServletWebResponse.write(ServletWebR
esponse.java:126)

at
org.apache.wicket.protocol.http.HeaderBufferingWebResponse.write(HeaderBuffe
ringWebResponse.java:182)

at
org.apache.wicket.request.resource.PackageResource$1.writeData(PackageResour
ce.java:328)

at
org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource
.java:528)

at
org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(Re
sourceRequestHandler.java:75)

at
org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler.r
espond(ResourceReferenceRequestHandler.java:108)

at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(Request
Cycle.java:890)

at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.ja
va:64)

at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)

at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.jav
a:218)

at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(Request
Cycle.java:289)

at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilte
r.java:259)

at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.jav
a:201)

at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)

at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:241)

at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:208)

at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilte
r(FilterChainProxy.java:330)

at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.
invoke(FilterSecurityInterceptor.java:118)

at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.
doFilter(FilterSecurityInterceptor.java:84)

at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilte
r(FilterChainProxy.java:342)

at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(
ExceptionTranslationFilter.java:113)

at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilte
r(FilterChainProxy.java:342)

at
org.springframework.security.web.session.SessionManagementFilter.doFilter(Se
ssionManagementFilter.java:103)

at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilte
r(FilterChainProxy.java:342)

at
org.springframework.security.web.authentication.AnonymousAuthenticationFilte
r.doFilter(AnonymousAuthenticationFilter.java:113)

at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilte
r(FilterChainProxy.java:342)

at
org.springframework.security.web.servletapi.SecurityContextHolderAwareReques
tFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilte
r(FilterChainProxy.java:342)

at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilt
er(RequestCacheAwareFilter.java:45)

at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilte
r(FilterChainProxy.java:342)

at

Re: PDF viewed in panel via ResourceReference works in 6.12 but not in 6.13

2015-03-15 Thread Bruce Lombardi
For the moment, this issue has put me behind schedule so I need to move on, but 
I will try to get back to it and open an issue later.
Thanks again.

Bruce

Sent from my iPad

 On Mar 15, 2015, at 3:59 PM, Andrea Del Bene an.delb...@gmail.com wrote:
 
 Good! It would be nice to understand what caused this change from 6.12.0 to 
 6.13.0 but this requires a quickstart to reproduce the specific problem. If 
 you have the time and the chance to create such quickstart you can open an 
 issue on JIRA.
 Thanks Andrea,
 
 Your small observation was important. After moving the code into the 
 onInitialize method everything started working. The url produced is 
 ./resource/org.apache.wicket.Application/pdfProducer and not  . 
 ./resource/org.apache.wicket.Application/pdfProducer.
 
 I also test the wicket-bootstrap theory, but that does not seem to be 
 involved.
 
 I will use this fix.  Since this works should I still open a JIRA issue?
 
 Thanks again,
 
 Bruce
 
 -Original Message-
 From: Andrea Del Bene [mailto:an.delb...@gmail.com]
 Sent: Sunday, March 15, 2015 10:00 AM
 To: users@wicket.apache.org
 Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 but not 
 in 6.13
 
 Just a small observation that might help. Move code from PdfViewer 
 contructor to onInitialize. This makes URL generation safer although it 
 doesn't explain why your code worked until 6.12.0.
 I guess it depends on the mount path of your page.
 Most probably it is /wicket/bookmarkable/...
 On Mar 14, 2015 7:37 PM, Bruce Lombardi brlom...@gmail.com wrote:
 
 Interesting,
 
 When I run your code I see that the url is as you say:
 
 ./wicket/resource/org.apache.wicket.Application/pdfProducer
 
 Whereas in my working code (wicket version 6.12) it is:
 
 ./resource/org.apache.wicket.Application/pdfProducer
 
 And  in my non-working code (wicket versions 6.13 - 6.19) it is:
 
 ../resource/org.apache.wicket.Application/pdfProducer
 
 If I remove the first dot from the url with the debuggerthen run from
 there the pdf appears as it should.
 
 I wonder why they are different in the two projects and why I'm getting ..
 with later versions.
 
 I'm also wondering if there is another library that is somehow
 incompatible with later versions of Wicket.
 
 I think the only library we use that interacts with Wicket is wicket
 bootstrap  - currently as below (but I've tried other version):
  dependency
  groupIdde.agilecoders.wicket/groupId
  artifactIdwicket-bootstrap-core/artifactId
  version0.9.8/version
  /dependency
 
  dependency
  groupIdde.agilecoders.wicket/groupId
 
 artifactIdwicket-bootstrap-extensions/artifactId
  version0.9.8/version
  /dependency
 
 I will add these dependencies to your quickstart and see if it makes
 a difference.
 
 Bruce
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 

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



RE: PDF viewed in panel via ResourceReference works in 6.12 but not in 6.13

2015-03-14 Thread Bruce Lombardi
Interesting,

When I run your code I see that the url is as you say:

./wicket/resource/org.apache.wicket.Application/pdfProducer

Whereas in my working code (wicket version 6.12) it is:

./resource/org.apache.wicket.Application/pdfProducer 

And  in my non-working code (wicket versions 6.13 - 6.19) it is:

../resource/org.apache.wicket.Application/pdfProducer

If I remove the first dot from the url with the debuggerthen run from there the 
pdf appears as it should.

I wonder why they are different in the two projects and why I'm getting .. with 
later versions.

I'm also wondering if there is another library that is somehow incompatible 
with later versions of Wicket.

I think the only library we use that interacts with Wicket is wicket bootstrap  
- currently as below (but I've tried other version):
dependency
groupIdde.agilecoders.wicket/groupId
artifactIdwicket-bootstrap-core/artifactId
version0.9.8/version
/dependency

dependency
groupIdde.agilecoders.wicket/groupId
artifactIdwicket-bootstrap-extensions/artifactId
version0.9.8/version
/dependency

I will add these dependencies to your quickstart and see if it makes a 
difference.

Bruce

-Original Message-
From: Andrea Del Bene [mailto:an.delb...@gmail.com] 
Sent: Saturday, March 14, 2015 11:58 AM
To: users@wicket.apache.org
Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 but not in 
6.13

Hi,

I've created a quickstart based on your code  but I can't reproduce the issue. 
I've shared it on Dropbox: 
https://www.dropbox.com/s/qmolvzvp9a0xplf/ResourceIssue.tar.gz?dl=0
The only thing I've noted is that your resource url doesn't have starting 
segment 'wicket', i.e my resource url is:

./wicket/resource/org.apache.wicket.Application/pdfProducer

Maybe you have some custom setting for wicket segments ('wicket', 'bookmark', 
etc...)?
 The problem (which I think is a bug) is in the way the url is produced.

 The line
   String url = (String)RequestCycle.get().urlFor(resourceReference, 
 null);

 Produces the url to use for the resource ref.

 In the non-working version it returns:

 ../resource/org.apache.wicket.Application/pdfProducer

 If I set a breakpoint just after this line and I manually remove the first 
 dot in the string  using the debugger to get:

 ./resource/org.apache.wicket.Application/pdfProducer

 and then let the code continue to run, my pdf appears correctly.

 The debug trace also shows the correct uri.

 2015-03-13 17:59:30,292  DEBUG - ServletWebRequest  - Calculating 
 context relative path from: context path '', filterPrefix '', uri 
 '/wicket/resource/org.apache.wicket.Application/pdfProducer'
 2015-03-13 17:59:30,298  DEBUG - ServletWebRequest  - Calculating 
 context relative path from: context path '', filterPrefix '', uri 
 '/wicket/resource/org.apache.wicket.Application/pdfProducer'
 2015-03-13 17:59:30,301  DEBUG - ServletWebRequest  - Calculating 
 context relative path from: context path '', filterPrefix '', uri 
 '/wicket/resource/org.apache.wicket.Application/pdfProducer'
 2015-03-13 17:59:30,305  DEBUG - CompoundRequestMapper  - One compatible 
 mapper found for URL 
 'wicket/resource/org.apache.wicket.Application/pdfProducer' - 'Mapper: 
 org.apache.wicket.core.request.mapper.ResourceReferenceMapper; Score: 1'

 Maybe someone knows how to fix this? I could strip the first dot as a 
 workaround in the mean time.

 Bruce



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



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



RE: PDF viewed in panel via ResourceReference works in 6.12 but not in 6.13

2015-03-14 Thread Bruce Lombardi
Thanks Andrea. I'll work with your quickstart and see what I can find.

Bruce

-Original Message-
From: Andrea Del Bene [mailto:an.delb...@gmail.com] 
Sent: Saturday, March 14, 2015 11:58 AM
To: users@wicket.apache.org
Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 but not in 
6.13

Hi,

I've created a quickstart based on your code  but I can't reproduce the issue. 
I've shared it on Dropbox: 
https://www.dropbox.com/s/qmolvzvp9a0xplf/ResourceIssue.tar.gz?dl=0
The only thing I've noted is that your resource url doesn't have starting 
segment 'wicket', i.e my resource url is:

./wicket/resource/org.apache.wicket.Application/pdfProducer

Maybe you have some custom setting for wicket segments ('wicket', 'bookmark', 
etc...)?
 The problem (which I think is a bug) is in the way the url is produced.

 The line
   String url = (String)RequestCycle.get().urlFor(resourceReference, 
 null);

 Produces the url to use for the resource ref.

 In the non-working version it returns:

 ../resource/org.apache.wicket.Application/pdfProducer

 If I set a breakpoint just after this line and I manually remove the first 
 dot in the string  using the debugger to get:

 ./resource/org.apache.wicket.Application/pdfProducer

 and then let the code continue to run, my pdf appears correctly.

 The debug trace also shows the correct uri.

 2015-03-13 17:59:30,292  DEBUG - ServletWebRequest  - Calculating 
 context relative path from: context path '', filterPrefix '', uri 
 '/wicket/resource/org.apache.wicket.Application/pdfProducer'
 2015-03-13 17:59:30,298  DEBUG - ServletWebRequest  - Calculating 
 context relative path from: context path '', filterPrefix '', uri 
 '/wicket/resource/org.apache.wicket.Application/pdfProducer'
 2015-03-13 17:59:30,301  DEBUG - ServletWebRequest  - Calculating 
 context relative path from: context path '', filterPrefix '', uri 
 '/wicket/resource/org.apache.wicket.Application/pdfProducer'
 2015-03-13 17:59:30,305  DEBUG - CompoundRequestMapper  - One compatible 
 mapper found for URL 
 'wicket/resource/org.apache.wicket.Application/pdfProducer' - 'Mapper: 
 org.apache.wicket.core.request.mapper.ResourceReferenceMapper; Score: 1'

 Maybe someone knows how to fix this? I could strip the first dot as a 
 workaround in the mean time.

 Bruce



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



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



RE: PDF viewed in panel via ResourceReference works in 6.12 but not in 6.13

2015-03-13 Thread Bruce Lombardi
Martin,

I'm looking into mounting the resource but there is something that I don't 
understand. 
Currently I am creating the resource in my panel and passing the pdf I want to 
display into the constructor of the resource. If I mount the resource, how do I 
provide it with the dynamically generated pdf? I don't even see a way of 
getting a hold of the resourceReference object created and mounted in the  
WebApplication init() method. Perhaps I need to also register it as an 
application-shared resource, then access it in my panel constructor and add the 
pdf there?

Bruce

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: Friday, March 13, 2015 12:53 PM
To: users@wicket.apache.org
Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 but not in 
6.13

Hi,

I think I see what happens.
The ResRef is created as a local variable to create the url and then discarded.
Wicket has something called ResourceReferenceRegistry. When a ResRef is used to 
create an url to it it is automatically registered in the registry.
It seems after 6.13 there is no such auto-registration for your ResRef for some 
reason.
You should have some WARNs in the logs.

I see nothing component specific in your ResRef so I'd #mountResource() it.
This way it will be always available.


Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Mar 13, 2015 at 6:40 PM, Bruce Lombardi brlom...@gmail.com wrote:

 I have a PdfViewer page that contains a panel that displays a 
 dynamically generated PDF using a resource reference. This works fine 
 in Wicket 6.12.0, but when I upgrade to 6.13.0 it stops working (just 
 changed Maven dependency
 - no code changes). No errors are displayed and the html is generated 
 exactly as it is with 6.12, but the pdf does not show up in the page.

 By setting a breakpoint in Eclipse I have determined that code in the 
 resource that produces the response (newResourceResponse) is never 
 called in 6.13. After migrating to the latest version (6.19) I still 
 get the problem.
 I've looked at the release notes for version 6.13 and see some changes 
 related to IResource but nothing that looks related to this problem.

 I'm hoping someone has seen something similar. Here is some of the 
 relevant
 code:

 PdfViewer .html - just has reference to panel

div wicket:id=pdfPanel/div



 PdfPane.html - just has object reference

 Raw HTML

object wicket:id=pdf data= border=1 width=80%
 height=80%/object



 Generated HTML - seen with view source in browser

 object data=./resource/org.apache.wicket.Application/pdfProducer

border=1 width=80% height=80%/object



 PdfPanel.java - has setup for resource reference

 public class PdfPanel extends Panel {



private static final long serialVersionUID = 1L;



public PdfPanel(String id) {

   super(id);



   ResourceReference resourceReference = new 
 ResourceReference(

pdfProducer) {

  private static final long serialVersionUID = 1L;



  @Override

  public IResource getResource() {

WebDocsSession session = 
 (WebDocsSession)getSession();



final byte[] pdf = session.getPdf();



if(pdf == null)

 System.out.println(PdfPanel session.getPdf returned null);



 PdfResourceProducer pdfResourceProducer =

 new PdfResourceProducer(pdf);



return pdfResourceProducer;

  }

   };



 String url = 
 (String)RequestCycle.get().urlFor(resourceReference,
 null);



 MarkupContainer wmc = new WebMarkupContainer(pdf);

 wmc.add(new AttributeModifier(data, url));

 add(wmc);

}



 PdfProducer.java - implements the Resource

 public class PdfResourceProducer extends 
 AbstractResource {



private static final long serialVersionUID = 
 -2245331056747467763L;

final byte[] pdfByteArray;





public PdfResourceProducer(byte[] pdfByteArray) {

   super();

   this.pdfByteArray = pdfByteArray;

   if(pdfByteArray == null) {

  System.out.println(PdfResourceProducer 
 constructor called with

 null byte array.);

   }

}



@Override

protected ResourceResponse newResourceResponse(Attributes
 attributes)
 {

   ResourceResponse resourceResponse = new 
 ResourceResponse();

   resourceResponse.setContentType(application/pdf);

   // resourceResponse.setTextEncoding(utf-8);



   
 resourceResponse.setContentLength((int)pdfByteArray.length);



   resourceResponse.disableCaching(); //do not allow 
 resource to be cached

RE: PDF viewed in panel via ResourceReference works in 6.12 but not in 6.13

2015-03-13 Thread Bruce Lombardi
Thanks Martin. 

I'm not getting any WARN messages in the logs. 
I'll take a look at mounting the resource.

Bruce

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: Friday, March 13, 2015 12:53 PM
To: users@wicket.apache.org
Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 but not in 
6.13

Hi,

I think I see what happens.
The ResRef is created as a local variable to create the url and then discarded.
Wicket has something called ResourceReferenceRegistry. When a ResRef is used to 
create an url to it it is automatically registered in the registry.
It seems after 6.13 there is no such auto-registration for your ResRef for some 
reason.
You should have some WARNs in the logs.

I see nothing component specific in your ResRef so I'd #mountResource() it.
This way it will be always available.


Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Mar 13, 2015 at 6:40 PM, Bruce Lombardi brlom...@gmail.com wrote:

 I have a PdfViewer page that contains a panel that displays a 
 dynamically generated PDF using a resource reference. This works fine 
 in Wicket 6.12.0, but when I upgrade to 6.13.0 it stops working (just 
 changed Maven dependency
 - no code changes). No errors are displayed and the html is generated 
 exactly as it is with 6.12, but the pdf does not show up in the page.

 By setting a breakpoint in Eclipse I have determined that code in the 
 resource that produces the response (newResourceResponse) is never 
 called in 6.13. After migrating to the latest version (6.19) I still 
 get the problem.
 I've looked at the release notes for version 6.13 and see some changes 
 related to IResource but nothing that looks related to this problem.

 I'm hoping someone has seen something similar. Here is some of the 
 relevant
 code:

 PdfViewer .html - just has reference to panel

div wicket:id=pdfPanel/div



 PdfPane.html - just has object reference

 Raw HTML

object wicket:id=pdf data= border=1 width=80%
 height=80%/object



 Generated HTML - seen with view source in browser

 object data=./resource/org.apache.wicket.Application/pdfProducer

border=1 width=80% height=80%/object



 PdfPanel.java - has setup for resource reference

 public class PdfPanel extends Panel {



private static final long serialVersionUID = 1L;



public PdfPanel(String id) {

   super(id);



   ResourceReference resourceReference = new 
 ResourceReference(

pdfProducer) {

  private static final long serialVersionUID = 1L;



  @Override

  public IResource getResource() {

WebDocsSession session = 
 (WebDocsSession)getSession();



final byte[] pdf = session.getPdf();



if(pdf == null)

 System.out.println(PdfPanel session.getPdf returned null);



 PdfResourceProducer pdfResourceProducer =

 new PdfResourceProducer(pdf);



return pdfResourceProducer;

  }

   };



 String url = 
 (String)RequestCycle.get().urlFor(resourceReference,
 null);



 MarkupContainer wmc = new WebMarkupContainer(pdf);

 wmc.add(new AttributeModifier(data, url));

 add(wmc);

}



 PdfProducer.java - implements the Resource

 public class PdfResourceProducer extends 
 AbstractResource {



private static final long serialVersionUID = 
 -2245331056747467763L;

final byte[] pdfByteArray;





public PdfResourceProducer(byte[] pdfByteArray) {

   super();

   this.pdfByteArray = pdfByteArray;

   if(pdfByteArray == null) {

  System.out.println(PdfResourceProducer 
 constructor called with

 null byte array.);

   }

}



@Override

protected ResourceResponse newResourceResponse(Attributes
 attributes)
 {

   ResourceResponse resourceResponse = new 
 ResourceResponse();

   resourceResponse.setContentType(application/pdf);

   // resourceResponse.setTextEncoding(utf-8);



   
 resourceResponse.setContentLength((int)pdfByteArray.length);



   resourceResponse.disableCaching(); //do not allow 
 resource to be cached.



   resourceResponse.setWriteCallback(new WriteCallback() {

  @Override

  public void writeData(Attributes attributes) 
 throws IOException {

try {

   OutputStream outputStream =
 attributes.getResponse()

 .getOutputStream();

   outputStream.write(pdfByteArray

RE: PDF viewed in panel via ResourceReference works in 6.12 but not in 6.13

2015-03-13 Thread Bruce Lombardi
Thanks Ernesto,

I don't know how to pass a byte[] as a parameter.

Bruce

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Friday, March 13, 2015 2:20 PM
To: users@wicket.apache.org
Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 but not in 
6.13

Pass the info as parameters on the request to the mounted resource?

On Fri, Mar 13, 2015 at 7:15 PM, Bruce Lombardi brlom...@gmail.com wrote:

 Martin,

 I'm looking into mounting the resource but there is something that I 
 don't understand.
 Currently I am creating the resource in my panel and passing the pdf I 
 want to display into the constructor of the resource. If I mount the 
 resource, how do I provide it with the dynamically generated pdf? I 
 don't even see a way of getting a hold of the resourceReference object 
 created and mounted in the  WebApplication init() method. Perhaps I 
 need to also register it as an application-shared resource, then 
 access it in my panel constructor and add the pdf there?

 Bruce

 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Friday, March 13, 2015 12:53 PM
 To: users@wicket.apache.org
 Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 
 but not in 6.13

 Hi,

 I think I see what happens.
 The ResRef is created as a local variable to create the url and then 
 discarded.
 Wicket has something called ResourceReferenceRegistry. When a ResRef 
 is used to create an url to it it is automatically registered in the registry.
 It seems after 6.13 there is no such auto-registration for your ResRef 
 for some reason.
 You should have some WARNs in the logs.

 I see nothing component specific in your ResRef so I'd #mountResource() it.
 This way it will be always available.


 Martin Grigorov
 Freelancer, available for hire!
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Fri, Mar 13, 2015 at 6:40 PM, Bruce Lombardi brlom...@gmail.com
 wrote:

  I have a PdfViewer page that contains a panel that displays a 
  dynamically generated PDF using a resource reference. This works 
  fine in Wicket 6.12.0, but when I upgrade to 6.13.0 it stops working 
  (just changed Maven dependency
  - no code changes). No errors are displayed and the html is 
  generated exactly as it is with 6.12, but the pdf does not show up in the 
  page.
 
  By setting a breakpoint in Eclipse I have determined that code in 
  the resource that produces the response (newResourceResponse) is 
  never called in 6.13. After migrating to the latest version (6.19) I 
  still get the problem.
  I've looked at the release notes for version 6.13 and see some 
  changes related to IResource but nothing that looks related to this problem.
 
  I'm hoping someone has seen something similar. Here is some of the 
  relevant
  code:
 
  PdfViewer .html - just has reference to panel
 
 div wicket:id=pdfPanel/div
 
 
 
  PdfPane.html - just has object reference
 
  Raw HTML
 
 object wicket:id=pdf data= border=1 width=80%
  height=80%/object
 
 
 
  Generated HTML - seen with view source in browser
 
  object
 data=./resource/org.apache.wicket.Application/pdfProducer
 
 border=1 width=80% height=80%/object
 
 
 
  PdfPanel.java - has setup for resource reference
 
  public class PdfPanel extends Panel {
 
 
 
 private static final long serialVersionUID = 1L;
 
 
 
 public PdfPanel(String id) {
 
super(id);
 
 
 
ResourceReference resourceReference = new 
  ResourceReference(
 
 pdfProducer) {
 
   private static final long serialVersionUID = 
  1L;
 
 
 
   @Override
 
   public IResource getResource() {
 
 WebDocsSession session = 
  (WebDocsSession)getSession();
 
 
 
 final byte[] pdf = session.getPdf();
 
 
 
 if(pdf == null)
 
  System.out.println(PdfPanel session.getPdf returned null);
 
 
 
  PdfResourceProducer pdfResourceProducer =
 
  new PdfResourceProducer(pdf);
 
 
 
 return pdfResourceProducer;
 
   }
 
};
 
 
 
  String url =
  (String)RequestCycle.get().urlFor(resourceReference,
  null);
 
 
 
  MarkupContainer wmc = new WebMarkupContainer(pdf);
 
  wmc.add(new AttributeModifier(data, url));
 
  add(wmc);
 
 }
 
 
 
  PdfProducer.java - implements the Resource
 
  public class PdfResourceProducer extends 
  AbstractResource {
 
 
 
 private static final long serialVersionUID = 
  -2245331056747467763L;
 
 final byte[] pdfByteArray;
 
 
 
 
 
 public PdfResourceProducer(byte[] pdfByteArray) {
 
super();
 
this.pdfByteArray = pdfByteArray;
 
if(pdfByteArray == null

RE: PDF viewed in panel via ResourceReference works in 6.12 but not in 6.13

2015-03-13 Thread Bruce Lombardi
The problem (which I think is a bug) is in the way the url is produced.

The line 
String url = (String)RequestCycle.get().urlFor(resourceReference, null);

Produces the url to use for the resource ref.

In the non-working version it returns:

../resource/org.apache.wicket.Application/pdfProducer

If I set a breakpoint just after this line and I manually remove the first dot 
in the string  using the debugger to get:

./resource/org.apache.wicket.Application/pdfProducer

and then let the code continue to run, my pdf appears correctly.

The debug trace also shows the correct uri.

2015-03-13 17:59:30,292  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/wicket/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 17:59:30,298  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/wicket/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 17:59:30,301  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/wicket/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 17:59:30,305  DEBUG - CompoundRequestMapper  - One compatible 
mapper found for URL 
'wicket/resource/org.apache.wicket.Application/pdfProducer' - 'Mapper: 
org.apache.wicket.core.request.mapper.ResourceReferenceMapper; Score: 1'

Maybe someone knows how to fix this? I could strip the first dot as a 
workaround in the mean time.

Bruce

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: Friday, March 13, 2015 4:17 PM
To: users@wicket.apache.org
Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 but not in 
6.13

Hi,

This is your code:

 WebDocsSession session = (WebDocsSession)getSession();  final byte[] pdf = 
session.getPdf();  if(pdf == null) System.out.println(PdfPanel session.getPdf 
returned null);  PdfResourceProducer pdfResourceProducer = new 
PdfResourceProducer(pdf);  return pdfResourceProducer;


There is nothing Component specific here. Except #getSession(), but you can use 
Session.get() and cast it. It is the same.

If you need the component to be able to generate the PDF bytes then you need to 
implement IResourceListener interface. In #onResourceRequested() you can 
generate the bytes and write them to the Response:
getResponse().write(byte[]).
The change you need to do is in #urlFor():
urlFor(ResourceListener.INTERFACE, parameters))


Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Mar 13, 2015 at 8:15 PM, Bruce Lombardi brlom...@gmail.com wrote:

 Martin,

 I'm looking into mounting the resource but there is something that I 
 don't understand.
 Currently I am creating the resource in my panel and passing the pdf I 
 want to display into the constructor of the resource. If I mount the 
 resource, how do I provide it with the dynamically generated pdf? I 
 don't even see a way of getting a hold of the resourceReference object 
 created and mounted in the  WebApplication init() method. Perhaps I 
 need to also register it as an application-shared resource, then 
 access it in my panel constructor and add the pdf there?

 Bruce

 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Friday, March 13, 2015 12:53 PM
 To: users@wicket.apache.org
 Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 
 but not in 6.13

 Hi,

 I think I see what happens.
 The ResRef is created as a local variable to create the url and then 
 discarded.
 Wicket has something called ResourceReferenceRegistry. When a ResRef 
 is used to create an url to it it is automatically registered in the registry.
 It seems after 6.13 there is no such auto-registration for your ResRef 
 for some reason.
 You should have some WARNs in the logs.

 I see nothing component specific in your ResRef so I'd #mountResource() it.
 This way it will be always available.


 Martin Grigorov
 Freelancer, available for hire!
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Fri, Mar 13, 2015 at 6:40 PM, Bruce Lombardi brlom...@gmail.com
 wrote:

  I have a PdfViewer page that contains a panel that displays a 
  dynamically generated PDF using a resource reference. This works 
  fine in Wicket 6.12.0, but when I upgrade to 6.13.0 it stops working 
  (just changed Maven dependency
  - no code changes). No errors are displayed and the html is 
  generated exactly as it is with 6.12, but the pdf does not show up in the 
  page.
 
  By setting a breakpoint in Eclipse I have determined that code in 
  the resource that produces the response (newResourceResponse) is 
  never called in 6.13. After migrating to the latest version (6.19) I 
  still get the problem.
  I've looked at the release notes for version 6.13 and see some 
  changes related to IResource

RE: PDF viewed in panel via ResourceReference works in 6.12 but not in 6.13

2015-03-13 Thread Bruce Lombardi
That's not really possible. The pdf is produced by itext from a template with 
lots of parameter. It would require too large a change in the code and would 
couple the pdfViewer panel too closely to the domain code.

If, as Martin suggests, the automatic registering of the resource is not being 
done in the ResourceReferenceRegistry maybe there is something I could do to 
register and then unregister the resource similar to the way it must have been 
done in 6.12..

Bruce


-Original Message-
From: reiern70 [mailto:reier...@gmail.com] 
Sent: Friday, March 13, 2015 3:40 PM
To: users@wicket.apache.org
Subject: RE: PDF viewed in panel via ResourceReference works in 6.12 but not in 
6.13

Passing something that allows you to produce the byte []?


Sent from Samsung Mobile

 Original message 
From: Bruce Lombardi brlom...@gmail.com
Date:13/03/2015  20:20  (GMT+01:00)
To: users@wicket.apache.org
Subject: RE: PDF viewed in panel via ResourceReference works in 6.12 but not in 
6.13 

Thanks Ernesto,

I don't know how to pass a byte[] as a parameter.

Bruce

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
Sent: Friday, March 13, 2015 2:20 PM
To: users@wicket.apache.org
Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 but not in 
6.13

Pass the info as parameters on the request to the mounted resource?

On Fri, Mar 13, 2015 at 7:15 PM, Bruce Lombardi brlom...@gmail.com wrote:

 Martin,

 I'm looking into mounting the resource but there is something that I 
 don't understand.
 Currently I am creating the resource in my panel and passing the pdf I 
 want to display into the constructor of the resource. If I mount the 
 resource, how do I provide it with the dynamically generated pdf? I 
 don't even see a way of getting a hold of the resourceReference object 
 created and mounted in the  WebApplication init() method. Perhaps I 
 need to also register it as an application-shared resource, then 
 access it in my panel constructor and add the pdf there?

 Bruce

 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Friday, March 13, 2015 12:53 PM
 To: users@wicket.apache.org
 Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 
 but not in 6.13

 Hi,

 I think I see what happens.
 The ResRef is created as a local variable to create the url and then 
 discarded.
 Wicket has something called ResourceReferenceRegistry. When a ResRef 
 is used to create an url to it it is automatically registered in the registry.
 It seems after 6.13 there is no such auto-registration for your ResRef 
 for some reason.
 You should have some WARNs in the logs.

 I see nothing component specific in your ResRef so I'd #mountResource() it.
 This way it will be always available.


 Martin Grigorov
 Freelancer, available for hire!
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Fri, Mar 13, 2015 at 6:40 PM, Bruce Lombardi brlom...@gmail.com
 wrote:

  I have a PdfViewer page that contains a panel that displays a 
  dynamically generated PDF using a resource reference. This works 
  fine in Wicket 6.12.0, but when I upgrade to 6.13.0 it stops working 
  (just changed Maven dependency
  - no code changes). No errors are displayed and the html is 
  generated exactly as it is with 6.12, but the pdf does not show up in the 
  page.
 
  By setting a breakpoint in Eclipse I have determined that code in 
  the resource that produces the response (newResourceResponse) is 
  never called in 6.13. After migrating to the latest version (6.19) I 
  still get the problem.
  I've looked at the release notes for version 6.13 and see some 
  changes related to IResource but nothing that looks related to this problem.
 
  I'm hoping someone has seen something similar. Here is some of the 
  relevant
  code:
 
  PdfViewer .html - just has reference to panel
 
 div wicket:id=pdfPanel/div
 
 
 
  PdfPane.html - just has object reference
 
  Raw HTML
 
 object wicket:id=pdf data= border=1 width=80%
  height=80%/object
 
 
 
  Generated HTML - seen with view source in browser
 
  object
 data=./resource/org.apache.wicket.Application/pdfProducer
 
 border=1 width=80% height=80%/object
 
 
 
  PdfPanel.java - has setup for resource reference
 
  public class PdfPanel extends Panel {
 
 
 
 private static final long serialVersionUID = 1L;
 
 
 
 public PdfPanel(String id) {
 
super(id);
 
 
 
ResourceReference resourceReference = new  
 ResourceReference(
 
 pdfProducer) {
 
   private static final long serialVersionUID =  
 1L;
 
 
 
   @Override
 
   public IResource getResource() {
 
 WebDocsSession session =  
 (WebDocsSession)getSession();
 
 
 
 final byte[] pdf = session.getPdf

RE: PDF viewed in panel via ResourceReference works in 6.12 but not in 6.13

2015-03-13 Thread Bruce Lombardi
Thanks Martin an others. I am always impressed with the helpfulness of the 
people on this list.

I will look into what you suggest. In the meantime I'm trying to find out more 
information about the differences between versions and  I set the logger level 
to DEBUG and  obtained the traces below from working and non-working versions. 
Maybe this will help shed some light on what is happening. I see some 
differences like uri for working version starts with /wicket/resource but 
non-working version starts with /resource/ but I don't know what the 
differences mean.  Maybe someone know about this change?

If the difference in the way resource reference registration works between 6.12 
and 6.13  is an unintended  change in behavior between versions, it seems like 
it should be fixed. If it is an intended change, then it should be documented.

Working Version 6.12 Debug trace
2015-03-13 16:12:35,585  DEBUG - CompoundRequestMapper  - One compatible 
mapper found for URL 
'wicket/resource/de.agilecoders.wicket.webjars.request.resource.WebjarsCssResourceReference/webjars/bootstrap/2.3.2/css/bootstrap-ver-1378733671227.css'
 - 'Mapper: org.apache.wicket.core.request.mapper.ResourceReferenceMapper; 
Score: 1'
2015-03-13 16:12:35,648  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/wicket/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 16:12:35,648  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/wicket/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 16:12:35,648  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/wicket/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 16:12:35,648  DEBUG - CompoundRequestMapper  - One compatible 
mapper found for URL 
'wicket/resource/org.apache.wicket.Application/pdfProducer' - 'Mapper: 
org.apache.wicket.core.request.mapper.ResourceReferenceMapper; Score: 1'

Non-Working Version 6.13 Debug trace
2015-03-13 16:01:47,826  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 16:01:47,826  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 16:01:47,826  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 16:01:47,826  DEBUG - CompoundRequestMapper  - No compatible 
mapper found for URL 'resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 16:01:47,826  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 16:01:47,826  DEBUG - ServletWebRequest  - Calculating 
context relative path from: context path '', filterPrefix '', uri 
'/resource/org.apache.wicket.Application/pdfProducer'
2015-03-13 16:01:47,826  DEBUG - RequestCycle   - No suitable 
handler found for URL resource/org.apache.wicket.Application/pdfProducer, 
falling back to container to process this request

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: Friday, March 13, 2015 4:17 PM
To: users@wicket.apache.org
Subject: Re: PDF viewed in panel via ResourceReference works in 6.12 but not in 
6.13

Hi,

This is your code:

 WebDocsSession session = (WebDocsSession)getSession();  final byte[] pdf = 
session.getPdf();  if(pdf == null) System.out.println(PdfPanel session.getPdf 
returned null);  PdfResourceProducer pdfResourceProducer = new 
PdfResourceProducer(pdf);  return pdfResourceProducer;


There is nothing Component specific here. Except #getSession(), but you can use 
Session.get() and cast it. It is the same.

If you need the component to be able to generate the PDF bytes then you need to 
implement IResourceListener interface. In #onResourceRequested() you can 
generate the bytes and write them to the Response:
getResponse().write(byte[]).
The change you need to do is in #urlFor():
urlFor(ResourceListener.INTERFACE, parameters))


Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Mar 13, 2015 at 8:15 PM, Bruce Lombardi brlom...@gmail.com wrote:

 Martin,

 I'm looking into mounting the resource but there is something that I 
 don't understand.
 Currently I am creating the resource in my panel and passing the pdf I 
 want to display into the constructor of the resource. If I mount the 
 resource, how do I provide it with the dynamically generated pdf? I 
 don't even see a way of getting a hold

PDF viewed in panel via ResourceReference works in 6.12 but not in 6.13

2015-03-13 Thread Bruce Lombardi
I have a PdfViewer page that contains a panel that displays a dynamically
generated PDF using a resource reference. This works fine in Wicket 6.12.0,
but when I upgrade to 6.13.0 it stops working (just changed Maven dependency
- no code changes). No errors are displayed and the html is generated
exactly as it is with 6.12, but the pdf does not show up in the page.

By setting a breakpoint in Eclipse I have determined that code in the
resource that produces the response (newResourceResponse) is never called in
6.13. After migrating to the latest version (6.19) I still get the problem.
I've looked at the release notes for version 6.13 and see some changes
related to IResource but nothing that looks related to this problem.

I'm hoping someone has seen something similar. Here is some of the relevant
code:

PdfViewer .html - just has reference to panel

   div wicket:id=pdfPanel/div

 

PdfPane.html - just has object reference

Raw HTML

   object wicket:id=pdf data= border=1 width=80%
height=80%/object

 

Generated HTML - seen with view source in browser

object data=./resource/org.apache.wicket.Application/pdfProducer 

   border=1 width=80% height=80%/object

 

PdfPanel.java - has setup for resource reference

public class PdfPanel extends Panel {

   

   private static final long serialVersionUID = 1L;

 

   public PdfPanel(String id) {

  super(id);

  

  ResourceReference resourceReference = new ResourceReference(

   pdfProducer) {

 private static final long serialVersionUID = 1L;

 

 @Override

 public IResource getResource() {

   WebDocsSession session =
(WebDocsSession)getSession();

 

   final byte[] pdf = session.getPdf();

   

   if(pdf == null)

System.out.println(PdfPanel session.getPdf returned null);

 

PdfResourceProducer pdfResourceProducer = 

new PdfResourceProducer(pdf);

 

   return pdfResourceProducer;

 }

  };



String url = (String)RequestCycle.get().urlFor(resourceReference,
null);

  

MarkupContainer wmc = new WebMarkupContainer(pdf);

wmc.add(new AttributeModifier(data, url));

add(wmc);

   }

 

PdfProducer.java - implements the Resource

public class PdfResourceProducer extends AbstractResource {

 

   private static final long serialVersionUID = -2245331056747467763L;

   final byte[] pdfByteArray;

 

 

   public PdfResourceProducer(byte[] pdfByteArray) {

  super();

  this.pdfByteArray = pdfByteArray;

  if(pdfByteArray == null) {

 System.out.println(PdfResourceProducer constructor
called with

null byte array.);

  }

   }

 

   @Override

   protected ResourceResponse newResourceResponse(Attributes attributes)
{

  ResourceResponse resourceResponse = new ResourceResponse();

  resourceResponse.setContentType(application/pdf);

  // resourceResponse.setTextEncoding(utf-8);

 

  resourceResponse.setContentLength((int)pdfByteArray.length);

  

  resourceResponse.disableCaching(); //do not allow resource to
be cached.

 

  resourceResponse.setWriteCallback(new WriteCallback() {

 @Override

 public void writeData(Attributes attributes) throws
IOException {

   try {

  OutputStream outputStream =
attributes.getResponse()

.getOutputStream();

  outputStream.write(pdfByteArray);

  outputStream.flush();

   } catch (IOException e) {

  throw new WicketRuntimeException(

Problems writing pdf to
response...);

   }

 }

  });

 

  return resourceResponse;

   }

 

Bruce

 



RE: Can I process a POST with simple non-Json parameters using wicket-restannotations

2014-08-06 Thread Bruce Lombardi
Thanks for pointing me in the right direction, I will look at the links you
sent.
I don't care if I get a post of a get, but it I know it will be a post with
an order confirmation.

- Bruce

-Original Message-
From: Paul Bors [mailto:p...@bors.ws] 
Sent: Wednesday, August 06, 2014 12:38 AM
To: users@wicket.apache.org
Subject: Re: Can I process a POST with simple non-Json parameters using
wicket-restannotations

I think you might be looking for the query parameters of the
http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/request
/Request.html class.

See Chapter 9 of the Wicket Guide:
http://wicket.apache.org/guide/guide/single.html#requestProcessing

You can get to the Request from any of the Components on your page. Thus you
can have a bookmarkable URL and in the constructor of that page you can grab
the request and extract the parameters from it.

Do you care if the request is POST or GET?
Wicket abstracts that out for you via the query parameters.

~ Thank you,
   Paul Bors

On Aug 5, 2014, at 5:07 PM, Bruce Lombardi brlom...@gmail.com wrote:

 Hi,
 
 
 
 I have successfully setup a restful service using Wicketstuff 
 wicket-restannotation that accepts Json parameters. But I need to 
 write something in Wicket that will accepts a post of an order 
 confirmation from another source that does not use Json. Is there a 
 simple way of doing that with wicket-restannotations? I only see how 
 to process Json. I know that Json standard for a restful service, so I 
 may have to do something else, like using @MountPath and pulling the
parameters out of the request.
 
 
 
 Bruce
 



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



Can I process a POST with simple non-Json parameters using wicket-restannotations

2014-08-05 Thread Bruce Lombardi
Hi,

 

I have successfully setup a restful service using Wicketstuff
wicket-restannotation that accepts Json parameters. But I need to write
something in Wicket that will accepts a post of an order confirmation from
another source that does not use Json. Is there a simple way of doing that
with wicket-restannotations? I only see how to process Json. I know that
Json standard for a restful service, so I may have to do something else,
like using @MountPath and pulling the parameters out of the request.

 

Bruce



Re: Wicketstuff restannotations example throws IllegalStateException: STREAMED with https

2014-08-02 Thread Bruce Lombardi
Thanks again!

Bruce

Sent from my iPad

 On Aug 2, 2014, at 6:26 AM, Andrea Del Bene an.delb...@gmail.com wrote:
 
 You can use method AbstractRestResource.setResponseStatusCode
 Thanks Andrea. I'm working this out.  Now I have one more question:
 
 How can I return an Http 401 Status Code of Unauthorized if the password is
 incorrect? I know I can return values, such as the PersonPojo in the
 example, and I can return error messages
 from the from a registered validator, but I think it is standard to return
 401 on authentication failure. Can I return a Status Code?
 
 Bruce
 
 -Original Message-
 From: Andrea Del Bene [mailto:an.delb...@gmail.com]
 Sent: Friday, August 01, 2014 12:26 PM
 To: users@wicket.apache.org
 Subject: Re: Wicketstuff restannotations example throws
 IllegalStateException: STREAMED with https
 
 I would pass them as request parameters...
 Andrea,
 
 I have the SSL working fine when I call it from a Java program using
 HttpsURLConnection. So it was something with curl.
 
 I wonder if you could suggest how I could pass a username and password
 along with the json string and authenticate the request.
 
 Thanks,
 
 Bruce
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 

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



RE: Wicketstuff restannotations example throws IllegalStateException: STREAMED with https

2014-08-01 Thread Bruce Lombardi
Thanks Andrea. I'm working this out.  Now I have one more question:

How can I return an Http 401 Status Code of Unauthorized if the password is
incorrect? I know I can return values, such as the PersonPojo in the
example, and I can return error messages 
from the from a registered validator, but I think it is standard to return
401 on authentication failure. Can I return a Status Code?

Bruce

-Original Message-
From: Andrea Del Bene [mailto:an.delb...@gmail.com] 
Sent: Friday, August 01, 2014 12:26 PM
To: users@wicket.apache.org
Subject: Re: Wicketstuff restannotations example throws
IllegalStateException: STREAMED with https

I would pass them as request parameters...
 Andrea,

 I have the SSL working fine when I call it from a Java program using 
 HttpsURLConnection. So it was something with curl.

 I wonder if you could suggest how I could pass a username and password 
 along with the json string and authenticate the request.

 Thanks,

 Bruce



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



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



Re: Wicketstuff restannotations example throws IllegalStateException: STREAMED with https

2014-07-31 Thread Bruce Lombardi
I just stated it by running Start.java as a java application  to start Jetty 
from Eclipse. 

Bruce

Sent from my iPad

 On Jul 31, 2014, at 6:09 AM, Andrea Del Bene an.delb...@gmail.com wrote:
 
 Hi,
 
 how did you started the example application?
 I want to use the wicketstuff-restannotations library to implement a restful
 web service. It seem very handy and I was able to get the example code
 working fine.
 
 To make sure I understood how everything was working and how to access from
 another server I used curl from the command line to send an HTTP request.
 
 It worked fine using http with jetty, but when I tried http://localhost:8443
 I get  IllegalStateException: STREAMED.
 
 See the details below:
 
  
 The following works using curl to post:
 
  
 C:\Software\Curlcurl
 
 -H Content-Type: application/json
 
 -d {name:Bruce,email:myacco...@gmail.com,password:piano}
 
 http://localhost:8080/personsmanager/createPerson
 
  
 It returns this:
 
  
 {name:Bruce,email:myacco...@gmail.com,password:piano}
 
  
 With the following HTTPS curl command I get IllegalStateException: STREAMED
 (note: the  -k/ --insecure switch tells curl not to validate the
 certificate since it is not in their list)
 
  
 C:\Software\Curlcurl
 
 -H -k/ --insecure Content-Type: application/json
 
 -d {name:Bruce,email:myacco...@gmail.com,password:piano}
 https://localhost:8443
 
 /personsmanager/persons
 
  
 Stacktrace shows:
 
  
 java.lang.IllegalStateException: STREAMED
 
 at
 org.eclipse.jetty.server.Request.getReader(Request.java:787)
 
 at
 org.wicketstuff.rest.utils.http.HttpUtils.readStringFromRequest(HttpUtils.ja
 va:46)
 
 at
 org.wicketstuff.rest.contenthandling.serialdeserial.TextualWebSerialDeserial
 .requestToObject(TextualWebSerialDeserial.java:83)
 
 at
 org.wicketstuff.rest.utils.reflection.MethodParameter.deserializeObjectFromR
 equest(MethodParameter.java:278)
 
 at
 org.wicketstuff.rest.utils.reflection.MethodParameter.extractParameterFromAn
 notation(MethodParameter.java:168)
 
 at
 org.wicketstuff.rest.utils.reflection.MethodParameter.extractParameterValue(
 MethodParameter.java:117)
 
  
 Does this mean that it the restful annotation will not work over https, or
 am I doing something wrong?
 
  
 Bruce
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 

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



Re: Wicketstuff restannotations example throws IllegalStateException: STREAMED with https

2014-07-31 Thread Bruce Lombardi
Thanks, I'll try it with another approach. I'll let you know.

Bruce

Sent from my iPad

 On Jul 31, 2014, at 8:05 AM, Andrea Del Bene an.delb...@gmail.com wrote:
 
 I started the example app with Maven and enabling the SSL port. I've tested 
 it with Firefox, although I had to disable the flag 
 security.mixed_content.block_active_content to load the JS libraries. I had 
 no problem with the REST operations (GET, POST, DELETE...), everything  
 worked fine usin SSL. Maybe the problem is with curl and SSL handling?
 I just stated it by running Start.java as a java application  to start Jetty 
 from Eclipse.
 
 Bruce
 
 Sent from my iPad
 
 On Jul 31, 2014, at 6:09 AM, Andrea Del Bene an.delb...@gmail.com wrote:
 
 Hi,
 
 how did you started the example application?
 I want to use the wicketstuff-restannotations library to implement a 
 restful
 web service. It seem very handy and I was able to get the example code
 working fine.
 
 To make sure I understood how everything was working and how to access from
 another server I used curl from the command line to send an HTTP request.
 
 It worked fine using http with jetty, but when I tried 
 http://localhost:8443
 I get  IllegalStateException: STREAMED.
 
 See the details below:
 
  The following works using curl to post:
 
  C:\Software\Curlcurl
 
 -H Content-Type: application/json
 
 -d {name:Bruce,email:myacco...@gmail.com,password:piano}
 
 http://localhost:8080/personsmanager/createPerson
 
  It returns this:
 
  {name:Bruce,email:myacco...@gmail.com,password:piano}
 
  With the following HTTPS curl command I get IllegalStateException: 
 STREAMED
 (note: the  -k/ --insecure switch tells curl not to validate the
 certificate since it is not in their list)
 
  C:\Software\Curlcurl
 
 -H -k/ --insecure Content-Type: application/json
 
 -d {name:Bruce,email:myacco...@gmail.com,password:piano}
 https://localhost:8443
 
 /personsmanager/persons
 
  Stacktrace shows:
 
  java.lang.IllegalStateException: STREAMED
 
 at
 org.eclipse.jetty.server.Request.getReader(Request.java:787)
 
 at
 org.wicketstuff.rest.utils.http.HttpUtils.readStringFromRequest(HttpUtils.ja
 va:46)
 
 at
 org.wicketstuff.rest.contenthandling.serialdeserial.TextualWebSerialDeserial
 .requestToObject(TextualWebSerialDeserial.java:83)
 
 at
 org.wicketstuff.rest.utils.reflection.MethodParameter.deserializeObjectFromR
 equest(MethodParameter.java:278)
 
 at
 org.wicketstuff.rest.utils.reflection.MethodParameter.extractParameterFromAn
 notation(MethodParameter.java:168)
 
 at
 org.wicketstuff.rest.utils.reflection.MethodParameter.extractParameterValue(
 MethodParameter.java:117)
 
  Does this mean that it the restful annotation will not work over https, or
 am I doing something wrong?
 
  Bruce
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 

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



RE: Wicketstuff restannotations example throws IllegalStateException: STREAMED with https

2014-07-31 Thread Bruce Lombardi
Andrea,

I have the SSL working fine when I call it from a Java program using
HttpsURLConnection. So it was something with curl.  

I wonder if you could suggest how I could pass a username and password along
with the json string and authenticate the request.

Thanks,

Bruce

-Original Message-
From: Andrea Del Bene [mailto:an.delb...@gmail.com] 
Sent: Thursday, July 31, 2014 8:06 AM
To: users@wicket.apache.org
Subject: Re: Wicketstuff restannotations example throws
IllegalStateException: STREAMED with https

I started the example app with Maven and enabling the SSL port. I've tested
it with Firefox, although I had to disable the flag
security.mixed_content.block_active_content to load the JS libraries. I had
no problem with the REST operations (GET, POST, DELETE...), everything
worked fine usin SSL. Maybe the problem is with curl and SSL handling?
 I just stated it by running Start.java as a java application  to start
Jetty from Eclipse.

 Bruce

 Sent from my iPad

 On Jul 31, 2014, at 6:09 AM, Andrea Del Bene an.delb...@gmail.com
wrote:

 Hi,

 how did you started the example application?
 I want to use the wicketstuff-restannotations library to implement a 
 restful web service. It seem very handy and I was able to get the 
 example code working fine.

 To make sure I understood how everything was working and how to 
 access from another server I used curl from the command line to send an
HTTP request.

 It worked fine using http with jetty, but when I tried 
 http://localhost:8443 I get  IllegalStateException: STREAMED.

 See the details below:

   
 The following works using curl to post:

   
 C:\Software\Curlcurl

 -H Content-Type: application/json

 -d {name:Bruce,email:myacco...@gmail.com,password:piano}

 http://localhost:8080/personsmanager/createPerson

   
 It returns this:

   
 {name:Bruce,email:myacco...@gmail.com,password:piano}

   
 With the following HTTPS curl command I get IllegalStateException: 
 STREAMED
 (note: the  -k/ --insecure switch tells curl not to validate the 
 certificate since it is not in their list)

   
 C:\Software\Curlcurl

 -H -k/ --insecure Content-Type: application/json

 -d {name:Bruce,email:myacco...@gmail.com,password:piano}
 https://localhost:8443

 /personsmanager/persons

   
 Stacktrace shows:

   
 java.lang.IllegalStateException: STREAMED

  at
 org.eclipse.jetty.server.Request.getReader(Request.java:787)

  at
 org.wicketstuff.rest.utils.http.HttpUtils.readStringFromRequest(Http
 Utils.ja
 va:46)

  at
 org.wicketstuff.rest.contenthandling.serialdeserial.TextualWebSerial
 Deserial
 .requestToObject(TextualWebSerialDeserial.java:83)

  at
 org.wicketstuff.rest.utils.reflection.MethodParameter.deserializeObj
 ectFromR
 equest(MethodParameter.java:278)

  at
 org.wicketstuff.rest.utils.reflection.MethodParameter.extractParamet
 erFromAn
 notation(MethodParameter.java:168)

  at
 org.wicketstuff.rest.utils.reflection.MethodParameter.extractParamet
 erValue(
 MethodParameter.java:117)

   
 Does this mean that it the restful annotation will not work over 
 https, or am I doing something wrong?

   
 Bruce

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

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



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



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



Wicketstuff restannotations example throws IllegalStateException: STREAMED with https

2014-07-30 Thread Bruce Lombardi
I want to use the wicketstuff-restannotations library to implement a restful
web service. It seem very handy and I was able to get the example code
working fine.

To make sure I understood how everything was working and how to access from
another server I used curl from the command line to send an HTTP request.

It worked fine using http with jetty, but when I tried http://localhost:8443
I get  IllegalStateException: STREAMED.

See the details below:

 

The following works using curl to post:

 

C:\Software\Curlcurl 

-H Content-Type: application/json 

-d {name:Bruce,email:myacco...@gmail.com,password:piano} 

http://localhost:8080/personsmanager/createPerson

 

It returns this:

 

{name:Bruce,email:myacco...@gmail.com,password:piano}

 

With the following HTTPS curl command I get IllegalStateException: STREAMED
(note: the  -k/ --insecure switch tells curl not to validate the
certificate since it is not in their list)

 

C:\Software\Curlcurl 

-H -k/ --insecure Content-Type: application/json 

-d {name:Bruce,email:myacco...@gmail.com,password:piano}
https://localhost:8443

/personsmanager/persons

 

Stacktrace shows:

 

java.lang.IllegalStateException: STREAMED

at
org.eclipse.jetty.server.Request.getReader(Request.java:787)

at
org.wicketstuff.rest.utils.http.HttpUtils.readStringFromRequest(HttpUtils.ja
va:46)

at
org.wicketstuff.rest.contenthandling.serialdeserial.TextualWebSerialDeserial
.requestToObject(TextualWebSerialDeserial.java:83)

at
org.wicketstuff.rest.utils.reflection.MethodParameter.deserializeObjectFromR
equest(MethodParameter.java:278)

at
org.wicketstuff.rest.utils.reflection.MethodParameter.extractParameterFromAn
notation(MethodParameter.java:168)

at
org.wicketstuff.rest.utils.reflection.MethodParameter.extractParameterValue(
MethodParameter.java:117)

 

Does this mean that it the restful annotation will not work over https, or
am I doing something wrong?

 

Bruce



RE: Ajax timer not counting when tab doesn't have focus?

2014-05-27 Thread Bruce Lombardi
For anyone interested, and particularly for Ernesto, I have successfully 
created  a version of the InactivityTimeOutPanel that works even if the user 
changes to another browser tab. The key, which I became aware of from the 
jsfiddle links (see previous posts below is to use an absolute time for when a 
period of inactivity would result in a timeout (timeoutTime,set to now plus an 
interval,, say 5 minutes), and then when the timer fires, to compare the 
current time against the timeoutTime. This seems to avoid the problem of the 
timer slowing down when the user changes to another page. Reset just resets the 
timeoutTime to a now plus the interval. I have set the timer to go off in one 
quarter of the interval, thinking if there are some delays this will keep it 
closer to the mark.

I have tested this and it seems to work fine. 

I only had to change the JavaScript in Ernesto's example to get everything  to 
work, and I have posted the code here:  http://pastebin.com/TWwS5hhE
for people to see.

Ernesto, It would be great if you could put this code into the JavaScript in 
your example and try it out. Then we would have a complete example to point 
people to if it works OK.

Regards,

Bruce


-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Friday, May 16, 2014 2:42 PM
To: users@wicket.apache.org
Subject: Re: Ajax timer not counting when tab doesn't have focus?

Bruce.

Let me see if I can find some time during weekend to play a bit with the links 
your provided and come up with a more robust solution.


On Fri, May 16, 2014 at 3:57 PM, Bruce Lombardi brlom...@gmail.com wrote:

 First, thank you  for your continuing interest. This is the best 
 support group experience  I've ever had. I hope the message come in 
 the right sequence. Lke Ernesto and other A saw the sequencing problem 
 cause by the apache server problem.

 I ran the test that Martin suggestion with  6.16.0-SNAPSHOTand got the 
 same behavior, which is what Ernesto and I suspected would happen.

 I'm sorry, but I don't know a lot about JavaScript so I'm having with 
 certain things.  I read this article in stackoverflow:


 https://stackoverflow.com/questions/6032429/chrome-timeouts-interval-s
 uspended-in-background-tabs

 Which lead to this:


 http://stackoverflow.com/questions/5927284/how-can-i-make-setinterval-
 also-work-when-a-tab-is-inactive-in-chrome


 Which contained an example of a script that doesn’t work correctly (if 
 you go to it, you will see that  it walks the word test  across the screen.
 If you go to another  tab and come back test hasn’t moved)

 http://jsfiddle.net/7f6DX/3/


 and this example that works (does the same thing but you can see that 
 test  moves even when you go to another  tab - but don't go away too 
 long it will reach the end and disappear).

 http://jsfiddle.net/7f6DX/31/

 Do you think the last (working) script  could be adapted  for our timeout?

 Regards,
 Bruce



 -Original Message-
 From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
 Sent: Tuesday, May 13, 2014 1:59 AM
 To: users@wicket.apache.org
 Subject: Re: Ajax timer not counting when tab doesn't have focus?

 Martin,

 Thanks for pointing out this. The exact JavaScript enabling this 
 feature can be found here


 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-p
 arent/client-sign-out/src/main/java/com/antilia/signout/InactivitySign
 OutPanel.js

 Maybe there is a memory leak in here as well... but I do not see the 
 relation with WICKET-5570 as I do not use any of the AJAX timer 
 behavior, see


 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-p
 arent/client-sign-out/src/main/java/com/antilia/signout/InactivitySign
 OutPanel.java

 As Bruce describes the problem it sounds like if by switching to other 
 tab browser give less priority to the execution of JavaScript in 
 inactive tabs.



 On Mon, May 12, 2014 at 9:28 PM, Martin Grigorov mgrigo...@apache.org
 wrote:

  It could be that https://issues.apache.org/jira/browse/WICKET-5570 
  is the issue.
  Please try with 6.16.0-SNAPSHOT if you can.
 
  Martin Grigorov
  Wicket Training and Consulting
 
 
  On Mon, May 12, 2014 at 8:02 PM, Bruce Lombardi brlom...@gmail.com
  wrote:
 
   Thanks Ernesto.
  
   Yes, I do mean another browser tab. I have some new information. 
   The
  timer
   seems to slow way down, but not stop counting down when the user 
   switches focus to another tab, either opening a new tab, or just 
   clicking on
  another
   tab. This is happening in both Chrome and Firefox.
  
   I thought that my code was never timing out, but further 
   experimentation with a shorter timeout period shows that it is 
   doing the same thing as
  the
   demo. That is, timing out in about 10 second when you stay on the 
   tab,
  but
   taking 3 minutes or longer to timeout when if you change focus to 
   a different tab.
  
   I would appreciate it if you could look

Re: How can I display modal dialog only if validation is sucessful?

2014-05-23 Thread Bruce Lombardi
Thanks Francois, 

I've been busy on another task. I'll look at the code soon.

Bruce

Sent from my iPad

 On May 22, 2014, at 5:48 AM, Francois Meillet francois.meil...@gmail.com 
 wrote:
 
 Hi Bruce,
 
 This is just one solution :
 Have a look at http://pastebin.com/03DF5pcw
 
 
 François Meillet
 Formation Wicket - Développement Wicket
 
 
 
 
 
 Le 21 mai 2014 à 16:15, Bruce Lombardi brlom...@gmail.com a écrit :
 
 Hi,
 
 
 
 I have a form with several question that a user must answer. If the answers
 are correct, an email is sent to the user and the user is returned to the
 login page. That's a bit abrupt for the user and I  would like to provide a
 simple modal dialog that confirms that the email is sent before sending them
 to the home page. However, if the answers to the questions are not correct,
 then a feedback panel must be displayed.
 
 
 
 I've looked at the approaches to providing a confirmation panel in this link
 https://cwiki.apache.org/confluence/display/WICKET/Getting+user+confirmation
 and other places, but I am having a problem with the approach. The
 JavaScript seems to run as soon as the button is clicked - before onSubmit
 or onValidate runs on the server. So I can't stop the pop-up from showing
 if the questions were not answered correctly.
 
 
 
 Does anyone know a way I can display the modal dialog only after validation
 has run?
 
 
 
 Thanks,
 
 
 
 Bruce
 

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



How can I display modal dialog only if validation is sucessful?

2014-05-21 Thread Bruce Lombardi
Hi,

 

I have a form with several question that a user must answer. If the answers
are correct, an email is sent to the user and the user is returned to the
login page. That's a bit abrupt for the user and I  would like to provide a
simple modal dialog that confirms that the email is sent before sending them
to the home page. However, if the answers to the questions are not correct,
then a feedback panel must be displayed.

 

I've looked at the approaches to providing a confirmation panel in this link
https://cwiki.apache.org/confluence/display/WICKET/Getting+user+confirmation
and other places, but I am having a problem with the approach. The
JavaScript seems to run as soon as the button is clicked - before onSubmit
or onValidate runs on the server. So I can't stop the pop-up from showing
if the questions were not answered correctly.

 

Does anyone know a way I can display the modal dialog only after validation
has run?

 

Thanks,

 

Bruce

 



RE: Ajax timer not counting when tab doesn't have focus?

2014-05-16 Thread Bruce Lombardi
Thanks Ernesto  that would be great!

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Friday, May 16, 2014 2:42 PM
To: users@wicket.apache.org
Subject: Re: Ajax timer not counting when tab doesn't have focus?

Bruce.

Let me see if I can find some time during weekend to play a bit with the links 
your provided and come up with a more robust solution.


On Fri, May 16, 2014 at 3:57 PM, Bruce Lombardi brlom...@gmail.com wrote:

 First, thank you  for your continuing interest. This is the best 
 support group experience  I've ever had. I hope the message come in 
 the right sequence. Lke Ernesto and other A saw the sequencing problem 
 cause by the apache server problem.

 I ran the test that Martin suggestion with  6.16.0-SNAPSHOTand got the 
 same behavior, which is what Ernesto and I suspected would happen.

 I'm sorry, but I don't know a lot about JavaScript so I'm having with 
 certain things.  I read this article in stackoverflow:


 https://stackoverflow.com/questions/6032429/chrome-timeouts-interval-s
 uspended-in-background-tabs

 Which lead to this:


 http://stackoverflow.com/questions/5927284/how-can-i-make-setinterval-
 also-work-when-a-tab-is-inactive-in-chrome


 Which contained an example of a script that doesn’t work correctly (if 
 you go to it, you will see that  it walks the word test  across the screen.
 If you go to another  tab and come back test hasn’t moved)

 http://jsfiddle.net/7f6DX/3/


 and this example that works (does the same thing but you can see that 
 test  moves even when you go to another  tab - but don't go away too 
 long it will reach the end and disappear).

 http://jsfiddle.net/7f6DX/31/

 Do you think the last (working) script  could be adapted  for our timeout?

 Regards,
 Bruce



 -Original Message-
 From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
 Sent: Tuesday, May 13, 2014 1:59 AM
 To: users@wicket.apache.org
 Subject: Re: Ajax timer not counting when tab doesn't have focus?

 Martin,

 Thanks for pointing out this. The exact JavaScript enabling this 
 feature can be found here


 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-p
 arent/client-sign-out/src/main/java/com/antilia/signout/InactivitySign
 OutPanel.js

 Maybe there is a memory leak in here as well... but I do not see the 
 relation with WICKET-5570 as I do not use any of the AJAX timer 
 behavior, see


 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-p
 arent/client-sign-out/src/main/java/com/antilia/signout/InactivitySign
 OutPanel.java

 As Bruce describes the problem it sounds like if by switching to other 
 tab browser give less priority to the execution of JavaScript in 
 inactive tabs.



 On Mon, May 12, 2014 at 9:28 PM, Martin Grigorov mgrigo...@apache.org
 wrote:

  It could be that https://issues.apache.org/jira/browse/WICKET-5570 
  is the issue.
  Please try with 6.16.0-SNAPSHOT if you can.
 
  Martin Grigorov
  Wicket Training and Consulting
 
 
  On Mon, May 12, 2014 at 8:02 PM, Bruce Lombardi brlom...@gmail.com
  wrote:
 
   Thanks Ernesto.
  
   Yes, I do mean another browser tab. I have some new information. 
   The
  timer
   seems to slow way down, but not stop counting down when the user 
   switches focus to another tab, either opening a new tab, or just 
   clicking on
  another
   tab. This is happening in both Chrome and Firefox.
  
   I thought that my code was never timing out, but further 
   experimentation with a shorter timeout period shows that it is 
   doing the same thing as
  the
   demo. That is, timing out in about 10 second when you stay on the 
   tab,
  but
   taking 3 minutes or longer to timeout when if you change focus to 
   a different tab.
  
   I would appreciate it if you could look at your demo and see the 
   behavior and then see if you have any ideas.
  
   As for my code, I really feel they difference with your code are 
   insignificant especially now that I know the behavior is the same.
  
   See below for the differences.
  
   Thanks again,
  
   Bruce
  
  
   Code.
  
   I have your InactivitySignOutPanel.java, 
   InactivitySignOutPanel.html and InactivitySignOutPanel.js from the 
   GitHub site with one slight
  modification
   in InactivitySignOutPanel.java (see below).
  
I setup my panel in  a base class that serves as a superclass for 
   all
  the
   Web pages in the application (extends WebPage)  I have a method 
   that is called to setup the timeout. Here is the method.
  
   public void setupTimeout() {
  
   // Change the following value to change the 
   session timeout.
   int numberOfMinutesUntilTimeout = 15;
  
   int secondsPerMinute = 60;
   int secondsToTimeout =numberOfMinutesUntilTimeout 
   * secondsPerMinute;
  
   add(new InactivitySignOutPanel(timeout,
   Duration.seconds(secondsToTimeout

RE: Ajax timer not counting when tab doesn't have focus?

2014-05-16 Thread Bruce Lombardi
First, thank you  for your continuing interest. This is the best support group 
experience  I've ever had. I hope the message come in the right sequence. Lke 
Ernesto and other A saw the sequencing problem cause by the apache server 
problem.

I ran the test that Martin suggestion with  6.16.0-SNAPSHOTand got the same 
behavior, which is what Ernesto and I suspected would happen.

I'm sorry, but I don't know a lot about JavaScript so I'm having with certain 
things.  I read this article in stackoverflow:

https://stackoverflow.com/questions/6032429/chrome-timeouts-interval-suspended-in-background-tabs

Which lead to this:

http://stackoverflow.com/questions/5927284/how-can-i-make-setinterval-also-work-when-a-tab-is-inactive-in-chrome


Which contained an example of a script that doesn’t work correctly (if you go 
to it, you will see that  it walks the word test  across the screen. If you 
go to another  tab and come back test hasn’t moved)

http://jsfiddle.net/7f6DX/3/


and this example that works (does the same thing but you can see that test  
moves even when you go to another  tab - but don't go away too long it will 
reach the end and disappear).

http://jsfiddle.net/7f6DX/31/

Do you think the last (working) script  could be adapted  for our timeout?

Regards,
Bruce



-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Tuesday, May 13, 2014 1:59 AM
To: users@wicket.apache.org
Subject: Re: Ajax timer not counting when tab doesn't have focus?

Martin,

Thanks for pointing out this. The exact JavaScript enabling this feature can be 
found here

https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-parent/client-sign-out/src/main/java/com/antilia/signout/InactivitySignOutPanel.js

Maybe there is a memory leak in here as well... but I do not see the relation 
with WICKET-5570 as I do not use any of the AJAX timer behavior, see

https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-parent/client-sign-out/src/main/java/com/antilia/signout/InactivitySignOutPanel.java

As Bruce describes the problem it sounds like if by switching to other tab 
browser give less priority to the execution of JavaScript in inactive tabs.



On Mon, May 12, 2014 at 9:28 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 It could be that https://issues.apache.org/jira/browse/WICKET-5570 is 
 the issue.
 Please try with 6.16.0-SNAPSHOT if you can.

 Martin Grigorov
 Wicket Training and Consulting


 On Mon, May 12, 2014 at 8:02 PM, Bruce Lombardi brlom...@gmail.com
 wrote:

  Thanks Ernesto.
 
  Yes, I do mean another browser tab. I have some new information. The
 timer
  seems to slow way down, but not stop counting down when the user 
  switches focus to another tab, either opening a new tab, or just 
  clicking on
 another
  tab. This is happening in both Chrome and Firefox.
 
  I thought that my code was never timing out, but further 
  experimentation with a shorter timeout period shows that it is doing 
  the same thing as
 the
  demo. That is, timing out in about 10 second when you stay on the 
  tab,
 but
  taking 3 minutes or longer to timeout when if you change focus to a 
  different tab.
 
  I would appreciate it if you could look at your demo and see the 
  behavior and then see if you have any ideas.
 
  As for my code, I really feel they difference with your code are 
  insignificant especially now that I know the behavior is the same.
 
  See below for the differences.
 
  Thanks again,
 
  Bruce
 
 
  Code.
 
  I have your InactivitySignOutPanel.java, InactivitySignOutPanel.html 
  and InactivitySignOutPanel.js from the GitHub site with one slight
 modification
  in InactivitySignOutPanel.java (see below).
 
   I setup my panel in  a base class that serves as a superclass for 
  all
 the
  Web pages in the application (extends WebPage)  I have a method that 
  is called to setup the timeout. Here is the method.
 
  public void setupTimeout() {
 
  // Change the following value to change the session 
  timeout.
  int numberOfMinutesUntilTimeout = 15;
 
  int secondsPerMinute = 60;
  int secondsToTimeout =numberOfMinutesUntilTimeout * 
  secondsPerMinute;
 
  add(new InactivitySignOutPanel(timeout,
  Duration.seconds(secondsToTimeout)) {
 
  private static final long serialVersionUID = 1L;
 
  protected String getOnTimeChangedFunction() {
  return 
  function(timeRemaining){if(!window.countDown) { window.countDown = 
  $('#countDown'); }  $(window.countDown).html(timeRemaining);};
  }
  });
 
  add( new AjaxLinkVoid(link) {
 
  private static final long serialVersionUID = 
  1L;
 
  @Override
  public void onClick(AjaxRequestTarget target) {
  // do nothing

Re: problem with message order delivered to wicket users list

2014-05-16 Thread Bruce Lombardi
Yes, I have been seeing the same thing. I also saw a reply that didn't include 
someone else's previous response.

Bruce

Sent from my iPad

 On May 14, 2014, at 12:21 AM, Ernesto Reinaldo Barreiro reier...@gmail.com 
 wrote:
 
 Hi,
 
 I the last couple of days I have been experiencing problems with the order
 of messages delivered to wicket users list: sometimes I receive an answer
 and then a few minutes after the original message. Is someone else
 experiencing this behavior?
 
 -- 
 Regards - Ernesto Reinaldo Barreiro

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



Ajax timer not counting when tab doesn't have focus?

2014-05-15 Thread Bruce Lombardi
This message  is related to an original thread Link to Wicket page from
Javascript but the focus is changed so much  that I though a new title
would be better.  In the earlier thread I asked about linking to a Wicket
page, but the real need was for help in implementing a session timeout that
would send the user to a timeout page after a period of inactivity and would
reset whenever a user clicked any button on the page. 

Ernesto Reinaldo Barreiro sent me links(see below) to a working demo that
did exactly what I required. I used  that code and everything seemed to work
perfectly. However, I have since discovered that my timer does not seem to
function correctly if the user goes to another tab. It seems like the timer
stops timing down or slows way down until the user comes back to the
original tab.

I checked Ernesto's demo. If I go to the demo  page and stay there it times
out after roughly the defined 10 second timeout period,  but if I go to the
demo page, then click on another tab, it eventually times out, but after
more than 3 minutes. My code, however,  never seems to seem to timeout  the
page if I go to another tab.

I really need this to work to  fulfill a requirement and it is preventing
the launch of our software.  It all works fine except if the user goes to a
different tab.

Ernesto, or anyone, do you know why this is happening. Is the ajax timer
stopping when the tab is not selected? Why is the demo eventually timing out
while application is not (can't see any real difference in the code)? Is
there any way to get a better handle on this (e.g., firebug)? If the ajax
timer is stopping, could something be done, perhaps using absolute elapsed
time, to expire the session immediately if the user goes back to the tab?
The latter is not ideal but might be acceptable.

 (Note: My session timeout in web.xml is 30 minutes, client timeout is 15
minutes, but for testing I set it to 10 seconds).


// Links

Demo of Example 

http://107.170.4.97:9080/client-sign-out-demo/?0


Code that sets up example 

https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-parent/
client-sign-out-demo/src/main/java/com/antilia/HomePage.java


Code that provides the implementation (We have this code in  package
com.xyzco.web.docs.presentation.helpers.timeout)


https://github.com/reiern70/antilia-bits/tree/master/client-sign-out-parent/
client-sign-out-demo/src/main/java/com/antilia

Thanks,
Bruce



-Original Message-
From: Bruce Lombardi [mailto:brlom...@gmail.com]
Sent: Monday, March 17, 2014 8:24 AM
To: users@wicket.apache.org
Subject: Re: Link to Wicket page from Javascript

Thanks, this is very helpful.

Bruce

Sent from my iPad

 On Mar 17, 2014, at 4:52 AM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
 
 You can see it at work here
 
 http://107.170.4.97:9080/client-sign-out-demo/
 
 
 On Mon, Mar 17, 2014 at 9:18 AM, Ernesto Reinaldo Barreiro  
 reier...@gmail.com wrote:
 
 Martin,
 
 What I mean is something that triggers the sign out before serve side 
 session expires... and trigger this expire event.
 
 
 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-
 parent/client-sign-out/src/main/java/com/antilia/signout/InactivitySi
 gnOutPanel.java
 
 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-
 parent/client-sign-out/src/main/java/com/antilia/signout/InactivitySi
 gnOutPanel.js
 
 The above seem to work. You use it as in
 
 
 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-
 parent/client-sign-out-demo/src/main/java/com/antilia/HomePage.java
 
 
 
 
 On Mon, Mar 17, 2014 at 9:11 AM, Martin Grigorov
mgrigo...@apache.orgwrote:
 
 Hi,
 
 On Fri, Mar 14, 2014 at 9:25 PM, Ernesto Reinaldo Barreiro  
 reier...@gmail.com wrote:
 
 Hi,
 
 I would implement this as..
 
 1- A JS function that counts how much time has passed since last 
 AJAX request. Once a certain threshold is passed an AJAX request is 
 sent to
 the
 page.
 2- An AbstractAjaxBehavior that is added to the page. I would use 
 it as context for AJAX request on 1).
 
 at that time the session should be already expired.
 
 But this can be used to do what is needed here - Wicket will 
 redirect to the configured PageExpiredErrorPage.
 
 
 3- On the respond of AJAXBehavior you redirect to 
 SessionTimeoutPage
 and
 invalidate the session.
 
 
 
 On Fri, Mar 14, 2014 at 8:07 PM, Bruce Lombardi 
 brlom...@gmail.com
 wrote:
 
 Hi,
 
 
 
 An earlier question I asked about session timeouts was answered by
 Martin
 Grigorov. I am implementing his suggestion and have a JQuery 
 script
 what
 sets a timer that times out after a certain period of inactivity. 
 The timeout triggers a function call.  Currently,  for a quick 
 test,  I
 have
 that function use location.href to go to an arbitrary static web 
 page
 like
 this:
 
 
 
 function whenUserIdle(){
 
location.href =
 'http://www.natural-environment.com';
 
 }
 
 
 
 That works fine, but now I need to make

RE: Ajax timer not counting when tab doesn't have focus?

2014-05-13 Thread Bruce Lombardi
Thanks Martin,

This is important to know about, and I will try with 6.16, but I don't think it 
is related, since it works find if focus isn't changed to a different tab. It 
may be more related to something mentioned by  Serban Balamaci in response to 
Ernesto's questions and the sample code. Serban provided a link to the 
following on stackoverflow: 

https://stackoverflow.com/questions/6032429/chrome-timeouts-interval-suspended-in-background-tabs

The stackoverflow information is about chrome only, but I am seeing this 
behavior in Firefox as well, so I'n not sure it is the whole story.

(By the way, I'm not sure why Serban's message and Ernesto's reply are not 
shown in this message. Maybe you mailed this earlier?)

Regards,

Bruce


-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: Monday, May 12, 2014 3:28 PM
To: users@wicket.apache.org
Subject: Re: Ajax timer not counting when tab doesn't have focus?

It could be that https://issues.apache.org/jira/browse/WICKET-5570 is the issue.
Please try with 6.16.0-SNAPSHOT if you can.

Martin Grigorov
Wicket Training and Consulting


On Mon, May 12, 2014 at 8:02 PM, Bruce Lombardi brlom...@gmail.com wrote:

 Thanks Ernesto.

 Yes, I do mean another browser tab. I have some new information. The 
 timer seems to slow way down, but not stop counting down when the user 
 switches focus to another tab, either opening a new tab, or just 
 clicking on another tab. This is happening in both Chrome and Firefox.

 I thought that my code was never timing out, but further 
 experimentation with a shorter timeout period shows that it is doing 
 the same thing as the demo. That is, timing out in about 10 second 
 when you stay on the tab, but taking 3 minutes or longer to timeout 
 when if you change focus to a different tab.

 I would appreciate it if you could look at your demo and see the 
 behavior and then see if you have any ideas.

 As for my code, I really feel they difference with your code are 
 insignificant especially now that I know the behavior is the same.

 See below for the differences.

 Thanks again,

 Bruce


 Code.

 I have your InactivitySignOutPanel.java, InactivitySignOutPanel.html 
 and InactivitySignOutPanel.js from the GitHub site with one slight 
 modification in InactivitySignOutPanel.java (see below).

  I setup my panel in  a base class that serves as a superclass for all 
 the Web pages in the application (extends WebPage)  I have a method 
 that is called to setup the timeout. Here is the method.

 public void setupTimeout() {

 // Change the following value to change the session 
 timeout.
 int numberOfMinutesUntilTimeout = 15;

 int secondsPerMinute = 60;
 int secondsToTimeout =numberOfMinutesUntilTimeout * 
 secondsPerMinute;

 add(new InactivitySignOutPanel(timeout,
 Duration.seconds(secondsToTimeout)) {

 private static final long serialVersionUID = 1L;

 protected String getOnTimeChangedFunction() {
 return function(timeRemaining){if(!window.countDown) 
 { window.countDown = $('#countDown'); }  
 $(window.countDown).html(timeRemaining);};
 }
 });

 add( new AjaxLinkVoid(link) {

 private static final long serialVersionUID = 
 1L;

 @Override
 public void onClick(AjaxRequestTarget target) {
 // do nothing
 }
 });
 }

 Here is the core code in InactivitySignOutPanel I have just modified 
 the respond method to call

  
 ((WebDocsSession)WebSession.get()).processLogoutorSessionExpiration();

 setResponsePage(WebApplication.get().getApplicationSettings().getPageE
 xpiredErrorPage());

 so that the application does the right thing. Note: a break point 
 shows that this method is never call when the user is on another tab.


   public InactivitySignOutPanel(String id, Duration duration) {
 this(id, Model.of(duration));
 }

 public InactivitySignOutPanel(String id, IModelDuration model) {
 super(id, model);
 setRenderBodyOnly(true);
 add(ajaxBehavior = new AbstractDefaultAjaxBehavior() {

 private static final long serialVersionUID = 
 1L;

 @Override
 protected void respond(AjaxRequestTarget target) {
 beforeSignOut(target);

 ((WebDocsSession)WebSession.get()).processLogoutOrSessionExpiration();

 setResponsePage(WebApplication.get().getApplicationSettings().getPageExpiredErrorPage());
 }

 @Override
 protected void onBind() {
 // panel will not be repainted, no need to markup 
 markup id.
 }

 @Override
 public void renderHead(Component component, 
 IHeaderResponse
 response) {
 super.renderHead(component, response

Ajax timer not counting when tab doesn't have focus?

2014-05-12 Thread Bruce Lombardi
This message  is related to an original thread Link to Wicket page from
Javascript but the focus is changed so much  that I though a new title
would be better.  In the earlier thread I asked about linking to a Wicket
page, but the real need was for help in implementing a session timeout that
would send the user to a timeout page after a period of inactivity and would
reset whenever a user clicked any button on the page. 

 

Ernesto Reinaldo Barreiro sent me links(see below) to a working demo that
did exactly what I required. I used  that code and everything seemed to work
perfectly. However, I have since discovered that my timer does not seem to
function correctly if the user goes to another tab. It seems like the timer
stops timing down or slows way down until the user comes back to the
original tab.

 

I checked Ernesto's demo. If I go to the demo  page and stay there it times
out after roughly the defined 10 second timeout period,  but if I go to the
demo page, then click on another tab, it eventually times out, but after
more than 3 minutes. My code, however,  never seems to seem to timeout the
page if I go to another tab.

 

I really need this to work to  fulfill a requirement and it is preventing
the launch of our software.  It all works fine except if the user goes to a
different tab.

 

Ernesto, or anyone, do you know why this is happening. Is the ajax timer
stopping when the tab is not selected? Why is the demo eventually timing out
while application is not (can't see any real difference in the code)?

Is there any way to get a better handle on this (e.g., firebug)? If the ajax
timer is stopping, could something be done, perhaps using absolute elapsed
time, to expire the session immediately if the user goes back to the tab?
The latter is not ideal but might be acceptable.

 

(Note: My session timeout in web.xml is 30 minutes, client timeout is 15
minutes, but for testing I set it to 10 seconds).

 

 

// Links

 

Demo of Example 

 

http://107.170.4.97:9080/client-sign-out-demo/?0

 

 

Code that sets up example 

 

https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-paren

t/client-sign-out-demo/src/main/java/com/antilia/HomePage.java

 

 

Code that provides the implementation (We have this code in  package

com.xyzco.web.docs.presentation.helpers.timeout)

 

 

https://github.com/reiern70/antilia-bits/tree/master/client-sign-out-paren

t/client-sign-out-demo/src/main/java/com/antilia

 

Thanks,

Bruce

 

 

 

-Original Message-

From: Bruce Lombardi [mailto:brlom...@gmail.com]

Sent: Monday, March 17, 2014 8:24 AM

To: users@wicket.apache.org

Subject: Re: Link to Wicket page from Javascript

 

Thanks, this is very helpful.

 

Bruce

 

Sent from my iPad

 

 On Mar 17, 2014, at 4:52 AM, Ernesto Reinaldo Barreiro

reier...@gmail.com wrote:

 

 You can see it at work here

 

 http://107.170.4.97:9080/client-sign-out-demo/

 

 

 On Mon, Mar 17, 2014 at 9:18 AM, Ernesto Reinaldo Barreiro  

 reier...@gmail.com wrote:

 

 Martin,

 

 What I mean is something that triggers the sign out before serve side 

 session expires... and trigger this expire event.

 

 

 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-

 parent/client-sign-out/src/main/java/com/antilia/signout/InactivitySi

 gnOutPanel.java

 

 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-

 parent/client-sign-out/src/main/java/com/antilia/signout/InactivitySi

 gnOutPanel.js

 

 The above seem to work. You use it as in

 

 

 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-

 parent/client-sign-out-demo/src/main/java/com/antilia/HomePage.java

 

 

 

 

 On Mon, Mar 17, 2014 at 9:11 AM, Martin Grigorov

 mailto:mgrigo...@apache.org mgrigo...@apache.orgwrote:

 

 Hi,

 

 On Fri, Mar 14, 2014 at 9:25 PM, Ernesto Reinaldo Barreiro  

 reier...@gmail.com wrote:

 

 Hi,

 

 I would implement this as..

 

 1- A JS function that counts how much time has passed since last 

 AJAX request. Once a certain threshold is passed an AJAX request is 

 sent to

 the

 page.

 2- An AbstractAjaxBehavior that is added to the page. I would use 

 it as context for AJAX request on 1).

 

 at that time the session should be already expired.

 

 But this can be used to do what is needed here - Wicket will 

 redirect to the configured PageExpiredErrorPage.

 

 

 3- On the respond of AJAXBehavior you redirect to 

 SessionTimeoutPage

 and

 invalidate the session.

 

 

 

 On Fri, Mar 14, 2014 at 8:07 PM, Bruce Lombardi 

 brlom...@gmail.com

 wrote:

 

 Hi,

 

 

 

 An earlier question I asked about session timeouts was answered by

 Martin

 Grigorov. I am implementing his suggestion and have a JQuery 

 script

 what

 sets a timer that times out after a certain period of inactivity. 

 The timeout triggers a function call.  Currently,  for a quick 

 test,  I

 have

 that function use location.href to go to an arbitrary

RE: Ajax timer not counting when tab doesn't have focus?

2014-05-12 Thread Bruce Lombardi
Thanks Ernesto. 

Yes, I do mean another browser tab. I have some new information. The timer 
seems to slow way down, but not stop counting down when the user switches focus 
to another tab, either opening a new tab, or just clicking on another tab. This 
is happening in both Chrome and Firefox.

I thought that my code was never timing out, but further experimentation with a 
shorter timeout period shows that it is doing the same thing as the demo. That 
is, timing out in about 10 second when you stay on the tab, but taking 3 
minutes or longer to timeout when if you change focus to a different tab.

I would appreciate it if you could look at your demo and see the behavior and 
then see if you have any ideas.

As for my code, I really feel they difference with your code are insignificant 
especially now that I know the behavior is the same.

See below for the differences.

Thanks again,

Bruce


Code.

I have your InactivitySignOutPanel.java, InactivitySignOutPanel.html and 
InactivitySignOutPanel.js from the GitHub site with one slight modification in 
InactivitySignOutPanel.java (see below).

 I setup my panel in  a base class that serves as a superclass for all the Web 
pages in the application (extends WebPage)  I have a method that is called to 
setup the timeout. Here is the method.

public void setupTimeout() {

// Change the following value to change the session timeout.
int numberOfMinutesUntilTimeout = 15;

int secondsPerMinute = 60;
int secondsToTimeout =numberOfMinutesUntilTimeout * 
secondsPerMinute;
   
add(new InactivitySignOutPanel(timeout, 
Duration.seconds(secondsToTimeout)) {

private static final long serialVersionUID = 1L;

protected String getOnTimeChangedFunction() {
return function(timeRemaining){if(!window.countDown) { 
window.countDown = $('#countDown'); }  
$(window.countDown).html(timeRemaining);};
}
});

add( new AjaxLinkVoid(link) {

private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
// do nothing
}
});
}

Here is the core code in InactivitySignOutPanel I have just modified the 
respond method to call
 ((WebDocsSession)WebSession.get()).processLogoutorSessionExpiration();

setResponsePage(WebApplication.get().getApplicationSettings().getPageExpiredErrorPage());

so that the application does the right thing. Note: a break point shows that 
this method is never call when the user is on another tab.
  

  public InactivitySignOutPanel(String id, Duration duration) {
this(id, Model.of(duration));
}

public InactivitySignOutPanel(String id, IModelDuration model) {
super(id, model);
setRenderBodyOnly(true);
add(ajaxBehavior = new AbstractDefaultAjaxBehavior() {

private static final long serialVersionUID = 1L;

@Override
protected void respond(AjaxRequestTarget target) {
beforeSignOut(target);

((WebDocsSession)WebSession.get()).processLogoutOrSessionExpiration();

setResponsePage(WebApplication.get().getApplicationSettings().getPageExpiredErrorPage());
}

@Override
protected void onBind() {
// panel will not be repainted, no need to markup markup id.
}

@Override
public void renderHead(Component component, IHeaderResponse 
response) {
super.renderHead(component, response);
response.render(JavaScriptHeaderItem.forReference(JS));
}
});
}

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Monday, May 12, 2014 11:39 AM
To: users@wicket.apache.org
Subject: Re: Ajax timer not counting when tab doesn't have focus?

Hi Bruce,


On Mon, May 12, 2014 at 4:52 PM, Bruce Lombardi brlom...@gmail.com wrote:

 This message  is related to an original thread Link to Wicket page 
 from Javascript but the focus is changed so much  that I though a new 
 title would be better.  In the earlier thread I asked about linking to 
 a Wicket page, but the real need was for help in implementing a 
 session timeout that would send the user to a timeout page after a 
 period of inactivity and would reset whenever a user clicked any 
 button on the page.



 Ernesto Reinaldo Barreiro sent me links(see below) to a working demo 
 that did exactly what I required. I used  that code and everything 
 seemed to work perfectly. However, I have since discovered that my 
 timer does not seem to function correctly if the user goes to another 
 tab. It seems like the timer stops timing down or slows way

Spring bean not injected into class extending WebApplication

2014-04-02 Thread Bruce Lombardi
I have an application that is integrated with Spring and a new requirement
is forcing me to update user login status for all users on  application
restart.

I want  to do this using  Springs JdbcOperations to do a simple execute of a
sql statement since Spring and Spring JPA are used throughout the
application.

The Application's init() method seems like a good place to do it since that
method runs whenever the application is started.

The problem I ran into is that my JdbcOperations instance is not injected
into the Application class instance so the init method throws a null pointer
exception.

I am able to inject JdbcOperations and lots of other things in my web pages,
but apparently, Spring has not yet been initialized when the Application's
init method is called. I suppose I could do something outside of Spring, but
that would make it inconsistent with the rest of the application.

Does anybody have any idea how to work around this? Is there any other place
later in the lifecycle of starting the application where I could do this?

 

Thanks,

Bruce



RE: Spring bean not injected into class extending WebApplication

2014-04-02 Thread Bruce Lombardi
Thanks Martin. 
I tried the first approach and it worked fine!
Bruce

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: Wednesday, April 02, 2014 12:56 PM
To: users@wicket.apache.org
Subject: Re: Spring bean not injected into class extending WebApplication

Hi,

One way is to use SpringWebApplicationFactory, i.e. init-param 
applicationFactoryClassName. See its javadoc. It will allow you to use 
@SpringBean/Inject in YourApplication.java.
Another way is something like:
https://github.com/nextreports/nextreports-server/blob/master/src/ro/nextreports/server/web/NextServerApplication.java#L224

Martin Grigorov
Wicket Training and Consulting


On Wed, Apr 2, 2014 at 6:43 PM, Bruce Lombardi brlom...@gmail.com wrote:

 I have an application that is integrated with Spring and a new 
 requirement is forcing me to update user login status for all users on  
 application restart.

 I want  to do this using  Springs JdbcOperations to do a simple 
 execute of a sql statement since Spring and Spring JPA are used 
 throughout the application.

 The Application's init() method seems like a good place to do it since 
 that method runs whenever the application is started.

 The problem I ran into is that my JdbcOperations instance is not 
 injected into the Application class instance so the init method throws 
 a null pointer exception.

 I am able to inject JdbcOperations and lots of other things in my web 
 pages, but apparently, Spring has not yet been initialized when the 
 Application's init method is called. I suppose I could do something 
 outside of Spring, but that would make it inconsistent with the rest 
 of the application.

 Does anybody have any idea how to work around this? Is there any other 
 place later in the lifecycle of starting the application where I could 
 do this?



 Thanks,

 Bruce




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



Re: Link to Wicket page from Javascript

2014-03-17 Thread Bruce Lombardi
Thanks, tis is very helpful.

Bruce

Sent from my iPad

 On Mar 17, 2014, at 4:52 AM, Ernesto Reinaldo Barreiro reier...@gmail.com 
 wrote:
 
 You can see it at work here
 
 http://107.170.4.97:9080/client-sign-out-demo/
 
 
 On Mon, Mar 17, 2014 at 9:18 AM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:
 
 Martin,
 
 What I mean is something that triggers the sign out before serve side
 session expires... and trigger this expire event.
 
 
 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-parent/client-sign-out/src/main/java/com/antilia/signout/InactivitySignOutPanel.java
 
 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-parent/client-sign-out/src/main/java/com/antilia/signout/InactivitySignOutPanel.js
 
 The above seem to work. You use it as in
 
 
 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-parent/client-sign-out-demo/src/main/java/com/antilia/HomePage.java
 
 
 
 
 On Mon, Mar 17, 2014 at 9:11 AM, Martin Grigorov mgrigo...@apache.orgwrote:
 
 Hi,
 
 On Fri, Mar 14, 2014 at 9:25 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:
 
 Hi,
 
 I would implement this as..
 
 1- A JS function that counts how much time has passed since last AJAX
 request. Once a certain threshold is passed an AJAX request is sent to
 the
 page.
 2- An AbstractAjaxBehavior that is added to the page. I would use it as
 context for AJAX request on 1).
 
 at that time the session should be already expired.
 
 But this can be used to do what is needed here - Wicket will redirect to
 the configured PageExpiredErrorPage.
 
 
 3- On the respond of AJAXBehavior you redirect to  SessionTimeoutPage
 and
 invalidate the session.
 
 
 
 On Fri, Mar 14, 2014 at 8:07 PM, Bruce Lombardi brlom...@gmail.com
 wrote:
 
 Hi,
 
 
 
 An earlier question I asked about session timeouts was answered by
 Martin
 Grigorov. I am implementing his suggestion and have a JQuery script
 what
 sets a timer that times out after a certain period of inactivity. The
 timeout triggers a function call.  Currently,  for a quick test,  I
 have
 that function use location.href to go to an arbitrary static web page
 like
 this:
 
 
 
 function whenUserIdle(){
 
location.href = 'http://www.natural-environment.com';
 
 }
 
 
 
 That works fine, but now I need to make it go to a Wicket page in my
 application, similar to what would happen if I had an anchor tag like:
 
 
 
 a wicket:id= SessionTimeoutPage href=#SessionTimeoutPage/a
 
 
 
 But I can't figure out how to do this in the javascript function. Can
 anyone
 tell me how to call the Wicket page from the javascript function?
 
 You can use script wicket:id=expirationUrl/script and a
 Label(expirationUrl, window.expirePageUrl =' +
 urlFor(SessionTimeoutPage.class) + ';);
 Then use it with: location.href = window.expirePageUrl';
 
 
 
 
 
 Thanks,
 
 
 
 Bruce
 
 
 --
 Regards - Ernesto Reinaldo Barreiro
 
 
 
 --
 Regards - Ernesto Reinaldo Barreiro
 
 
 
 -- 
 Regards - Ernesto Reinaldo Barreiro

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



Link to Wicket page from Javascript

2014-03-14 Thread Bruce Lombardi
Hi,

 

An earlier question I asked about session timeouts was answered by Martin
Grigorov. I am implementing his suggestion and have a JQuery script  what
sets a timer that times out after a certain period of inactivity. The
timeout triggers a function call.  Currently,  for a quick test,  I have
that function use location.href to go to an arbitrary static web page like
this:

 

function whenUserIdle(){

location.href = 'http://www.natural-environment.com';

}  

 

That works fine, but now I need to make it go to a Wicket page in my
application, similar to what would happen if I had an anchor tag like:

 

a wicket:id= SessionTimeoutPage href=#SessionTimeoutPage/a

 

But I can't figure out how to do this in the javascript function. Can anyone
tell me how to call the Wicket page from the javascript function?

 

Thanks,

 

Bruce



RE: Link to Wicket page from Javascript

2014-03-14 Thread Bruce Lombardi
Thanks Ernesto,  I was hoping for something simpler since what I have now
with a simple Jquery timer does everything I need except go the the
SessionTimeoutPage, where I would, as you suggest, invalidate the session.
I'm sure your solution would work, but I'm not familiar enough with
AbstractAjaxBehavior to implement it easily and the examples I've seen look
complicated.

Bruce

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Friday, March 14, 2014 3:26 PM
To: users@wicket.apache.org
Subject: Re: Link to Wicket page from Javascript

Hi,

I would implement this as..

1- A JS function that counts how much time has passed since last AJAX
request. Once a certain threshold is passed an AJAX request is sent to the
page.
2- An AbstractAjaxBehavior that is added to the page. I would use it as
context for AJAX request on 1).
3- On the respond of AJAXBehavior you redirect to  SessionTimeoutPage and
invalidate the session.



On Fri, Mar 14, 2014 at 8:07 PM, Bruce Lombardi brlom...@gmail.com wrote:

 Hi,



 An earlier question I asked about session timeouts was answered by 
 Martin Grigorov. I am implementing his suggestion and have a JQuery 
 script  what sets a timer that times out after a certain period of 
 inactivity. The timeout triggers a function call.  Currently,  for a 
 quick test,  I have that function use location.href to go to an 
 arbitrary static web page like
 this:



 function whenUserIdle(){

 location.href = 'http://www.natural-environment.com';

 }



 That works fine, but now I need to make it go to a Wicket page in my 
 application, similar to what would happen if I had an anchor tag like:



 a wicket:id= SessionTimeoutPage href=#SessionTimeoutPage/a



 But I can't figure out how to do this in the javascript function. Can 
 anyone tell me how to call the Wicket page from the javascript 
 function?



 Thanks,



 Bruce




--
Regards - Ernesto Reinaldo Barreiro


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



How di I display a new page on session timeout without requiring the user to do anything?

2014-03-12 Thread Bruce Lombardi
Hi,

 

I have a requirement that says that, for security purposes, when a session
times out, the application must go to a different page so that any data
displayed is hidden and that the user must  be informed that the session has
timed out.  In the init method of my Application class, which subclasses
AuthenticatedApplication, I  have the following line.

 

getApplicationSettings().setPageExpiredErrorPage(SessionTimeoutPage.class);

 

So now, after the session expires, if the user clicks on anything it goes to
the SessionTimeoutPage. This is not the behavior I need, so I've done some
searching and found some suggestions on using AjaxTimerBehavior to warn a
user that a session is about to expire, but nothing that says exactly how to
detect an expired session. Also, some people have hinted that Ajax could
actually keep the session alive so I'm a little confused about that. 

 

Can someone please clarify this and at least point me in the right direction
for fulfilling my requirements?

 

Thanks,

Bruce



RE: How di I display a new page on session timeout without requiring the user to do anything?

2014-03-12 Thread Bruce Lombardi
Thanks Martin,  for the rapid response. Has anyone done anything like this  
this?

Bruce

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: Wednesday, March 12, 2014 11:26 AM
To: users@wicket.apache.org
Subject: Re: How di I display a new page on session timeout without requiring 
the user to do anything?

Hi,


On Wed, Mar 12, 2014 at 5:09 PM, Bruce Lombardi brlom...@gmail.com wrote:

 Hi,



 I have a requirement that says that, for security purposes, when a 
 session times out, the application must go to a different page so that 
 any data displayed is hidden and that the user must  be informed that 
 the session has timed out.  In the init method of my Application 
 class, which subclasses AuthenticatedApplication, I  have the 
 following line.



 getApplicationSettings().setPageExpiredErrorPage(SessionTimeoutPage.cl
 ass);



 So now, after the session expires, if the user clicks on anything it 
 goes to the SessionTimeoutPage. This is not the behavior I need, so 
 I've done some searching and found some suggestions on using 
 AjaxTimerBehavior to warn a user that a session is about to expire, 
 but nothing that says exactly how to detect an expired session. Also, 
 some people have hinted that Ajax could actually keep the session 
 alive so I'm a little confused about that.


This is correct.
Any request to the server will touch the session and thus will keep it alive.





 Can someone please clarify this and at least point me in the right 
 direction for fulfilling my requirements?


Your best bet is to use JavaScript counter that will count down do
document.location.href=anotherUrl; when the counter reaches 0.
You will have to reinit the counter with every ajax request - this is easy.





 Thanks,

 Bruce




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



RE: How to make a Wiket DropDownChoice with complex a model return a simple String

2014-02-12 Thread Bruce Lombardi
Thanks Andrea,

I was trying what you sent in your previous  message and I was having
trouble figuring out how to get the value set on the target property model.

Your code here, especially this line:

targetModel.setObject(getChoiceRenderer().getIdValue(newSelection,
choiceIndex));

was really helpful and I was able to get everything working.

Thanks again. 
Have you ever consider making this available to the Wicket community? I see
a lot of questions related to DropDownChoice, but not many answers.

- Bruce


-Original Message-
From: Andrea Del Bene [mailto:an.delb...@gmail.com] 
Sent: Wednesday, February 12, 2014 4:31 AM
To: users@wicket.apache.org
Subject: Re: How to make a Wiket DropDownChoice with complex a model return
a simple String

Here is some code of a possible solution:


public class DropDownChoiceForStringT extends DropDownChoiceT {

private IModelString targetModel;

public DropDownChoiceForString(String id, IModelT model,
IModelString targetModel, List? extends T choices,
IChoiceRenderer? super T renderer) {
super(id, model, choices, renderer);
this.targetModel = targetModel;
}

protected DropDownChoiceForString(String id, IModelT model,
IModelString targetModel) {
this(id, model, targetModel, Collections.T emptyList(), null);
}

@Override
protected void onInitialize() {
super.onInitialize();
// load the initial choice.
setModelObject(convertChoiceIdToChoice(targetModel.getObject()));
}

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

targetModel.detach();
}

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

T newSelection = getModelObject();

int choiceIndex = getChoices().indexOf(newSelection);
// update the string source with the selected value.
targetModel.setObject(getChoiceRenderer().getIdValue(newSelection,
choiceIndex));
}
}



 Hi,

 I needed something similar in a couple of projects. One solution is to 
 create a custom DropDownChoice which takes also the string model to 
 update. Then you can override onModelChanged to update the string 
 model with the new value that can be extracted with the ChoiceRenderer.
 To make this easier to understand, let's say that I have a list of 
 state abbreviations for example AL, AK, AZ, AR etcetera (the actual 
 example has two letter abbreviations also, but much longer names). I 
 need a DropDownChoice that shows the abbreviations for selection 
 (e.g., AK) but will show the full name as a tooltip whenever the 
 mouse hovers over one of the choice (e.g., AK shows Alaska).

  
 I have developed a solution that is based on the example presented here:
 http://stackoverflow.com/questions/12234738/wicket-dropdownchoice-tit
 les-too

 ltips-for-options

 that develops a subclass of DropDownChoice and overrides 
 appendOptionHtml to append a title to the buffer. My class takes a 
 StateDisplay object as its model, and the model has two fields, an 
 id that is displayed in the list, and a fullName which is added 
 as the title by the appendOptionHtml method.

  
 This works fine for displaying thedropdown with the  tooltip, but the 
 problem is that the model is a complex object( StateDisplay) with two 
 fields, but the underlying domain object needs a simple String with 
 the state ID.

  
 Prior to implementing the tooltip, the DrowdownChoice was formed using:

  
 Item.add(new DropDownChoiceString(state, new
 PropertyModelString((CompanyDTO) item.getDefaultModelObject(), 
 state), stateList)));

  
 Note: item is there because this is used in the populateItem method 
 of a ListView.

  
 Now the code is:

  
 Model StateDisplay  selectedState = new Model();

  
 ChoiceRendererStateDisplay choiceRenderer = new 
 ChoiceRendererModifierDisplayDto(id, id);


 Item.add(new StateDropDownChoice StateDisplay (state, 
 selectedState, stateList, choiceRenderer));

  
 After the selection is made the model (selectedState) is set to the 
 chosen StateDisplay, but there is no easy way to the simple String 
 value set on the CompanyDTO.

  
 How can I make the dropdown selection update the domain model's 
 simple String.

  
 Thanks

 Bruce





-
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



How to make a Wiket DropDownChoice with complex a model return a simple String

2014-02-11 Thread Bruce Lombardi
To make this easier to understand, let's say that I have a list of state
abbreviations for example AL, AK, AZ, AR etcetera (the actual example has
two letter abbreviations also, but much longer names). I need a
DropDownChoice that shows the abbreviations for selection (e.g., AK) but
will show the full name as a tooltip whenever the mouse hovers over one of
the choice (e.g., AK shows Alaska). 

 

I have developed a solution that is based on the example presented here:
http://stackoverflow.com/questions/12234738/wicket-dropdownchoice-titles-too
ltips-for-options

that develops a subclass of DropDownChoice and overrides  appendOptionHtml
to append a title to the buffer. My class takes a StateDisplay object as
its model, and the model has two fields, an id that is displayed in the
list, and a fullName which is added as the title by the appendOptionHtml
method.

 

This works fine for displaying thedropdown with the  tooltip, but the
problem is that the model is a complex object( StateDisplay) with two
fields, but the underlying domain object needs a simple String with the
state ID.

 

Prior to implementing the tooltip, the DrowdownChoice was formed using:

 

Item.add(new DropDownChoiceString(state, new
PropertyModelString((CompanyDTO) item.getDefaultModelObject(), state),
stateList)));

 

Note: item is there because this is used in the populateItem method of a
ListView.

 

Now the code is:

 

Model StateDisplay  selectedState = new Model();

 

ChoiceRendererStateDisplay choiceRenderer = new
ChoiceRendererModifierDisplayDto(id, id);

   

Item.add(new StateDropDownChoice StateDisplay (state, selectedState,
stateList, choiceRenderer));

 

After the selection is made the model (selectedState) is set to the chosen
StateDisplay, but there is no easy way to the simple String value set on
the CompanyDTO.

 

How can I make the dropdown selection update the domain model's simple
String.

 

Thanks

Bruce