Re: IDE / Server Support

2011-03-24 Thread James Carman
Most of us run our app servers locally in debug mode.  Also, you
should check out JRebel.

On Fri, Mar 25, 2011 at 12:23 AM,   wrote:
> Hi,
>
> How do you get fast deployment in development with large Wicket EJB
> applications?
>
> Wicket pages are ordinary class files that do not always seem to have
> special redeployment support like JSP files or HTML files.
>
> I have an EJB 3.1 app deployed on GlassFish 3.1. Web pages in the web
> directory deploy automatically in milliseconds, but whenever I save a
> Java class file, deploy on save deploys the whole application.
>
> This is not a big deal with hello world apps, but it hurts badly
> otherwise. As an example I tried the Wicket example application with
> hundreds of class files which takes more than half a minute to deploy
> on fast computers, and during that time, the IDE freezes.
>
> I thought that a decent servlet container should be able to detect
> single class file changes and hot-deploy them individually. But I
> might be wrong. The NetBeans folks think otherwise and refer me to the
> GlassFish server docs.
>
> I don't care so much about their view because what matters to me is
> the fact that - say a PHP developer - just saves his files and hits
> the reload button, and that is what I try to get, too. Otherwise I
> feel I am fighting an uphill battle.
>
> Any thoughts are appreciated.
>
> Bernard
>
> -
> 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



IDE / Server Support

2011-03-24 Thread bht
Hi,

How do you get fast deployment in development with large Wicket EJB
applications?

Wicket pages are ordinary class files that do not always seem to have
special redeployment support like JSP files or HTML files.

I have an EJB 3.1 app deployed on GlassFish 3.1. Web pages in the web
directory deploy automatically in milliseconds, but whenever I save a
Java class file, deploy on save deploys the whole application.

This is not a big deal with hello world apps, but it hurts badly
otherwise. As an example I tried the Wicket example application with
hundreds of class files which takes more than half a minute to deploy
on fast computers, and during that time, the IDE freezes.

I thought that a decent servlet container should be able to detect
single class file changes and hot-deploy them individually. But I
might be wrong. The NetBeans folks think otherwise and refer me to the
GlassFish server docs.

I don't care so much about their view because what matters to me is
the fact that - say a PHP developer - just saves his files and hits
the reload button, and that is what I try to get, too. Otherwise I
feel I am fighting an uphill battle.

Any thoughts are appreciated.

Bernard

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



Calendar bug on IE8 (also occurred on IE6 7 IE7)

2011-03-24 Thread Coleman, Chris
IE seems to have a problem when executing the following line when bringing up a 
form within a modal dialog that contains a DateTimeField. Does anyone know why 
this line would cause such an error and if there is a simple work around. 
Apparently it works if the Form wraps the ModalWindow but not the way we have 
it where the form is inside the Modal content but change that architecture is a 
problem for us now.

   /**
   * Renders the calendar after it has been configured. The render() method 
has a specific call chain that will execute
   * when the method is called: renderHeader, renderBody, renderFooter.
   * Refer to the documentation for those methods for information on
   * individual render tasks.
   * @method render
   */
   render : function() {
  this.beforeRenderEvent.fire();

  // Find starting day of the current month
  var workingDate = 
DateMath.findMonthStart(this.cfg.getProperty(DEF_CFG.PAGEDATE.key));

  this.resetRenderers();
  this.cellDates.length = 0;

  Event.purgeElement(this.oDomContainer, true);

  var html = [];

  html[html.length] = '';
  html = this.renderHeader(html);
  html = this.renderBody(workingDate, html);
  html = this.renderFooter(html);
  html[html.length] = '';

> this.oDomContainer.innerHTML = html.join("\n");  <   gives 
calendar.js.line 3225 Unknown Error

  this.applyListeners();
  this.cells = this.oDomContainer.getElementsByTagName("td");

  this.cfg.refireEvent(DEF_CFG.TITLE.key);
  this.cfg.refireEvent(DEF_CFG.CLOSE.key);
  this.cfg.refireEvent(DEF_CFG.IFRAME.key);

  this.renderEvent.fire();
   },



DISCLAIMER:---
This e-mail transmission and any documents, files and previous e-mail messages
attached to it are private and confidential. They may contain proprietary or 
copyright
material or information that is subject to legal professional privilege. They 
are for
the use of the intended recipient only.  Any unauthorised viewing, use, 
disclosure,
copying, alteration, storage or distribution of, or reliance on, this message is
strictly prohibited. No part may be reproduced, adapted or transmitted without 
the
written permission of the owner. If you have received this transmission in 
error, or
are not an authorised recipient, please immediately notify the sender by return 
email,
delete this message and all copies from your e-mail system, and destroy any 
printed
copies. Receipt by anyone other than the intended recipient should not be 
deemed a
waiver of any privilege or protection. Thales Australia does not warrant or 
represent
that this e-mail or any documents, files and previous e-mail messages attached 
are
error or virus free.
--



