Re: Migrating from 1.4.21 to 6

2013-12-31 Thread Martin Sachs
Hi,

i would mirgate to 6 directly, if your application is relativ small and
without special requesthandlings, webtrackings and last but not least
javascript dependencies to other framework than wicket.

e.g. for an application with round about 5.000 lines of code its easier
to update. For big applications (>20.000 LoC) an rewrite with wicket-6
could be better and cleaner with the same effort as updating.

cheers and good luck ;)

Am 30.12.2013 17:45, schrieb Wayne W:
> Hi All,
>
> I'm wanting to upgrade to the latest version of wicket but am worried about
> the possible impact. Also I'm wanting to know the best migration plan. Do
> you think it would be best to jump straight to 6 or first upgrade to 5?
>
> Any tips or ideas would be much appreciated.
>
> thanks
>


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



Wicket and custom URL handling

2013-05-30 Thread Martin Sachs
Hi,

I am search for customizing the URL-Handling in wicket. There are not so
many articles about that.
I would like to handle all URLs starting with /east or /west with one page.
Other possible URLs:
 - /east/services/help
 - /east/services/
or
 - /east/services/help?param=value

Also there should be some pages, which are mounted normally /error ->
ErrorPage.class

Also I dont want parameters like ?0 ?1 ... on the custom URLs and I
would like to submit WicketForms to /east/services/

Which is the best approach to implement this?

Martin

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



HttpsMapper: doent work with proxy-ssl termination

2012-11-10 Thread Martin Sachs
Hi *,

i noticed some errors while using the httpsmapper with ssl-termination
on a proxy(nginx, bigip-F5).

Wicket redirects the following sequence:
http://domain.com/test
results in
https://domain.com/test
this url was also redirected with end ?0 but not https. Redirect to
http://domain.com/test?0

I debugged the HttpsMapper and found, that the method
mapHandler(IRequestHandler handler, Request request) causes this problem.

Original wicket-6.2 source
//**
 * Creates a url for the handler. Modifies it with the correct
{@link Scheme} if necessary.
 *
 * @param handler
 * @param request
 * @return url
 */
final Url mapHandler(IRequestHandler handler, Request request)
{
Url url = delegate.mapHandler(handler);

Scheme desired = getDesiredSchemeFor(handler);
Scheme current = getSchemeOf(request);
if (!desired.isCompatibleWith(current))
{
// the generated url does not have the correct scheme, set
it (which in turn will cause
// the url to be rendered in its full representation)
url.setProtocol(desired.urlName());
url.setPort(desired.getPort(config));
}
return url;
}/

I changed the code to get it work:
/final Url mapHandler(IRequestHandler handler, Request request)
{
Url url = delegate.mapHandler(handler);
   
Scheme desired = getDesiredSchemeFor(handler);
if (desired!= Scheme.ANY)
{
// the generated url does not have the correct scheme, set
it (which in turn will cause
// the url to be rendered in its full representation)
url.setProtocol(desired.urlName());
url.setPort(desired.getPort(config));
}
return url;
}/

I dont have a quickstart for this, 'cause you also need a proxy
configuration to get this bug.

What do you mean?

cya
Martin


Re: Should I really go for LoadableDetachableModel ?

2012-08-19 Thread Martin Sachs

Hi,

yes the listDataProvider doesnt help for minimize memory usage. The 
DataProvider will be stored in Component and therefore all fields are 
also stored in component/session. For e.g. 2000 Session you have 2000 
times the same list in memory. This is not what you want.
First optimization: Cache the list in one list (static or 
cacheprovider), that only one session is referenced in all dataprovider.
Later optimization: dont hold a reference to the list und load the list 
on every request in dataprovider but with limiting the e.g. SQL-Query to 
the (first, count) Range given in DataProvider.
The list and items will be detached on end of request (which means 
removed from memory)

SQL-Query caching is also recommended.
MySql supports this by "limit" .

Note: Hibernate and JDO supports rangequeries DB independent.

Every Request will be in Young-Gen Memory and shortly removed after 
requests ends.

You have full controll what will stored in memory(Caches)

cya
   Martin

kshitiz schrieb:

Hi,

Thanks for the reply. I am trying t achieve what you suggested me. But one
thing I want to ask. In listDataProvider, you will anyway provide list of
data to get rendered. You may render it in any manner but that list will be
stored as final or class variable. Wont that take up the session ? I mean
what difference will it make to use dataview instead of simple list with
listview in terms of memory? I am trying to understand its concept so please
ignore my mistake...:)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Should-I-really-go-for-LoadableDetachableModel-tp4651353p4651356.html
Sent from the Users forum mailing list archive at Nabble.com.

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


  



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



Re: Wicket as Jboss Modules

2012-06-12 Thread Martin Sachs

Hello,

i think that is in general not a good idea. If you deploy the wicket-lib 
outside the war and run multiple Wicket-Applications, then you could not 
use all applications, because wicket stores (as far as i know) e.g. the 
application instance in a static field. There is one application per 
WAR-deployment with wicket, but if you use the libs from ear/lib or 
modules there will be only one application.


best
Martin

Илья Нарыжный schrieb:

Hello,

I have several projects which use wicket and various wicket sun-modules.
Every project (*.ear file) took about 10Mb and about 8Mb is for wicket
libraries.
Recently I have move my projects to Jboss AS 7 and now I'm thinking
about putting all wicket related jars to /modules.

Have anyone tried that? Do you have some suggestions for Jboss module
structure for this?
It will be great to have
IMPLICIT(https://docs.jboss.org/author/display/AS7/Implicit+module+dependencies+for+deployments)
deploy of wicket related jars to the project.

Thanks,

Ilia

-
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: The component(s) below failed to render (BasePage components are not rendering)

2011-01-24 Thread Martin Sachs
hi,

i dont see problems in the markup. Can u please post some
java-components ? Do you have called super. ... -methodes (e.g.
onInitialize)

martin

Am 24.01.2011 20:19, schrieb Teddy C:
> Using the Wicket Phonebook as a base, I am having problem dispalyng the
> EditContactPage. To the BasePage I add user and role and a Session to save
> the login user and role. The listContactPage wich extends the BasePage works
> fine. The EditContactPage which also extends the Basepage, is mot able to
> display the EditContactPage, failing to render the Components that are
> defined in the BasePage.
>
> I would appreciate if someone has any idea of a  solution to this problem.
>
> BasePage.Html
> 
>   
>   Wicket Phonebook
>   
>   
>   
>   
>   
>   Login Name:
>   
>   
>   
>   Login Role: 
>   
>   
>   [[status 
> messages]]
>   
>   
> 
>
> ListContactpage:
> 
> 
> 
>   
>   
>   
>   [call to focus restore script]
>type="submit"/>
> 
>
> 
> 
>
> EditContactPage:
> 
> 
> 
> 
> 
>key="passenger">[passenger] wicket:id="passenger" size="30"/>
> 
> 
>key="costcenter">[costcenter] wicket:id="costcenter" size="5" maxlength="6"/>
> 
> 
>key="car_no">[car_no] wicket:id="car_no" size="30"/>
> 
> 
>key="pu_addr">[pu_addr] wicket:id="pu_addr" size="30"/>
> 
> 
>key="dest_addr">[dest_addr] wicket:id="dest_addr" size="30"/>
> 
> 
>   [rate] wicket:id="rate" size="30"/>
> 
> 
>   [toll] wicket:id="toll" size="30"/>
> 
> 
>   [wait] wicket:id="wait" size="30"/>
> 
> 
>   [stops] wicket:id="stops" size="30"/>
> 
> 
> 
>   [other] wicket:id="other" size="30"/>
> 
> 
> 
>key="wc2pct">[wc2pct] wicket:id="wc2pct" size="30"/>
> 
> 
> 
>   [total] wicket:id="total" size="10"/>
> 
> 
>    
>   
> 
> 
> 
> 
> 
>
> ERROR:
> WicketMessage: The component(s) below failed to render. A common problem is
> that you have added a component in code but forgot to reference it in the
> markup (thus the component will never be rendered).1. [MarkupContainer
> [Component id = status]]2. [Component id = Name]3. [Component id = Role]Root
> cause:org.apache.wicket.WicketRuntimeException: The component(s) below
> failed to render. A common problem is that you have added a component in
> code but forgot to reference it in the markup (thus the component will never
> be rendered).1. [MarkupContainer [Component id = status]]2. [Component id =
> Name]3. [Component id = Role] at
> org.apache.wicket.Page.checkRendering(Page.java:1182) at
> org.apache.wicket.Page.renderPage(Page.java:922) at
> org.apache.wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:167)
> 
> at
> org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:58)
> 
> at
> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> 
> at
> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> 
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at
> org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at
> org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
> at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)  
>   
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> 
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 
> at
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
> 
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> 
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> 
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 
> at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> 
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> 
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
> 
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> 
> at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
> 
> at
> org.apache.catalina.authenticator.AuthenticatorBase.