Navigation and Adding Panels dynamically.

2011-03-24 Thread Mansour Al Akeel
I do have the need to implement different screens. Each screen is a
Panel that will be displayed when requested from the screens menu.

The screen menu should display the items depending on the functionality
the user has access to. 

Can some one point me to an article or a tutorial with similar
requirements ? 

I trully appreciate any help.




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



Re: Authorization using JAAS and getting the Principal.

2011-03-24 Thread Mansour Al Akeel
Thank you.
Will try that.

On Thu Mar 24,2011 08:08 pm, Mansour Al Akeel wrote:
> On Tue Mar 22,2011 10:15 pm, Zilvinas Vilutis wrote:
> > https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.html#SpringSecurityandWicket-auth-roles-Wicketsetup
> > and call SecureSession.get().getUser()
> > 
> > ??ilvinas Vilutis
> > 
> > Mobile: (+370) 652 38353
> > E-mail: cika...@gmail.com
> > 
> > 
> > 
> > On Tue, Mar 22, 2011 at 6:13 PM, Mansour Al Akeel
> >  wrote:
> > > Woops forgot to include the way I am getting the request.
> > >
> > > private User getLoggedInUser() {
> > > ?? ??ServletWebRequest servletWebRequest = (ServletWebRequest) 
> > > RequestCycle .get().getRequest();
> > > ?? ??HttpServletRequest request = servletWebRequest.getContainerRequest();
> > > ?? ??Principal principal = request.getUserPrincipal();
> > > ?? ??User user = (User) principal;
> > > ?? ??return user;
> > > }
> > >
> > > I appreciate your help.
> > >
> > >
> > > On Tue Mar 22,2011 08:42 pm, Mansour Al Akeel wrote:
> > >> Hello all,
> > >>
> > >> I am authenticating a user, and it's working fine through our own Jaas
> > >> module implementation. However, I am trying to get one of the Panels to
> > >> display based on the logged in user. I am not using wicket-aut yet, and
> > >> looking to do this by obtaining the Principal implementaton from the
> > >> HttpServletRequest. I am getting null when I do so.
> > >>
> > >> I am trying to avoid diving into wicket specific implementation related
> > >> to auth because I am a bit on a tight dead line.
> > >>
> > >> How would others deal with this issue?
> > >> If you have a component to be displayed depending on the logged in user,
> > >> how can I get the logged in user ?
> > >>
> > >>
> > >> Thank you in advance.
> > >>
> > >
> > > -
> > > 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: Authorization using JAAS and getting the Principal.

2011-03-24 Thread Mansour Al Akeel
On Tue Mar 22,2011 10:15 pm, Zilvinas Vilutis wrote:
> https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.html#SpringSecurityandWicket-auth-roles-Wicketsetup
> and call SecureSession.get().getUser()
> 
> ??ilvinas Vilutis
> 
> Mobile: (+370) 652 38353
> E-mail: cika...@gmail.com
> 
> 
> 
> On Tue, Mar 22, 2011 at 6:13 PM, Mansour Al Akeel
>  wrote:
> > Woops forgot to include the way I am getting the request.
> >
> > private User getLoggedInUser() {
> > ?? ??ServletWebRequest servletWebRequest = (ServletWebRequest) RequestCycle 
> > .get().getRequest();
> > ?? ??HttpServletRequest request = servletWebRequest.getContainerRequest();
> > ?? ??Principal principal = request.getUserPrincipal();
> > ?? ??User user = (User) principal;
> > ?? ??return user;
> > }
> >
> > I appreciate your help.
> >
> >
> > On Tue Mar 22,2011 08:42 pm, Mansour Al Akeel wrote:
> >> Hello all,
> >>
> >> I am authenticating a user, and it's working fine through our own Jaas
> >> module implementation. However, I am trying to get one of the Panels to
> >> display based on the logged in user. I am not using wicket-aut yet, and
> >> looking to do this by obtaining the Principal implementaton from the
> >> HttpServletRequest. I am getting null when I do so.
> >>
> >> I am trying to avoid diving into wicket specific implementation related
> >> to auth because I am a bit on a tight dead line.
> >>
> >> How would others deal with this issue?
> >> If you have a component to be displayed depending on the logged in user,
> >> how can I get the logged in user ?
> >>
> >>
> >> Thank you in advance.
> >>
> >
> > -
> > 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 artifacts naming strategy

2011-03-24 Thread Bruno Borges
After 10 minutes I realized that having these two jars was not the problem
of some bug on my project...