Re: Unserializable exceptions on declaring springs org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor

2011-01-04 Thread Martin Sachs
hi,

are u using Interface oder Class for UserDao

i think using Interface could solve this problem.

martin

Am 04.01.2011 18:53, schrieb Roman Ilin:
> Nobody uses such weird thing?
>
>
>
> On Tue, Jan 4, 2011 at 12:44 AM, Roman Ilin  wrote:
>> Sorry, I haven't said that I get unserializable exceptions in Provider
>> for my table - list.
>>
>> public class UserDataProvider extends
>>CustomerAwareSortableDataProvider {
>>
>>private final User findByExample;
>>@SpringBean
>>private UserDao userDao;
>>
>>public UserDataProvider(User findByExample) {
>>InjectorHolder.getInjector().inject(this);
>>this.findByExample = findByExample;
>>}
>> 
>>
>> I think SpringBean annotation injects proxy for my spring bean and not
>> a direct reference.
>>
>>
>> Here is error message:
>>
>>
>> Hibernate: select count(*) as col_0_0_ from User user0_ limit ?
>> Hibernate: select user0_.id as id0_, user0_.is_admin as is2_0_,
>> user0_.full_name as full3_0_, user0_.organization_id as organiza6_0_,
>> user0_.password as password0_, user0_.username as username0_ from User
>> user0_
>> WARN  - AutoLinkResolver   - Did not find corresponding java
>> class: net.smart4life.school.web.page.user.IndexPage
>> INFO  - RequestLogger  -
>> time=247,event=BookmarkablePage[net.smart4life.school.web.page.user.SuUserListPage()],response=BookmarkablePage[net.smart4life.school.web.page.user.SuUserListPage()],sessioninfo=user=n/a,sessionsize=5605,sessionstart=Tue
>> Jan 04 00:43:00 CET
>> 2011,requests=3,totaltime=715,activerequests=0,maxmem=467M,total=162M,used=124M
>> ERROR - Objects- Error serializing object class
>> net.smart4life.school.web.page.user.SuUserListPage [object=[Page class
>> = net.smart4life.school.web.page.user.SuUserListPage, id = 1, version
>> = 0]]
>> java.io.NotSerializableException:
>> org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
>>at 
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
>>at 
>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
>>at 
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>>at 
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
>>at 
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>>at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)
>>at 
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
>>at 
>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
>>at 
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>>at 
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
>>at 
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>>at 
>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
>>at 
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>>at 
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
>>at 
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>>at 
>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
>>at 
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>>at 
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
>>at 
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>>at 
>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
>>at 
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>>at 
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
>>at 
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>>at 
>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
>>at 
>> java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422)
>>at org.apache.wicket.Component.writeObject(Component.java:4674)
>>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>at java.lang.reflect.Method.invoke(Method.java:597)
>>at 
>> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
>>at 
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
>>at 
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
>>at 
>> java.io.ObjectOutputStream.write

Re: Bigger sites running on wicket?

2010-05-20 Thread Martin Sachs
Yes Springer.com is online since Feb 2010.  We didnt have post  an
announcement, because we are in stabilizing-phase the past month.

We use Wicket-1.4.5 and JQuery for effects and modal-windows.

regards
Martin

Martijn Dashorst schrieb:
> Yup,
>
> http://mobile.walmart.com is Wicket based, as are
> http://mexico.com,
> http://vegas.com,
> http://springer.com (didn't know about this one!),
> http://jalbum.net/create/
> http://eropuit.nl
> ...
>
> Search for "wicket:interface" with google and filter out the blog
> posts and forum questions. You'll see that more websites are using
> Wicket.
>
> Martijn
>
> On Thu, May 13, 2010 at 4:18 PM,   wrote:
>   
>> Some things I've seen on this forum...Wal-Mart's mobile site, lasvegas.com
>>
>>
>>
>> Notice: This communication, including any attachments, is intended solely
>> for the use of the individual or entity to which it is addressed. This
>> communication may contain information that is protected from disclosure
>> under State and/or Federal law. Please notify the sender immediately if
>> you have received this communication in error and delete this email from
>> your system. If you are not the intended recipient, you are requested not
>> to disclose, copy, distribute or take any action in reliance on the
>> contents of this information.
>> 
>
>
>
>   



Re: Caching components

2010-03-26 Thread Martin Sachs
Yes we use LoadableDetachableModel. But we also do some times
getModel().getObject() deeper in hierarchy inside the construction, to
e.g. set the visibility of a panel or to create just the right panel,
instead of creating e.g. ten panels and implement isVisible().

Martin
   

Jan Kriesten schrieb:
> Hi Martin,
>
>   
>> One reason for loading some data in contstructur or onBeforeRender is to
>> prevent creating huge hierarchies. This is faster than override
>> isVisible(), since isVisible would called more than one times.
>> 
>
> why are you loading data in the component at all? There is this nice
> 'LoadableDetachableModel' which could/should wrap that...
>
> Best regards, --- Jan.
>
>
>   


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



Re: Caching components

2010-03-26 Thread Martin Sachs
We have a lot of Repeating views, which containing a lot of components,
which also contains repeatingviews.

To know would should be rendered, we load some hopefully small
(listsizes, objectbyId, ...) datas from DB in the constructor and/or in
onBeforeRender and in isVisible. You are right, this is not a
recommented way. Most of the time is database-loading and wicket has no
performance-problem for us. We profile our application and never found
wicket-components as hotspots.

One reason for loading some data in contstructur or onBeforeRender is to
prevent creating huge hierarchies. This is faster than override
isVisible(), since isVisible would called more than one times.

For our usecase the responsetime is much faster with HTML-Caching,
because the Database-calls are minimized. We save the time for creating
componentshierarchies (all three categories) with loading data.


Martin

Jeremy Thomerson schrieb:
>
> On Wed, Mar 24, 2010 at 3:26 AM, Martin Sachs  <mailto:sachs.mar...@gmail.com>> wrote:
>
> hi,
>
> we need caching of components, since the construction of huge
> hierarchies is not cheap. The rendering ist fast. We cache the
> rendered
> HTML of a hole component via a beheaviour and write them on the next
> requests into a Label (unescaped). So instead of creating the complete
> hierarchie on every request, we create a much smaller one. But you
> must
> check, that the cachable components are stateless. Also we have JQuery
> for client-effects in this components, this would also be cached.
>
> The performance is much better with that: approx. 10-50 times better:
>100ms with cache (the response time is not much depending on count
> of users)
>vs
>1500 ms without cache depending how many parallel user
>
>
> A 15x gain is a big statement to make.  Can you please break this
> 1500ms down into at least the following categories:
>
> 1 - time in IModel#getObject() and all child calls of this (IOW,
> loading data)
> 2 - time in constructor of components (without loading data in the
> constructor - hopefully you're not doing this)
> 3 - time in rendering of components
>
> That would be a much better number to give other users.  I have NEVER
> seen where creating / rendering components could take 1400ms - unless
> you're doing something wrong like database calls in your component
> constructors.  So, I suspect that most of that 1400ms (I would guess
> at least 1250ms) is in your model loading.
>
> The only time I've seen (or seen proof of) the component hierarchy
> actually be the slow part of a Wicket page is if you were displaying a
> repeating view of some sort with thousands of rows and each row had a
> bunch of components in it - leading to tens of thousands of components
> being built in the hierarchy.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com


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



Re: Caching components

2010-03-24 Thread Martin Sachs
hi,

we need caching of components, since the construction of huge
hierarchies is not cheap. The rendering ist fast. We cache the rendered
HTML of a hole component via a beheaviour and write them on the next
requests into a Label (unescaped). So instead of creating the complete
hierarchie on every request, we create a much smaller one. But you must
check, that the cachable components are stateless. Also we have JQuery
for client-effects in this components, this would also be cached.

The performance is much better with that: approx. 10-50 times better:
100ms with cache (the response time is not much depending on count
of users)
vs
1500 ms without cache depending how many parallel users.


in near feature i will announce the site officially here.

Martin


Jeremy Thomerson schrieb:
> Components are not thread safe, and not intended to be used in this way -
> there would be a significant undertaking to make them cacheable, and the
> cost of the synchronization would likely far outweigh the current costs of
> component instantiation, etc...
>
> Where you can make the biggest difference is caching your models.  If you
> don't have to re-retrieve your model data, then you can get huge gains.
>
> Of course, if you thoroughly do your performance testing and find that your
> site really is so huge and has so much traffic that the extra instantiation
> is hurting you, the way to go is caching the generated markup with a
> frontend cache.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Wed, Mar 24, 2010 at 2:15 AM, zkn  wrote:
>
>   
>> Hi,
>>
>> since Wicket uses session to store the components hierarchy for a page is
>> it possible to store parts of the hierarchy in the application context
>> instead of the user session? If it's not possible do you consider it worth
>> to add as feature request?
>>
>> What's the idea: imagine a home page of a website where eventually for a
>> short time of period( say 1 minute) the only dynamic component is a search
>> form( and that's only in case the user hits search). The rest of the page
>> consist of components that do not change for each user request - for example
>> a block of news. If 100 users hit the page simultaneously they will actually
>> see the same content in that block and there is nothing in that block that
>> depends on the user session. The content may change in few minutes when a
>> new article has been added.
>>
>> What if for example the developer has the option to make a component
>> cacheable by implementing specific interface which will give the developer
>> the option to use the cached version or render and possible store the new
>> rendered component in cache?
>>
>> Seems like this can significantly improve performance in certain
>> situations.
>>
>> Regards,
>> Ozkan
>> -
>> 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: Ajax and OpenSessionInViewFilter problems

2010-02-19 Thread Martin Sachs
Hi ,

if you use LDM for a form Model.getObject will load the Objects from DB
in each request. This is not a Problem, if all data are in the Form
allready.

Ajax-submit sends the Form incl. all field as parameters, if valid set
it to this object and then you have to Store it in this request.  If you
want to collect datas in a transient (not persistent) way you could use
the Session, or Serializable objects.  The state of data is always in
the form or component.

I use Hibernate with serializable objects AND Lazy-loading. This is not
always a nice solution. To work with this Objects, i reattach the
hibernatesession on each method call via AspectJ. This allows to use
DB-Mapped serialized POJOs with Lazy loading in e.g. PropertyModels.

I would not recommend to use DTOs, but in some cases this is a cheap
solution.

regards
Martin



Kogel, Jonck-van-der schrieb:
> Hi All,
> Follow-up to my own post.
>
> I found the following here:
> http://old.nabble.com/Wicket---No-Serializable-objects-Web-application-t
> d19351608.html
>
> Quote: "However , there is a problem if you use loadabledetachable with
> AJAX requests
> on your page. Model.detach() is called on every request, which causes
> your
> object to be retrieved from database on the next Model.getObject() call.
> This
> means you lose all changes on your bound domain obect on every ajax
> request.
> I found to solutions to this, and i like neither of them:
>
> a) use DTOs, which means a lot of code duplication.
>
> b) write the current object state  to the database on every detach,
> which
> means you might store objects in an incomplete state, before the user
> explicitly tells the application to store what she or hehas entered.
>
> If anybody has a nicer solution to this, i'd love to hear about it. "
>
> Option b) is definitely a no-go, so it seems I'll have to use DTO's
> then. If someone knows of a nicer solution I would also love to hear
> about it. For now I guess I'll go the DTO road.
>
> Thanks, Jonck 
>
> -Original Message-
> From: Kogel, Jonck-van-der [mailto:jonck-van-der.ko...@bmw.nl] 
> Sent: donderdag 18 februari 2010 14:30
> To: users@wicket.apache.org
> Subject: Ajax and OpenSessionInViewFilter problems
>
> Hi All,
> As the subject reads, I'm having some problems with Ajax and the
> OpenSessionInViewFilter. Here's my basic setup:
>  
> I've got a page with some address info, such as street/city/zipcode.
> Let's call the current value of these fields V1. There is also an ajax
> link to open a modal panel that allows the user to look up street/city
> info based on the zipcode. When the modal panel opens the info V1 is
> passed on to the modal panel as initial value. Let's say here the user
> enters new info and a street/city is found, we'll call this info V2. The
> user then presses the submit button on the modal panel and indeed V2 is
> now shown on the main page. However, when I now click the ajax link to
> open the modal panel again, the user get's shown V1 in the modal panel
> as initial filling. When finally submitting the page V2 is persisted, so
> the information is being retained somewhere.
>  
> I have debugged the application and I see the setters of my domain
> object being called. Also when debugging however I see that the load()
> method of the LoadableDetachableModel is being called when I hit the
> ajax link, so it seems like a new version of the object is being
> retrieved from the database. I thought that's what the
> OpenSessionInViewFilter was for, to allow for multiple requests in your
> view without Hibernate closing/opening the session each time and
> retrieving fresh copies of your objects. Here is some relevant code:
>  
> OpenSessionInView setup in web.xml:
>  
> 
>  opensessioninview
>  
>   org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
>  
>  
>   singleSession
>   true
>  
> 
>  
> Submit link on my modal panel:
>  
> searchResultsHolder.add(new AjaxSubmitLink("selectMatch") {  @Override
> protected void onSubmit(AjaxRequestTarget target, Form form) {
>   Address address = addressModel.getObject();
>   address.setZipcode(foundZipcode.getZipcode());
>   address.setHouseNr(foundZipcode.getHouseNr());
>   address.setStreet(foundZipcode.getStreet().getStreetName());
>   address.setCity(foundZipcode.getCity().getCityName());
>   address.setCountry(Country.NL);
>   address.setAddressValidated(true);
>   
>   for (Component component : updateList) {
>target.addComponent(component);
>   }
>   modalWindow.close(target);
>  }
> });
>  
> The LoadableDetachableModel used (and is being called when I hit the
> ajax link):
>  
> final IModel mergedModel = new LoadableDetachableModel() {
> @Override  protected ARF load() {
>   return arfService.load(arfId);
>  }
> };
>  
> Many thanks for any help!
>  
> Kind regards, Jonck
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: u