- jasperreports-1.4.16.jar
- jasperreports-3.7.2.jar

The first one is from WicketStuff, but still, it is confusing to see this.

Should we configure the POM files to export the jar with a 'wicketstuff-'
preffix on all modules?

Cheers,

Bruno Borges
www.brunoborges.com.br
+55 21 76727099

"The glory of great men should always be
measured by the means they have used to
acquire it."
 - Francois de La Rochefoucauld


Best way to periodically refresh an inmethod DataGrid?

2011-03-24 Thread Coleman, Chris
We've got a wicket app with an inmethod DataGrid and it displays fine and we 
use an AjaxSelfUpdatingTimerBehaviour to update the grid every 5 seconds. That 
part works fine - as data changes in the database the changes are reflected in 
the table in the browser

However, if we select an item the selection dissappears when the very next 
refresh occurs. How do we refresh the DataGrid in such a way that it remembers 
its selected item after a refresh?



DISCLAIMER:---
This e-mail transmission and any documents, files and previous e-mail messages
attached to it are private and confidential. They may contain proprietary or 
copyright
material or information that is subject to legal professional privilege. They 
are for
the use of the intended recipient only.  Any unauthorised viewing, use, 
disclosure,
copying, alteration, storage or distribution of, or reliance on, this message is
strictly prohibited. No part may be reproduced, adapted or transmitted without 
the
written permission of the owner. If you have received this transmission in 
error, or
are not an authorised recipient, please immediately notify the sender by return 
email,
delete this message and all copies from your e-mail system, and destroy any 
printed
copies. Receipt by anyone other than the intended recipient should not be 
deemed a
waiver of any privilege or protection. Thales Australia does not warrant or 
represent
that this e-mail or any documents, files and previous e-mail messages attached 
are
error or virus free.
--



Re: Call urlFor(Class, PageParams) outside of request cycle

2011-03-24 Thread Alec Swan
Thanks. I ended up constructing the URL manually as you suggested.

On Mon, Mar 21, 2011 at 1:29 AM, Wilhelmsen Tor Iver  wrote:
>> We have a Quartz thread which periodically sends emails with a link to
>> a Wicket page. Calling RequestCycle.get().urlFor(Class,
>> PageParameters) doesn't work because the thread is not a part of
>> Wicket request cycle. Is there a way to ask Wicket to generate the URL
>> in this case?
>
> What you really want is to use a bookmarkable page mounted in the 
> application, and create a URL string with the necessary parameters in the 
> Quartz job.
>
> Or create a simple Wicket servlet that generates it for you, which you then 
> call from the job using e.g. a standard URLConnection.
>
> - Tor Iver
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: [wicket 1.5rc2] How to enable RequestLogger?

2011-03-24 Thread Martin Grigorov
Found the bug.
Will be in RC3

On Thu, Mar 24, 2011 at 9:31 PM, Igor Vaynberg wrote:

> probably an oversight of all the refactory. jira issue please.
>
> -igor
>
>
> On Thu, Mar 24, 2011 at 12:48 PM, Jens Zastrow 
> wrote:
> > Enabling with getRequestLoggerSettings().setRequestLoggerEnabled(true)
> > doesnt show any requests.
> >
> > Seems that the Application.logEventTarget and
> Application.logResponseTarget
> > are never invoked at all from the wicket-core,
> > nevertheless the get overridden in WebApplication???
> >
> > Any hints?
> >
> > -
> > 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
>
>


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


Re: [wicket 1.5rc2] How to enable RequestLogger?

2011-03-24 Thread Igor Vaynberg
probably an oversight of all the refactory. jira issue please.

-igor


On Thu, Mar 24, 2011 at 12:48 PM, Jens Zastrow  wrote:
> Enabling with getRequestLoggerSettings().setRequestLoggerEnabled(true)
> doesnt show any requests.
>
> Seems that the Application.logEventTarget and Application.logResponseTarget
> are never invoked at all from the wicket-core,
> nevertheless the get overridden in WebApplication???
>
> Any hints?
>
> -
> 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 1.5rc2] How to enable RequestLogger?

2011-03-24 Thread Martin Grigorov
Put a breakpoint at org.apache.wicket.Application.getRequestLogger() and see
what happens


On Thu, Mar 24, 2011 at 8:48 PM, Jens Zastrow  wrote:

> Enabling with getRequestLoggerSettings().setRequestLoggerEnabled(true)
> doesnt show any requests.
>
> Seems that the Application.logEventTarget and Application.logResponseTarget
> are never invoked at all from the wicket-core,
> nevertheless the get overridden in WebApplication???
>
> Any hints?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


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


Re: Validation messages for required fields using form id

2011-03-24 Thread Martin Grigorov
On Thu, Mar 24, 2011 at 9:01 PM, mwilber  wrote:

> Would it be true that the entire form id from the page level down is
> needed?
>
> tabs.panel. for instance? That seems to work.
>
> All of them should work.
More specific ones have bigger priority.


>  --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Validation-messages-for-required-fields-using-form-id-tp3403212p3403612.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


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


Re: Validation messages for required fields using form id

2011-03-24 Thread mwilber
Would it be true that the entire form id from the page level down is needed?

tabs.panel. for instance? That seems to work.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validation-messages-for-required-fields-using-form-id-tp3403212p3403612.html
Sent from the Users forum mailing list archive at Nabble.com.

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



[wicket 1.5rc2] How to enable RequestLogger?

2011-03-24 Thread Jens Zastrow
Enabling with getRequestLoggerSettings().setRequestLoggerEnabled(true) 
doesnt show any requests.


Seems that the Application.logEventTarget and 
Application.logResponseTarget are never invoked at all from the 
wicket-core,

nevertheless the get overridden in WebApplication???

Any hints?

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



Validation messages for required fields using form id

2011-03-24 Thread mwilber
So I had a need to inject a custom validation message for a required text
component when the field value is not present. No problem I said, looking at
some wiki pages and other online content, I found that it should be easily
added as any other i18n property:

..Required=My custom message.

However, debugging through the only keys the MessageSource seems to go
through are:
.Required
Required

So, debugging through I see that the MessageSource inner class of
FormComponent works by allowing the FormComponent to inject a prefix to the
key, which would then look for the following keys:
..Required
.Required
Required

So is the form Id no longer used?

Digging further I can see that the default implementation in FormComponent
to get a prefix is to ask the form for a validation prefix, which by turn
returns null. So even if I override this method in the Form to return the
form id, it's still only going to look through:
..Required
.Required
Required

So did the original property name I saw online ever work?
..Required=My custom message.

I'm on 1.4.2 (old I know), but nothing appears to have change in this arena
on 1.4.16 either.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validation-messages-for-required-fields-using-form-id-tp3403212p3403212.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: how to direct from servlet to login page and then back to servlet?

2011-03-24 Thread Zilvinas Vilutis
You can use spring security for filtering the URL patterns...

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com



On Thu, Mar 24, 2011 at 9:37 AM, Sam Zilverberg  wrote:
> This works but the url doesn't change in the browser to /reports/?id=1, it
> stays as login/destination=...
>
> I'm thinking of reimplementing this as a wicket page with page params.
> any other thought on how to implement this kind of functionality with
> servlet/wicket login page?
>

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



Re: how to direct from servlet to login page and then back to servlet?

2011-03-24 Thread Sam Zilverberg
This works but the url doesn't change in the browser to /reports/?id=1, it
stays as login/destination=...

I'm thinking of reimplementing this as a wicket page with page params.
any other thought on how to implement this kind of functionality with
servlet/wicket login page?


Re: how to direct from servlet to login page and then back to servlet?

2011-03-24 Thread Martin Grigorov
Try with "throw new RedirectToUrlException(destination)" instead of setting
new RequestTarget

On Thu, Mar 24, 2011 at 4:25 PM, Sam Zilverberg wrote:

> I've got a servlet that serves files.
> It's mounted on /files/* and has a WicketSessionFilter on that same path so
> it has access to the wicket session.
>
> When a user accesses /files/?id=1 the servlet checks that the wicket
> session
> exists, that the user is logged in and some other logic then serves the
> file
> to the user.
> When a user is not logged in, and say comes to this url from a link in an
> email, I'd like the servlet to send him to the login page, then after
> providing credentials I'd like to return to the original url so the file
> will be served.
>
> What is the best way to accomplish this?
>
> So far I tried to redirect like this:
> servlet:
> response.redirect(contextPath + "/login?destination=files/?id=" + id)
> login page after login success:
> if (destination != null)   getRequestCycle().setRequestTarget(new
> RedirectRequestTarget(destination));
> but this failed because the request was redirected twice and it is not
> allowed.
>
> I also tried to forward the request but failed.
>
> Any help would be appreciated!
>



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


how to direct from servlet to login page and then back to servlet?

2011-03-24 Thread Sam Zilverberg
I've got a servlet that serves files.
It's mounted on /files/* and has a WicketSessionFilter on that same path so
it has access to the wicket session.

When a user accesses /files/?id=1 the servlet checks that the wicket session
exists, that the user is logged in and some other logic then serves the file
to the user.
When a user is not logged in, and say comes to this url from a link in an
email, I'd like the servlet to send him to the login page, then after
providing credentials I'd like to return to the original url so the file
will be served.

What is the best way to accomplish this?