Re: How to add and remove css classes the right way?

2010-02-05 Thread Martin Sachs
Hi Martin

user the AttributeModifier or AttributeAppender classes.



Martin

Martin U schrieb:
> Hi Folks,
>
> I'am getting totally confused how to add and remove css classes to and form
> my text-input-fields on ajax-form-validation.
>
> At first i try to add two css classes step by step:
>
> Iterator iter =
> Session.get().getFeedbackMessages().messages(getFeedbackMessageFilter()).iterator();
> if(iter.hasNext()){
> indicatorFor.add(new SimpleAttributeModifier("class","validation_error"));
> indicatorFor.add(new SimpleAttributeModifier("class", "test"));
> }
>
> But gets the Markup only with "class='test' "
>
> How can i add more than one "value" to "class"?
>
> And how can i remove one special css-class from an component if the
> validation is okay to this field?
>
>
> Thanks in Advance for any help.
>
> - Martin
>
>   


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



Re: Wicket Wizards and Hibernate

2010-01-14 Thread Martin Sachs
hi,

if you want to store the Objects at the end of the wizzard, you have to
reattach to the session with lock(NONE), else Entitymanager.merge will
save each step.

Alternativly you can open one transaction and merge (or saveOrUpdate)
after every step. On last step you can commit the transaction. I think
this is named conversation.

martin

Rodolfo Cartas schrieb:
> Hi! I'm currently working on a wizard to modify a pojo extracted from
> a database with Hibernate. I don't want to commit any changes to the
> db before the user finishes the wizard, but the pojo loses reference
> to the original session. Shall I eagerly fetch the object to avoid any
> hibernate session reference exceptions?
>
> Thanks,
>
> Rodolfo
>
> -
> 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: Handling Ajax session expired

2009-12-28 Thread Martin Sachs
Hi,

i have the same problems for our heavy ajax wicket site. I use
wicket-ajax so the stateless flag can not be used. If the session
expires i make some assumptions:
 * all user generated content is thrown away. (e.g. shopingbasket)
 * the pagecomponents the user is on is in "initial hierarchie",
otherwise i get also a pageexpired exception.

On click on a ajax link i implement a logic, to rebuild the page for the
ajaxlink. And then the event would processed as before.

My issues:
  * if i replace components with ajax-requests before, the beheaviour
could also fire a pageexpired exception. But then i redirect to the last
known ( rebuilded) Wicketpage.

What issues you see in this solution ?

We have made some other workarounds for AJAX:
 * Using JQuery ajax-calls to wicket-resources
 * Caching a lot of content and switching visibily only on client side
with jquery

Martin

Arie Fishler schrieb:
> Hi,
>
> When a client has a page in his browser that he does not touch for a while
> and the session expired. after that if he hits an ajax link for example - an
> exception occurs in the wicket level due to the session expired state.
>
> How can I gracefully handle such a situation assuming that there is no a
> single "home page" i can transfer the user. This means that the session
> itself had some information on the specific environment the user was in.
>
> I can think of adding some information on the ajax link that will indicate
> that but again the exception happens at the wicket level and if I am
> handling the exception not sure how I can retrieve such data.
>
> Any good methodology here?
>
> Thanks,
> Arie
>
>   


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



Re: 1 EAR, 2 WARs causes Spring Context Problem

2009-09-30 Thread Martin Sachs
Hi, you have to user a classloader per Webapp, so the InjectorHolder has
for each webapp the correct Springcontext. (injectorholder uses a static
variable)

martin

Steve Hiller schrieb:
> Hi All,
>
> I'm not sure if this is a Wicket, Spring or WebSphere issue or some 
> combination of the 3.
>
> General Setup:
> WebSphere 6.1, wicket 1.3.7, Spring 2.5.6
>
> Specific Setup:
> 1 EAR contains 2 WARs, call them WAR1 and WAR2.
> Each WAR uses the Wicket & Spring frameworks.
> The EAR is deployed to WebSphere -- each WAR's deployment descriptor
> uses the WicketServlet and SpringContextLoaderServlet to control their 
> respective frameworks
> (see 
> http://cwiki.apache.org/WICKET/websphere.html#Websphere-WicketServletratherthanWicketFilter)
> Each WAR holds its Spring application configuration file 
> (applicationContext.xml) under its WEB-INF directory.
> Each applicationContext.xml file wires up a service bean.
> The service beans are for two completely different classes, call them 
> Service1 (in WAR1) and Service2 (in WAR2).
>
> Problem:
> If I run the WAR1 web application first, then it successfully uses its 
> Service1 bean.
> But, if I then run the WAR2 web application, it cannot find its Service2 bean.
> This also happens in reverse order. That is, if I run the WAR2 web 
> application first, then it
> successfully uses its Service2 bean, but then running the WAR1 application 
> fails to find
> its Service1 bean. The failure exception is like:
>
>   java.lang.IllegalStateException: bean of type [war1.Service1] not found
> at 
> org.apache.wicket.spring.SpringBeanLocator.getBeanNameOfClass(SpringBeanLocator.java:107)
> at 
> org.apache.wicket.spring.SpringBeanLocator.getBeanName(SpringBeanLocator.java:192)
> at 
> org.apache.wicket.spring.SpringBeanLocator.isSingletonBean(SpringBeanLocator.java:133)
> at 
> org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:90)
> at org.apache.wicket.injection.Injector.inject(Injector.java:108)
> at 
> org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39)
> 
> Has anyone come across this issue before?
>
> Thanks,
> Steve
>
>   


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



Re: Rendered html to string

2009-09-30 Thread Martin Sachs
if you want just one component in the hierarchie to be rendered to a
String you have to make a Behaviour and use the StringResponse-class to
replace the hole Response in beforeRender for this component.
in onRendered you can add the string again to the hole Response. We do
this for caching HTML Fragments  via  EHCache. 

Martin

Luca Provenzani schrieb:
> oops, yes, you are right! :-)
>
> 2009/9/30 Peter Arnulf Lustig 
>
>   
>> getMarkupStream().toString();
>> maybe?
>>
>>
>>
>>
>> - Ursprüngliche Mail 
>> Von: Luca Provenzani 
>> An: users@wicket.apache.org
>> Gesendet: Mittwoch, den 30. September 2009, 12:32:19 Uhr
>> Betreff: Rendered html to string
>>
>> Hi all,
>>
>> does someone know how to render a wicket component into a String?
>>
>> Thanks
>> Luca
>>
>>
>>
>>
>>
>> -
>> 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: Handling Hibernate session (LazyInitializationException)

2009-09-17 Thread Martin Sachs
hi,

you could also use an Aspekt (e.g. with Aspekj) zu reinit all lazy
proxies on the next request. The Proxy objects would be detachted and
serialized throw
the models. With an Aspekt you can re-attach ALL hibernate proxies,
without triggering the DB.

Martin



Anton Komratov schrieb:
> Hi, I'm using Wicket + Hibernate (without Spring).
> In my application I open Hibernate *session* in WebRequestCycle.*
> onBeginRequest*() and close it in WebRequestCycle.*onEndRequest*().
>
> But having association (many-to-one mappings between classes) I've got
> LazyInitializationException (no Session). I've just set parameter
> "*lazy*"=false
> in hibernate mapping file to "many-to-one" mappings. And it worked fine -
> amount of data stored in memory in this case was not critical.
>
> Since the system is growing furhter, the method with no lazy initialization
> is no more suitable. Could you, please, advise me a way to handle hibernate
> session to have lazy initialization. (Solution with no Spring is
> preferable).
>
> // Best regards, Anton
>
>   


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



Re: Announcing: Scala-Wicket Extensions Project

2009-08-15 Thread Martin Sachs
Thanks for that variant of programming wicket-application!

I like scala and its concepts, very much.  Using scala with wicket would
properbly make wicketapplications a little faster, more refactor-safe
and better maintainable.

Do you have good IDE for scala ? If the IDE (e.g. Plugin for eclipse) is
as well as java-IDE, scala would be the better java. But without IDE,
many enterprises wont use scala.

Martin

Antony Stubbs schrieb:
> Hello People,
>
> Today, I am proud to announce that I have now uploaded the first
> version of the new Scala-Wicket Extensions.
>
> The project aims to be a central point for Scala related extensions to
> the Wicket framework.
>
> At the moment, the project consists of an Archetype, Sample
> application and Core libraries.
>
> The core libraries at this point consist of some useful implicit
> conversation functions (Scala -> Java list conversion, Closure ->
> Fodel conversion, etc... ScalaWicket.scala) a collection of simple
> extensions to existing components and the Fodel class. The Fodel class
> allows us to use closures and pass by name parameters in Scala to
> avoid some explicit construction of Models.
>
> For example:
> new SLabel("name", person.name )
> This actually constructs a Model which just like a Property Model
> looks up and re-evaluates the name property of the Person during each
> render time (i.e. this is a dynamic model, not a static model as it
> may appear to be, or would be if it were Java).
> Also:
> new SPropertyListView[String]("presentations", list, _.add(new
> SLabel("name", "asdp name")))
>
> There are a whole lot of examples in the Specification files, as the
> whole library as it stands is covered by Specs unit tests.
>
> It also includes SBT (simple build tool) code AND Maven build code
> (take your pick).
>
> I invite all those who are currently using Scala with Wicket to submit
> there odds and ends that make life easy for them - I'm sure there's a
> whole bunch of stuff out there!
>
> Special thanks to Stuq.nl
>
> P.s. it seems wicketstuff team city is stuck, so the SNAPSHOT won't be
> on the Wicket Stuff repo atm, but I'll try and get that sorted out asap.
>
> Maven signature:
> 
> org.wicketstuff.scala
> wicket-scala
> 1.4-SNAPSHOT
> 
>
> Cheers,
> Antony Stubbs,
>
> sharca.com
>
>


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



Re: Hibernate LazyInitializationException

2009-06-25 Thread Martin Sachs
hi

you used   "this.user = (EzdecUser)userModel.getObject();" This would
hold in page and not initialized on next request.
You have to hold the model in the page.

We have also found an alternative way. You can write a simple Aspect
with AspectJ to reinit all proxies. This can easily done with
hibernateSession.lock(NONE).
Create pointcuts to each getter which is returning a proxy and init the
proxies.

Martin




jpalmer1...@mchsi.com schrieb:
> I am getting an "org.hibernate.LazyInitializationException - could not
> initialize proxy - no Session" exception when I try to load an object
> stored in session. I understand but I am not certain about how to fix
> it with Wicket. In reviewing the Wicket In Action book, it looks like
> the way to handle this is to use a LoadableDetachableModel, which I
> tried. The model is as follows:
>
> public class DetachableUserModel extends
> LoadableDetachableModel {
>
> @SpringBean
> private ISecurityService securityService;
>
> private final String email;
>
> public DetachableUserModel(EzdecUser u) {
> this(u.getEmail());
> }
>
> public DetachableUserModel(String email) {
> if (email == null) {
> throw new IllegalArgumentException();
> }
> this.email = email;
> System.out.println("email is " + email);
> InjectorHolder.getInjector().inject(this);
> }
>
> @Override
> public int hashCode() {
> return email.hashCode();
> }
>
> @Override
> public boolean equals(final Object obj) {
> if (obj == this) {
> return true;
> } else if (obj == null) {
> return false;
> } else if (obj instanceof DetachableUserModel) {
> DetachableUserModel other = (DetachableUserModel) obj;
> return email.equals(other.email);
> }
> return false;
> }
>
> @Override
> protected EzdecUser load() {
> EzdecUser u = securityService.findUserByEmail(email);
> return u;
> }
>
> }
>
> The relevant section of the code where I am using the model is as follows:
>
>  public UpdateUserProfilePage() {
> this(EzdecSession.getCurrentUser());
> }
>
> public UpdateUserProfilePage(EzdecUser user) {
> this(new DetachableUserModel(user));
> }
>
> private UpdateUserProfilePage(DetachableUserModel userModel) {
> this.user = (EzdecUser)userModel.getObject();
> setup();
> }
>
> Anyone have any suggestions on how I can fix this?
>


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