So far I tried to redirect like this:
servlet:
response.redirect(contextPath + "/login?destination=files/?id=" + id)
login page after login success:
if (destination != null)   getRequestCycle().setRequestTarget(new
RedirectRequestTarget(destination));
but this failed because the request was redirected twice and it is not
allowed.

I also tried to forward the request but failed.

Any help would be appreciated!


Re: dynamic navigation/side content depending on login status

2011-03-24 Thread hrbaer
Ok, I modified my application so there is only one xxxApplication file. And
as already assumed now it is working. 

Because I'm still playing around with this framework it's not really a pain
for me. I will refactor my application and that's it.

But there are still two open question I have in mind:
1.) Is there any solution for this issue (authentication) if there is more
than one xxxApplication file in place?
2.) Is it "state of the art" to have only one xxxApplication file within a
war? What are the disadvantages/advantegs to have one/multiple
xxxApplication files in place?

Thanks in advance and sorry for the bulk of mails.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3402788.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Nested Forms and Multipart Fileupload Issue

2011-03-24 Thread Alexander Morozov
https://issues.apache.org/jira/browse/WICKET-3555

Thanks


Martin Grigorov-4 wrote:
> 
> Create a ticket please.
> And attach the quickstart.
> 
> On Wed, Mar 23, 2011 at 12:19 PM, Stijn Maller
> wrote:
> 
> > Alexander,
> >
> > I'm facing the same issue and I'm convinced it is a bug.
> >
> > When a FileUploadField in a nested form causes an error, then:
> >
> >   - The ErrorMessage is registered on the outer form (instead of the
> inner
> >   form)
> >   - The outer form's onError method is called (instead of that of the
> inner
> >   form)
> >   - The outer form is considered not valid
> >
> > This goes against https://cwiki.apache.org/WICKET/nested-forms.html
> and
> > it's
> > also the opposite of what happens when the FileUploadField is
> submitted
> > without error. (Only the inner form's onSubmit is called)
> >
> > As a sidenote, I also find it a bit strange that:
> > 1) the FileUploadField itself is considered valid and the error
> message is
> > not registered to this component.
> > 2) the onSubmit method of the AjaxButton is called instead of the
> onError
> > method.
> >
> > Sorry, but I have not found a workaround yet.
> >
> > Kind regards,
> > Stijn
> >
> >
> > On 17 January 2011 17:59, Alexander Morozov
> > wrote:
> >
> > >
> > > Hi,
> > >
> > > I have faced with another problem, related to nested forms and
> > > FileUploadField (wicket-1.4.15).
> > > The nested form have FileUploadField instance and defined
> > setMaxSize(100K).
> > > In case of submitting thru Ajax file more than 100K, hasError()
> on the
> > > nested form return false. But I expect here 'true' - because of
> > setMaxSize
> > > constraint violation. Is this expected behavior ?
> > >
> > > Quickstart is attached.
> > >
> >
> http://apache-wicket.1842946.n4.nabble.com/file/n3221235/modalproject2.zip
> > > modalproject2.zip
> > >
> > > Thanks
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3221235.html
> > > Sent from the Users forum mailing list archive at Nabble.com.
> > >
> > >
> -
> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > For additional commands, e-mail: users-h...@wicket.apache.org
> > >
> > >
> >
> 
> 
> 
> -- 
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com ;
> 


-
--
http://www.linkedin.com/in/amorozov
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3402637.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps

2011-03-24 Thread Martin Grigorov
On Thu, Mar 24, 2011 at 2:19 PM, Peter Ertl  wrote:

> looks like a refactoring-nightmare ...
>
> Can you be more specific ?

I even see it easier to manage.
With wro.xml you have all resources specified in one place but in different
groupd.
With default Wicket approach you have a ResRef in every .java file that
needs them.
By refactoring I guess you mean renaming the .java class name or even moving
the class in different package. The IDE wont help you
here - it wont move the .css together with the .java, so you'll need to
either touch the path in the ResRef or move the resource after the
refactoring.

Or I didn't understand you ?


> Am 24.03.2011 um 12:23 schrieb Martin Grigorov:
>
> > On Thu, Mar 24, 2011 at 12:13 PM, Martijn Dashorst <
> > martijn.dasho...@gmail.com> wrote:
> >
> >> On Thu, Mar 24, 2011 at 12:02 PM, James Carman
> >>  wrote:
> >>> Yes, but you would have to change how you refer to them, right?
> >>
> >> Not sure how that would work out, haven't tried it. Isn't this also a
> >> tomcat specific optimization as well?
> >>
> > It is by Servlet 3.0 specification.
> >
> > My recent research shows that Wicket+Wro4j is the best approach.
> >
> > wro.xml:
> > 
> >/css/context.css
> >classpath:/com/mycompany/components/Component1.css
> >classpath:/com/mycompany/components/Component2.css
> >classpath:/com/mycompany/components/Component3.css
> > 
> >
> > Don't use ResourceReference but just put
> > 
> >
> > in the page that uses these components.
> >
> >
> >
> >
> >> Martijn
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Martin Grigorov
> > jWeekend
> > Training, Consulting, Development
> > http://jWeekend.com 
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


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


Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps

2011-03-24 Thread Peter Ertl
looks like a refactoring-nightmare ...

Am 24.03.2011 um 12:23 schrieb Martin Grigorov:

> On Thu, Mar 24, 2011 at 12:13 PM, Martijn Dashorst <
> martijn.dasho...@gmail.com> wrote:
> 
>> On Thu, Mar 24, 2011 at 12:02 PM, James Carman
>>  wrote:
>>> Yes, but you would have to change how you refer to them, right?
>> 
>> Not sure how that would work out, haven't tried it. Isn't this also a
>> tomcat specific optimization as well?
>> 
> It is by Servlet 3.0 specification.
> 
> My recent research shows that Wicket+Wro4j is the best approach.
> 
> wro.xml:
> 
>/css/context.css
>classpath:/com/mycompany/components/Component1.css
>classpath:/com/mycompany/components/Component2.css
>classpath:/com/mycompany/components/Component3.css
> 
> 
> Don't use ResourceReference but just put
> 
> 
> in the page that uses these components.
> 
> 
> 
> 
>> Martijn
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
> 
> 
> -- 
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 


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



Re: dynamic navigation/side content depending on login status

2011-03-24 Thread hrbaer
Maybe I missed one interesting detail.

While searching the web for some examples/explanaitions for my problem I
found a few threads where the author of the thread had to explain why he
uses multiple xxxApplication files. For some reasons a lot of users are of
the opinion that you should only use one xxxApplication file for your war.