Ideas for Handling PageExpired on BookmarkablePages

2009-06-19 Thread Martin Sachs
Hi wicketiers,

Again questions about PageExpired...

I throught a couple of times about PageExpiredException. IMO this is not
a User Exception, i can not tell the user to restart the application. So
what can i do on PageExpired (on sessiontimeout) ?

To my mind there are a lot of ways for handling PageExpiredException on
sessiontimeout:
1) For authorized pages we can simply redirect to the login-page.

2) on public pages we should never show an error page, after the
user has clicked some stateful-ajax link.

   2.1) we should minimal redirect the user to the last bookmarked
page, this is the page, the user found the ajax-link. But this is a problem:
  My idea was to store the last bookmark-request-URL to the
session, if the session was destroyed the last URL was stored to an
Hashmap in the application with the key 'sessionID'
  Yeah, this sessionID was timeout to we get a new Session after
timeout. We have to provide a cookie with the last sessionID or a UUID
or the URL itself.
  With this cookie a can redirect the ajax-reqest to the last
known page.

   2.2) Prevend the PageExpiredException by include a  HTML fragment on the page and set it to the sessiontimeout+1s, so
each open Browser request the new   Bookmarkable Page and the session
was newly created. The Ajax-call would be executed ever, but the state
is new after timeout.
 - Can an AJAX-Response change the URL of the page so that
the last change through ajax is also encoded in URL ? Brix does
something like this.

   2.3) Prevend the PageExpiredException  by include the
bookmarkablePage URL on each ajax-request. So on Ajax-Request the Page
would simply build again with new state and the AJAX-Call works. I read
this was very tricky and not planned yet.
 
What do you guess about that? do you know any other fallbacks on
Pageexpired which dont confuse the Enduser ?

By the Way is it a good idea to store the Pagehierarchie not in
HttpSession, but in a EHCache implementation? I would also use a cookie,
that dont expires with the session and i would use this Cookie to know
the old user. the EHCache is fast and in memory with good and proved
Stragegies (LRU,...) and writing back to persistent store and so on. So
a new session should not cause a PageExpiredException on AJAX-Request.
Also the memory outside the HttpSession can be much bigger and EHCache
or whatever Implementation can be distributed.

What is your best practice ?


Martin






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



Multiple throws of the RestartResponseAtInterceptionPageException

2009-06-13 Thread Martin Sachs
What is the best approach for using multiple interceptionpages:

Usecase:
   
- request a not Authorized page
- first interception is the loginPage
- after login "you must enter a valid address"-page ( this point can
vary for different initial requests so the AuthorizationStrategy dont
implement all cases)
- more interception pages
- redirect to initial requested page.

Martin


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



Re: Returning to the original page after session timeout / login

2009-06-12 Thread Martin Sachs
I wonder why this is so a big problem. On bookmarkable Webpages (e.g.
Productpages) the user dont need to login and the session can destroyed
via timeout. Each Ajax-Request throw would throw a PageExpiredException.
This is the worst thing in wicket, IMHO.

My tryout was the following in a quickstart-project:

I modified the Homepage:

public class HomePage extends WebPage {

  private static final long serialVersionUID = 1L;

  // TODO Add any page properties or variables here
  private int   i= 0;

  /**
   * Constructor that is invoked when page is invoked without a session.
   *
   * @param parameters
   *  Page parameters
   */
  public HomePage(final PageParameters parameters) {

// Add the simplest type of label
final Label label = new Label("message", "If you see this message
wicket is properly configured and running" + i);
label.setOutputMarkupId(true);
add(label);
setStatelessHint(true);
setVersioned(false);

AjaxEventBehavior ajaxEventBehavior = new AjaxEventBehavior("onclick") {

  @Override
  protected CharSequence getCallbackScript() {
return super.getCallbackScript() + ";return false;";
  }

  @Override
  protected void onEvent(AjaxRequestTarget target) {
i++;
target.addComponent(label);
  }

};
BookmarkablePageLink link = new
BookmarkablePageLink("link", this.getPageClass());
link.add(ajaxEventBehavior);
add(link);

  }

  @Override
  public boolean isBookmarkable() {
return true;
  }

  @Override
  public boolean isVersioned() {
return false;
  }

  @Override
  public boolean isPageStateless() {
return true;
  }

and overide the resolveRenderedPage() -Method of
WebRequestCycleProcessor to handle the case, if the page is null. I just
create a Page and call beforeRender on it. So the hierachie was build.

The Ajax-request found a component and it work ! The State is coded in
URL at bookmarkable pages, so who cares about lost state, just create a
new one. This could also work for stateless pages, for which i overide
isPageStateless. The component-hierachie must not be scaned and you can
use ajax.

Alternative: Maybe you can create a new RequestCycle to handle ajaxcalls
without creating the hole hierarchie. Just create the panel with the
state coded in the URL?

What are the reasons for not doing it ?

After login you can use the intercepting mechanism. But is the best why
to intercept multiple times and return to the originals step by step
(like stack-beheaviour) ?


Martin

Christopher L Merrill schrieb:
> I've changed out PageExpiredErrorPage to be the login page for our app.
> Does wicket have any support built-in to help return the user to where
> they were after re-authenticating?
>
> From my modest understanding of Wicket, it would need to be a
> bookmarkable
> page, which will be ok for a good percentage of the pages in our system.
>
> Any suggestions?
> TIA!
> Chris
>
>


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



Re: [OFF TOPIC] Java desktop applications

2009-06-11 Thread Martin Sachs

1: Maybe QT  or what about java.net!
3: Adope AIR is really nice looking
4: if you have in mind, that you would need the app also in web
(intranet) build a wicket application. Desktop apps have better
usability in general.
   GWT-application is an option to have both worlds !


Jeremy Thomerson schrieb:
> I would like to build a nice-looking java desktop application.  I hope
> that isn't an oxymoron  :).  I have built some desktop apps before - a
> lot of command line utilities in various languages, and some GUI apps
> (perl, java, python, php, even vb (yikes!), c# etc...).
>
> The question is - what framework do you use for your UI components and
> layout on a desktop app?  I would like to use Java because I'll be
> most efficient with it and it will work for me on linux machines and
> others on Windoze, etc..  But when I've built Swing apps in the past,
> I have hated having to layout everything in the code and I can never
> make anything aesthetically pleasing.  So
>
> 1 - do you have any recommendations on a good framework for nice
> looking desktop apps?
> 2 - any other recommendations for desktop apps in general?
> 3 - It should be a lightweight, easy install - and I would prefer to
> stay away from using the Eclipse framework for building the app (I use
> the IDE but it doesn't need to be something that heavy for the GUI)
> 4 - I have even thought about building an app that opens a swing
> window that contains an embedded browser and jetty servlet running the
> app so that I can use Wicket.  Has anyone thought of or done this
> before?
>
> Basically, it's a CRUD application, but containing personal data that
> the user should not store on someone else's server.  I would use an
> embedded database that stores the data with encryption.
>
> Ideas?
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>   


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



Re: Long JPA-Transactions

2009-06-10 Thread Martin Sachs

Spring will give you all feature you need and will need in a year...

My Frameworks for my archetype: ;)
- Wicket
- Wicketstuff-jquery
- Spring
   - singleton-beans for all short-running transactions
   - session-beans with extended EntityManager for long running tx (
dont forget to commit the tx)
- Hades (Generic JPA helper)
- Quartz (Optional)
- java.mail (Optional)
- ActiveMQ (Optional)
   - asynch transactions
- Maven build

I use no IDE-Plugins or JPA plugins or ... just plain java IDE

Martin



nino martinez wael schrieb:
> thats obviously catch a whale, hehe..
>
> 2009/6/9 nino martinez wael :
>   
>> The focus these days are to simplify frameworks, for instance take
>> guice and warp persist. Really really simple to use and to setup.
>> Spring has a bit to learn about java configuration from these guys (I
>> last time I tried spring was in 2.5) however I've only tried guice
>> 1.0.
>>
>> If it takes 1 day to utilize a framework that can find a whale, it's
>> probably wort the effort. On the other hand if it requires 50% of the
>> project plan, it's probably not.
>>
>> pro's with guice are: plain java (no need for extra tools, just like
>> wicket), refactor safe, KISS, and works like I thought it would:)
>>
>> cons: a little more intrusive since configuration are in java,
>> although very simple to extend to property files or db (it's just
>> java)
>>
>> pros with spring: huge framework (you think of something, they
>> probably got it somewhere), less intrusive
>>
>> cons: xml based, huge framework..
>>
>> Anyhow both frameworks go nicely with mocking etc...
>>
>> my 2 cents.
>>
>>
>>
>> 2009/6/9 Martin Makundi :
>> 
 Ok, I think we can just agree to disagree, but will you do me a favor?
  When (not if) you encounter a situation like Martijn is talking
 about, will you post back to the list?
 
>>> I just believe in principle that hunting for some bug for 3 weeks is
>>> much less waste than dragging some toolkit along for 3 years, 6-man
>>> team, 100-man team, however big the more waste. Usually only few
>>> people hunt for the bug for 3 weeks.
>>>
>>> And it is true, it is important to know what to do yourself and what not to.
>>>
>>> **
>>> Martin
>>>
>>>   
 -
 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: how to cache the html output of a panel?

2009-05-22 Thread Martin Sachs

Hi, 

you can cache fragments of HTML (if it has no generated html-ids) with a
Behaviour. Look at XlstBehaviour. We have done it that way. But the
bottlenekk is always the Database, not the rendering of small components. By
the way, with such snipplet-caching you can improve the performance max 1,5
times. The fact is, if you can cache html which needs many db requests you
can save much time. 

Martin


Jeremy Thomerson-5 wrote:
> 
> If you've done profiling that shows where the Wicket markup generation
> is the slow part of your page rendering, we would benefit from seeing
> it so that we could see if there was anything that could be improved.
> 
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> 
> 
> On Thu, May 21, 2009 at 7:44 PM, ywtsang  wrote:
>>
>> we have tried the best to cache the "backing model" (or data)
>>
>> and we are always looking how to push our performance to a limit
>>
>> it seems we are hitting the limit now,
>> instead we go to refactor/revamp a lot,
>> we want to see if we can do anything on wicket such as caching the
>> generated
>> html that can help
>>
>>
>>
>> Jeremy Thomerson-5 wrote:
>>>
>>> This topic has been covered many times here on the list.  The result
>>> is that you almost never really need to cache the generated HTML, but
>>> rather the loading of the backing model.  Are you really sure that you
>>> need to cache the generated HTML?
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>>
>>>
>>> On Thu, May 21, 2009 at 5:30 AM, TSANG Yiu Wing 
>>> wrote:
 any hint that can help to apply caching on the html output of a panel?

 the panel is dynamic in nature, no ajax, i.e. stateless by itself, and
 is unique per url but needs some time to generate
 so i want to cache the html output of this panel

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


>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/how-to-cache-the-html-output-of-a-panel--tp23650923p23662724.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-cache-the-html-output-of-a-panel--tp23650923p2313.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket in Php

2009-05-21 Thread Martin Sachs

Hi,

wicket in php is a very cool idea. It occurred to me that we can start a
port the wicket to a php Framework. 

I dont know a php-Framework with features like wicket have.  Many frameworks
works more like struts IMHO. 

Maybe someone can help me, estimated the work of such porting of Wicket. 
  - Model Concept
  - plain HTML and plain PHP
  - Server-side state

This could be very useful because you can run php on a little vserver or you
can handle much more Users on one server. This safes a lot of money at the
end. Understand me correctly, i like JAVA and Wicket on Java-plattform, but
php is very interesting to push little apps on small servers. 


Any opinion to that ?

By the way, you can use the wicket include component to add php-pages to
wicket and from PHP you can use an iFrame or mount another page to the php
or write ajax-code which requests php-sites without statechange in wicket. 

Martin



Ajayi Yinka wrote:
> 
> Thanks
> 
> 
> May I get the description on how to do the integration. I may not mind the
> integration, provided it can handle my session for me (As in if a user log
> in through a wicket page, we can use this same log in instance to manage
> the
> wicket page).
> 
> 
> regards,
> yinka
> 
> On Wed, May 20, 2009 at 4:45 PM, Jeremy Thomerson
> > wrote:
> 
>> Wicket is written in Java.  You would need to build an application in
>> Java, running in a servlet container.  Perhaps you could do an
>> integration and have some pages running in PHP and some in Java, but
>> you are looking at a complex project.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>>
>> On Wed, May 20, 2009 at 10:39 AM, Ajayi Yinka
>>  wrote:
>> > Hi,
>> >
>> > Can anyone give me an insight on how I can integrate wicket into php
>> > project.
>> >
>> > I already have an application that is written in php.
>> >
>> > I will like to upgrade the application with some new features in which
>> I
>> > prefer to use  wicket.
>> >
>> > I am afraid if this is possible?
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-in-Php-tp23638080p23651082.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Closeing 1st Modal Window from 2nd Modal Window

2009-04-02 Thread Martin Sachs

Hi

i think you can just close the ModalWindow twice, because the
closing-Javascript close only the current Window, so if you call it twice
you close both windows. You must be sure, that there are 2 open windows !

Alternative: 
redirect to the page will close also all windows ;)

Martin


Warren Bell-2 wrote:
> 
> I have a situation that is like the Wicket example that opens two modal 
> windows one from another. Everything is working correctly, but I need to 
> close the 1st window when the 2nd window is closed. How would you do this?
> 
> Thanks,
> 
> Warren
> 

-- 
View this message in context: 
http://www.nabble.com/Closeing-1st-Modal-Window-from-2nd-Modal-Window-tp22861864p22862960.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Avoid serialization troubles with static members

2009-02-18 Thread Martin Sachs

Hi 

If we use @SpringBean we have automaticaly a serialized proxy object. Is it
possible to use a transient variable to avoid the serialization at all ?

public MyPanel extends Panel{
   @SpringBean(name="myserviceBean")
private transient MyServiceInterface service;
...
}