In my case I use for each (navigation)link on my page a separat servlet
mapping within the web.xml.
So if a user call's a link which should appear on page A there is a separat
mapping for /a/*, the same for page B and so on.

Is this in general a bad approach? 
Could this explain my problems with authentication?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3402431.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps

2011-03-24 Thread Martin Grigorov
On Thu, Mar 24, 2011 at 12:13 PM, Martijn Dashorst <
martijn.dasho...@gmail.com> wrote:

> On Thu, Mar 24, 2011 at 12:02 PM, James Carman
>  wrote:
> > Yes, but you would have to change how you refer to them, right?
>
> Not sure how that would work out, haven't tried it. Isn't this also a
> tomcat specific optimization as well?
>
It is by Servlet 3.0 specification.

My recent research shows that Wicket+Wro4j is the best approach.

wro.xml:
 
/css/context.css
classpath:/com/mycompany/components/Component1.css
classpath:/com/mycompany/components/Component2.css
classpath:/com/mycompany/components/Component3.css
 

Don't use ResourceReference but just put


in the page that uses these components.




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


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


Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps

2011-03-24 Thread Martijn Dashorst
On Thu, Mar 24, 2011 at 12:02 PM, James Carman
 wrote:
> Yes, but you would have to change how you refer to them, right?

Not sure how that would work out, haven't tried it. Isn't this also a
tomcat specific optimization as well?

Martijn

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



Re: dynamic navigation/side content depending on login status

2011-03-24 Thread hrbaer
Hi,

thanks for your feedback, Isammoc and Zilvinas.

But I don't get your point. In fact I would assume I already did everything
like the example you provided but still I get a login page even if the user
already authenticated successfully before.

@ Isammoc: You told me that I don't have to create two xxxApplication files
that extend WebApplication.
But if there a two separat pages that both would need authentication first
how can I ensure that this login will take place if I configure only one
xxxApplication which extends AthenticatedWebApplication with the relevant
methods getWebSessionClass() and getSignInPageClass()?

This is my code:
-
MyAuthenticatedWebSession
public class MyAuthenticatedWebSession extends AuthenticatedWebSession {

public MyAuthenticatedWebSession( Request request ) {
super(request);
}

@Override
public boolean authenticate( final String username, final String
password ) {

PersistenceManager pm = PMF.getPersistenceManager();
List listUser = new ArrayList();

try {

 Query query = pm.newQuery( User.class, "password == 
\""+
password +"\" && username == "+ username );
listUser = (List) query.execute();

return listUser.isEmpty()? false : true;

} 
catch( Exception e ){
info( "Es ist ein technischer Fehler aufgetreten...bitte
versuchen Sie es später noch einmal." );
}
finally {
pm.close();
}

return false;

}

@Override
public Roles getRoles() {
return isSignedIn() ? new Roles( Roles.ADMIN ) : null;
}
}

Page A (A_Application.java)
public class A_Application extends AuthenticatedWebApplication {

public A_Application() {}

@Override
public Class< ? extends Page> getHomePage() {
return Uebersicht.class;
}

@Override
protected Class getWebSessionClass()
{
return MyAuthenticatedWebSession.class;
}

@Override
protected Class getSignInPageClass() {
return Login.class;
}

@Override
protected void init() {
super.init();
getResourceSettings().setResourcePollFrequency(null); 
}

}

corresponding class to page A 
@AuthorizeInstantiation("ADMIN")
public class Uebersicht extends WebPage {
  ...
}


Page B (B_Application.java)
public class B_Application extends AuthenticatedWebApplication {

public B_Application() {}

@Override
public Class< ? extends Page> getHomePage() {
return Fragen.class;
}

@Override
protected Class getWebSessionClass()
{
return MyAuthenticatedWebSession.class;
}

@Override
protected Class getSignInPageClass() {
return Login.class;
}

protected void init() {
super.init();
getResourceSettings().setResourcePollFrequency(null);  
}

}

corresponding class to page B 
@AuthorizeInstantiation("ADMIN")
public class Frage extends WebPage {
  ...
}
-

At the moment if I click on a link which call's page A I get redirected to
my login page. After a successfully login I get redirected to my markup of
page A. If I click again on the link no login is necessary. But there is the
exact same scenario if I click on a link which call's page B - even if I
already logged in successfully.

How can I achieve that a user don't need to authenticate for each page which
requires authentication? I would like to share these information over all
pages once a user is already logged in successfully.

I think I still need some assistance :(

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3402193.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps

2011-03-24 Thread James Carman
Yes, but you would have to change how you refer to them, right?

On Thu, Mar 24, 2011 at 6:33 AM, Martijn Dashorst
 wrote:
> For development you can keep the resources in the usual, wicket
> preferred location (next to the class files), and when you package
> your jars you can instruct your build tool to move them to
> META-INF/resources
>
> Best of both worlds :)
>
> Martijn
>
> On Thu, Mar 24, 2011 at 7:17 AM, Attila Király
>  wrote:
>> 2011/3/24 hok 
>>>
>>> 2. In the Servlet 3.0 specification it's possible to have static resources
>>> under META-INF/resources and I noticed that wicket has
>>> MetaInfStaticResourceReference, which is better for serving static
>>> resources. In my case for some components I have css files which are loaded
>>> like:
>>>
>>>        response.renderCSSReference(new PackageResourceReference(getClass(),
>>> getClass().getSimpleName() + ".css"));
>>>
>>> So, it should be better to move all those css files under
>>> META-INF/resources. However, this somehow contradicts with the wicket
>>> philosophy of having everything in one place and requires maintaining a
>>> parallel package folder structure under META-INF/resources. Do you think
>>> it's worth it?
>>>
>>
>> Hi,
>>
>> In my tests I found that Tomcat 7 serves static files from
>> META-INF/resources directory 2-3 times faster than wicket. So if performance
>> is important I think it is worth it. I am pragmatic about it: maybe it is
>> bad to not hold everything in the same directory but this is a feature that
>> fits wicket pretty well (bundling static files in jars) so it would be worse
>> to not use it.
>>
>> Attila
>>
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps

2011-03-24 Thread Martijn Dashorst
For development you can keep the resources in the usual, wicket
preferred location (next to the class files), and when you package
your jars you can instruct your build tool to move them to
META-INF/resources

Best of both worlds :)

Martijn

On Thu, Mar 24, 2011 at 7:17 AM, Attila Király
 wrote:
> 2011/3/24 hok 
>>
>> 2. In the Servlet 3.0 specification it's possible to have static resources
>> under META-INF/resources and I noticed that wicket has
>> MetaInfStaticResourceReference, which is better for serving static
>> resources. In my case for some components I have css files which are loaded
>> like:
>>
>>        response.renderCSSReference(new PackageResourceReference(getClass(),
>> getClass().getSimpleName() + ".css"));
>>
>> So, it should be better to move all those css files under
>> META-INF/resources. However, this somehow contradicts with the wicket
>> philosophy of having everything in one place and requires maintaining a
>> parallel package folder structure under META-INF/resources. Do you think
>> it's worth it?
>>
>
> Hi,
>
> In my tests I found that Tomcat 7 serves static files from
> META-INF/resources directory 2-3 times faster than wicket. So if performance
> is important I think it is worth it. I am pragmatic about it: maybe it is
> bad to not hold everything in the same directory but this is a feature that
> fits wicket pretty well (bundling static files in jars) so it would be worse
> to not use it.
>
> Attila
>



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

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



Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps

2011-03-24 Thread Attila Király
2011/3/24 Martin Grigorov 

> Hi,
>
> On Thu, Mar 24, 2011 at 7:17 AM, Attila Király  >wrote:
>
> > 2011/3/24 hok 
> > >
> > > 2. In the Servlet 3.0 specification it's possible to have static
> > resources
> > > under META-INF/resources and I noticed that wicket has
> > > MetaInfStaticResourceReference, which is better for serving static
> > > resources. In my case for some components I have css files which are
> > loaded
> > > like:
> > >
> > >response.renderCSSReference(new
> > PackageResourceReference(getClass(),
> > > getClass().getSimpleName() + ".css"));
> > >
> > > So, it should be better to move all those css files under
> > > META-INF/resources. However, this somehow contradicts with the wicket
> > > philosophy of having everything in one place and requires maintaining a
> > > parallel package folder structure under META-INF/resources. Do you
> think
> > > it's worth it?
> > >
> >
> > Hi,
> >
> > In my tests I found that Tomcat 7 serves static files from
> > META-INF/resources directory 2-3 times faster than wicket. So if
> > performance
> > is important I think it is worth it. I am pragmatic about it: maybe it is
> > bad to not hold everything in the same directory but this is a feature
> that
> > fits wicket pretty well (bundling static files in jars) so it would be
> > worse
> > to not use it.
> >
> > Attila
> >
> With the new CachingResourceStreamLocator the serving should be faster now.
> See https://issues.apache.org/jira/browse/WICKET-3511.
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 
>

Hi,

I made a new test (serving a png and a js) with current trunk and the gap is
much smaller now: tomcat is 25% faster on average.

Attila


Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps

2011-03-24 Thread Peter Ertl
You can attach a front-end proxy like nginx or apache that caches resources 
delivered by your wicket application so subsequent requests will be served from 
the proxy cache with maximum speed.


Am 24.03.2011 um 09:01 schrieb Martin Grigorov:

> Hi,
> 
> On Thu, Mar 24, 2011 at 7:17 AM, Attila Király 
> wrote:
> 
>> 2011/3/24 hok 
>>> 
>>> 2. In the Servlet 3.0 specification it's possible to have static
>> resources
>>> under META-INF/resources and I noticed that wicket has
>>> MetaInfStaticResourceReference, which is better for serving static
>>> resources. In my case for some components I have css files which are
>> loaded
>>> like:
>>> 
>>>   response.renderCSSReference(new
>> PackageResourceReference(getClass(),
>>> getClass().getSimpleName() + ".css"));
>>> 
>>> So, it should be better to move all those css files under
>>> META-INF/resources. However, this somehow contradicts with the wicket
>>> philosophy of having everything in one place and requires maintaining a
>>> parallel package folder structure under META-INF/resources. Do you think
>>> it's worth it?
>>> 
>> 
>> Hi,
>> 
>> In my tests I found that Tomcat 7 serves static files from
>> META-INF/resources directory 2-3 times faster than wicket. So if
>> performance
>> is important I think it is worth it. I am pragmatic about it: maybe it is
>> bad to not hold everything in the same directory but this is a feature that
>> fits wicket pretty well (bundling static files in jars) so it would be
>> worse
>> to not use it.
>> 
>> Attila
>> 
> With the new CachingResourceStreamLocator the serving should be faster now.
> See https://issues.apache.org/jira/browse/WICKET-3511.
> 
> 
> -- 
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 


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



Re: PackageResourceReference, MetaInfStaticResourceReference and timestamps

2011-03-24 Thread Martin Grigorov
Hi,

On Thu, Mar 24, 2011 at 7:17 AM, Attila Király wrote:

> 2011/3/24 hok 
> >
> > 2. In the Servlet 3.0 specification it's possible to have static
> resources
> > under META-INF/resources and I noticed that wicket has
> > MetaInfStaticResourceReference, which is better for serving static
> > resources. In my case for some components I have css files which are
> loaded
> > like:
> >
> >response.renderCSSReference(new
> PackageResourceReference(getClass(),
> > getClass().getSimpleName() + ".css"));
> >
> > So, it should be better to move all those css files under
> > META-INF/resources. However, this somehow contradicts with the wicket
> > philosophy of having everything in one place and requires maintaining a
> > parallel package folder structure under META-INF/resources. Do you think
> > it's worth it?
> >
>
> Hi,
>
> In my tests I found that Tomcat 7 serves static files from
> META-INF/resources directory 2-3 times faster than wicket. So if
> performance
> is important I think it is worth it. I am pragmatic about it: maybe it is
> bad to not hold everything in the same directory but this is a feature that
> fits wicket pretty well (bundling static files in jars) so it would be
> worse
> to not use it.
>
> Attila
>
With the new CachingResourceStreamLocator the serving should be faster now.
See https://issues.apache.org/jira/browse/WICKET-3511.


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