What do we need to inject the service after de-serialization ? We have the
ComponentInstantiationListener, maybe this would work also with transient ?




Martin
-- 
View this message in context: 
http://www.nabble.com/Avoid-serialization-troubles-with-static-members-tp22082899p22095373.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: What is your experience on the time of development ?

2008-12-12 Thread Martin Sachs

Your right !

Already I have developed three Wicket apps (12 month of work for a man), I
know how fast i can do thinks with wicket, but i need knowledge of e.g. JSF
to say wicket is THE FRAMEWORK for the next big site. Maybe with JSF all
things will be developed a lot faster, maybe not. Is other technologies also
Maintainable very well, in comparison to wicket ? That questions cant be
answered with looking at a "HelloWorld" application.

Every application has its own unique requirements on style, architecture, so
we cant reuse only very abstract components. That works fine with wicket. So
if we have a new project we develop the basics components for this project
(very fast).

Maybe you can estimate a factor of time (for development or maintaining) in
comparison with JSP, JSF, ... or whatever you know else.

regards
Martin



Antoine Angénieux wrote:
> 
> I would not count in how much you gain during your fist devs. with 
> Wicket (even though you STILL gain a lot of time), but how much dev time 
> you gain when reusing your existing Wicket components and how much time 
> you save when you need to maintain your apps ;)
> 
> Cheers,
> 
> Antoine.
> 
> 
> Martin Sachs wrote:
>> I'm looking for a little comparison of the development-time for
>> Applications
>> in Wicket against other Technologies. 
>> 
>> 
>> I think the development with Wicket is two times faster than Struts. But
>> what are your experiences on JSF, Rails/Grails, SpringMVC/SpringWebFlow.
>> 
>> Anyone you know the development-time from experience ?
>> 
>> 
>> (P.S.: The applications must use AJAX and many custom components or tags
>> in
>> JSP, not just a hello world sample)
> 
> -- 
> Antoine Angénieux
> Associé
> 
> Clinigrid
> 5, avenue Mozart
> 75016 Paris, France
> +336 60 21 09 18
> aangeni...@clinigrid.com
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/What-is-your-experience-on-the-time-of-development---tp20971605p20973394.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: [OT] wicket users around the world

2008-12-12 Thread Martin Sachs

Berlin, Germany



-- 
View this message in context: 
http://www.nabble.com/-OT--wicket-users-around-the-world-tp20962108p20971374.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: [OT] wicket users around the world

2008-12-12 Thread Martin Sachs
Berlin, Germany



francisco treacy schrieb:
> to know a little bit more of our great (and vast) community, i was
> just wondering if you're keen on sharing where you come from and/or
> where you work with wicket...
>
> for instance, here argentinian/belgian working with wicket in antibes, france
>
> francisco
>
> -
> 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: Create custom UrlCodingStrategy

2008-12-03 Thread Martin Sachs

Yes,

then you have two ways to do that 
   * implement your own RequestCycleProcessor
   * implement IRequestCodingStrategy and IRequestTargetMountsInfo or
subclass WebRequestCodingStrategy (you can look on
UrlCompressingWebCodingStrategy for a sample)

Thats the way...

Martin


Mathias P.W Nilsson wrote:
> 
> Problem is this
> 
> setResponsePage(new LoginPage(moreParam); 
> 
> will not generate an url like http://localhost/myapp/customer1/login.
> 

-- 
View this message in context: 
http://www.nabble.com/Create-custom-UrlCodingStrategy-tp20660813p20814841.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Create custom UrlCodingStrategy

2008-12-03 Thread Martin Sachs


ok simple DispatchingPage with Pageparameter

DispatchingPage(Pageparameter params){
   customerId = params.getIndexedParam(0);  // not real syntax
   action = params.getIndexedParam(1);  // not real syntax

   if(action.equals("login")){
   PageParameter moreParam =  new PageParameter();
   moreParam.add("customerId", customerId);
   setResponsePage(new LoginPage(moreParam);

   }else if ()

}
 
(not compiled code)

Simple Dispatcher without overrides of Wicket-Core Components
(URLCodingStrategy, RequestCycleProcessor)! 

If you want it more complex and transparent use your own implementation of
AbstractRequestCycleProcessor (look at UrlCompressingWebRequestProcessor, or
from  http://code.google.com/p/brix-cms/ Brix   BrixRequestCycleProcessor

With Wicket you can easy customize all to your needs! 

I mean "easy" because you just implement some interface and replace the
default wicket beheaviour by your own. No special feature of wicket, its
just Java, or ?



Martin


Mathias P.W Nilsson wrote:
> 
> Also you must handle the second parameter /login maybe by switching
> different panels or redirect to another page ! 
> 
> How should this be done? I must keep the customer/customerId in every
> page. What happens when redirecting?
> 

-- 
View this message in context: 
http://www.nabble.com/Create-custom-UrlCodingStrategy-tp20660813p20814227.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Create custom UrlCodingStrategy

2008-12-03 Thread Martin Sachs

hi,

i have only a simple idea.

implement a UrlcodingStrategy like IndexedParamUrlCodingStrategy, where the
words after first / are parameter. if you use this e.g. 

mount(new CustomerParamUrlCodingStrategie("/customers",...)); you would able
to get the customerID as PageParameter like from the
IndexedParamUrlCodingStrategy.

result should be that url: /customers// e.g. 
/customers/mycustomer1/login 

Also you must handle the second parameter /login maybe by switching
different panels or redirect to another page !

is that what you want ?


Martin



Mathias P.W Nilsson wrote:
> 
> Is there no solution to this?
> 
> this is my app ( http://localhost/myapp ). All I want is to be able to
> have a customer name after myapp that follows in the application.
> 

-- 
View this message in context: 
http://www.nabble.com/Create-custom-UrlCodingStrategy-tp20660813p20813165.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Display two modal windows in one request

2008-11-24 Thread Martin Sachs

Hi,

we have had the same issue. We are solving this Problem with a little
workaround in the Wicket-Source. 

We also created a ticket with our solution for this problem. 

https://issues.apache.org/jira/browse/WICKET-1771

The problem was, that the close would be excecuted in Javascript with a
timeout and the create doent do the timeout. So if you close and create a
modalwindow you would ever create and close the window. 

Martin S.



Newgro wrote:
> 
> Hi *,
> 
> i'm facing a problem i couldn't solve until now. Our base page contain an
> modal error window which is used to present the occurred error.
> 
> Now i added a password request modal window on a page. If an error
> occurred after clicking the request button i would like to display the
> error window over the request window. If i click the close button on error
> window this should disappear but the request window should stay.
> 
> But the error window disappears immidiatly (< 1sec). The request window
> stays. After i clicked the request button again the request window gets
> closed.
> 
> Is there a solution for that issue? I've tried the example (multiple
> windows) but there are used pages and cookies for displaying (it seems to
> be to heavy for me).
> 
> thanks 4 help
> Per
> 

-- 
View this message in context: 
http://www.nabble.com/Display-two-modal-windows-in-one-request-tp20600479p20661354.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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