Re: Handling 404 in wicket?

2009-02-06 Thread Andrew Lombardi

Marc,

this has been covered before, and its not too specific to wicket, you  
can add the needed items in your web.xml, here's an example:


http://herebebeasties.com/2006-12-20/using-a-servlet-filter-for-404-error-page/

On Feb 6, 2009, at 2:52 PM, Marc Ende wrote:


Hi,

within a Project there is the need for a "customized" 404-Page.
Users with a misspelled url should get a standard 404-Page and
some "hints" which pages they possible wanted to show. The other
point is that I would like to reuse the templates, inheritance and  
so on

and not to create some "special" jsps for this.

I've some messages on this list in mind which are related to this
topic but I haven't found them anymore.
Ist there anything easy (like an "setErrorPage") to get all requests
which are directed to non existing Pages?


Thanks for your help

Marc




To our success!

Mystic Coders, LLC | Code Magic | www.mysticcoders.com

ANDREW LOMBARDI | and...@mysticcoders.com
2321 E 4th St. Ste C-128, Santa Ana CA 92705
ofc: 949-528-6480
fax: 714-782-6024
cell: 714-697-8046

Eco-Tip: Printing e-mails is usually a waste.


This message is for the named person's use only. You must not,  
directly or indirectly, use,
 disclose, distribute, print, or copy any part of this message if you  
are not the intended recipient.





Re: making a HTTP request directly in Wicket

2009-02-06 Thread Marcelo Morales
It can connect and stall forever. People restart firewalls you know. I
must insist on using at least setReadTimeout(int).

On Fri, Feb 6, 2009 at 3:15 AM, Swinsburg, Stephen
 wrote:
> I was just going to do it in a different thread, make a void function then it 
> can take as long as it needs without having timeouts. Might still have a 
> timeout just in case though ;)
>
> cheers.
>
>
>
> -Original Message-
> From: Erik van Oosten [mailto:e.vanoos...@grons.nl]
> Sent: Fri 2/6/2009 5:40 AM
> To: users@wicket.apache.org
> Subject: Re: making a HTTP request directly in Wicket
>
> Thanks Peter, Marcelo,
>
> Still learning every day...
>
> Regards,
>Erik.
>
> Marcelo Morales wrote:
>> Don't forget setReadTimeout(int)
>> Also very important.
>>
>> On Thu, Feb 5, 2009 at 11:42 AM, Peter Ertl  wrote:
>>
  Please use commons HttpClient, with the standard Java client you have no
 control over timeouts potentially hanging your application.

>>> Is this still true?
>>>
>>> I found that at least in Java 6 there is
>>>
>>>   URLConnection.setConnectTimeout(int)
>>>
>
>
> --
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.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
>
>



-- 
Marcelo Morales

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



Re: Using Eclipse & Wicket for Modular Webapps

2009-02-06 Thread Fabrizio Giudici

The conclusion says:

"But most important: it would be really interesting to actually build a 
real Wicket application
with Eclipse. Only real world experience can show whether itʻs worth the 
hassle in the end."


I think it's definitely possible. I'm running two customizations of a 
Wicket application based on the NetBeans Platform (I posted a few weeks 
ago a link about that: 
http://netbeans.dzone.com/articles/using-netbeans-platform-server) and 
so far everything works fine, in spite of the application being 
relatively complex. I was worried about some potential issues with the 
classloaders, which is a constant risk every time you deal with modular 
frameworks such as Eclipse Platform or NetBeans platform, but none 
manifested so far. BTW, I'm trying to understand why I didn't have to 
deal with the IClassResolver for bookmarkable pages...




Thijs Vonk wrote:
Looks really interresting, I've read the pdf. but it seems that there 
is a part missing at the end...



On 2/6/09 6:02 PM, Thomas Mäder wrote:

Hi Folks,

I've been experimenting with getting the Eclipse plugin engine up 
inside a
wicket application. The idea is to build Wicket applications out of 
plugins.

You can find an article about my experiences (+sample code) here:
http://devotek-it.ch/stuff.html
I'm grateful for any feedback, both concerning the Eclipse/OSGI and the
Wicket part.

enjoy the weekend

Thomas






--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
fabrizio.giud...@tidalwave.it - mobile: +39 348.150.6941


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



path to resource ../ attached at the beginning

2009-02-06 Thread Andreas Petersson

hi!
in the .html file i have references to images such as


in the preview this is the correct path.
as soon as i startup the apllication wicket writes out the image as


1) why is ../ appended at the beginning?
2) how can i replace the path with something like

the css is included via the Start.java with  
add(new StyleSheetReference("mainCss", new CompressedResourceReference(Start.class,"../res/main.css")));

since the pictures are added in the classpath, they must be accessed via 
/resources/
it would be optimal if i can acieve this just by editing the html file, to keep 
the previewability.
i hate to have duplicate references to the same resource. (java +html that both 
contain links to the same images...)

best regards
andreas


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



Re: How to execute Wicket project in Eclipse

2009-02-06 Thread Swapna Rachamalla
yeah i got it using Apache Tomcat 6.0 also..

Thanks a lot..



On Fri, Feb 6, 2009 at 3:04 PM, Trent Larson  wrote:

> You will have to run your Wicket application with a J2EE application
> server.
>
> I've found Run-Jetty-Run to be extremely easy-to-use:
>
> http://code.google.com/p/run-jetty-run/
>
> Trent
>
> On Fri, Feb 6, 2009 at 2:43 PM, Swapna Rachamalla <
> swapna.rachama...@gmail.com> wrote:
>
> > Hi All
> >
> > I have installed Apache wicket plug-ins in Eclipse.
> >
> > Now iam able to create Wicket Project from
> File->New->Other->Wicket->Wicket
> > Project.
> >
> > Then it is asking for Project name. So gave some name..
> >
> > Then it is creating MyApplication which extends WebApplication and
> > configured in the web.xml file.
> >
> > then i created HelloWorld.java
> >
> > package com.example;
> > import org.apache.wicket.markup.html.WebPage;
> > import org.apache.wicket.markup.html.basic.Label;
> >
> >
> > public class HelloWorld extends WebPage {
> >
> >HelloWorld()
> >{
> >add(new Label("msg","sfjhdsjfdhjdjkf"));
> >}
> >
> > }
> >
> > and modified MyApplication.java file
> >
> > public class MyApplication extends WebApplication {
> >public MyApplication() {
> >
> >}
> >
> >public void init() {
> >
> >}
> >
> >@Override
> >public Class getHomePage() {
> >// TODO Auto-generated method stub
> >return HelloWorld.class;
> >}
> > }
> >
> > and created HelloWorld.html
> >
> > 
> > 
> > Insert title here
> > 
> > 
> > Message goes here
> > 
> > 
> >
> > Now Iam unable deploy and run the application.
> > can u Plz suggest me how to run this application.
> > Iam not using Maven for building the files and i configured Apache
> Geronimo
> > 2.0 Server in Eclipse
> >
> > Thanks
> > Swapna
> >
>


Re: AutoCompleteTextField buggy?

2009-02-06 Thread Igor Vaynberg
what wicket version are you using?

-igor

On Fri, Feb 6, 2009 at 3:32 AM, Arthur Leigh Allen
 wrote:
>
>
> Hi there
>
> I read that some people here got the same exception like me, but I couldn't 
> find an answer.
>
> Do the following:
> -use an AutoCompleteTextField
> -override the method getChoices(String input)
> -do a time-consuming database call to retrieve the choices
> -return the choices
>
> everything works fine... but do the following steps VERY FAST
> -click at the AutoCompleteTextField to enter something
> -press "m" and immediately "enter" to submit the form
>
> this will submit the form BEFORE the getChoices method returns the choices.
> the form is submitted and then the AutoCompleteTextField is removed from the 
> page because the panel (including the text field) is removed and a different 
> panel is displayed via ajax.
> then the getChoices(...) method returns the choices and the following 
> exception occurs:
>
> org.apache.wicket.WicketRuntimeException: component 
> content:form:nameField:textField not found on page test.MyPage[id = 0], 
> listener interface = [RequestListenerInterface 
> name=IActivePageBehaviorListener, method=public abstract void 
> org.apache.wicket.behavior.IBehaviorListener.onRequest()]
>  at test.TestApplication.access$0(TestApplication.java:145)
>  at test.TestApplication$1.onRuntimeException(TestApplication.java:117)
>  at 
> org.apache.wicket.request.AbstractRequestCycleProcessor.onRuntimeException(AbstractRequestCycleProcessor.java:217)
>  at 
> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:119)
>  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1302)
>  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1353)
>  at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>  at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:355)
>  at 
> org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>  at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>  at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>  at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>  at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>  at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>  at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>  at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>  at 
> org..apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>  at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>  at org.apache.tomcat.util..net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>  at java.lang.Thread.run(Thread.java:619)
>
> When the getChoices method returns "null" or when I press "m" and then 
> "enter" after ca. 3 seconds, everything works fine without an exception.
>
> I already saw that example: 
> http://www.wicket-library.com/wicket-examples/ajax/autocomplete.1
>
> There the exception doesn't occur but I think it's maybe because
> -setResponsePage is used and not ajax or
> -the getChoices method returns the values in time
>
> Would appreciate any help
>
> Best regards,
> Leigh
>
>
>
>

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



problem deploying quickstart application on tomcat+apache (mod_jk)

2009-02-06 Thread Vika

Hi, 

I have no problem running quickstart in eclipse on jetty. However having
problem deploying it on tomcat/apache. Here are the steps I followed:

1. Modified build.xml - changed wicket-quickstart to quickstart
2. ran ant war and dropped quickstart.war file into ~tomcat/webapps
3. added to mod_jk the following
### 
Alias /quickstart "/usr/local/tomcat/webapps/quickstart"


Options Indexes FollowSymLinks
DirectoryIndex index.html index.htm index.jsp


JkMount /quickstart/app/* ajp13

ErrorLog logs/quickstart-error_log
TransferLog logs/quickstart-access_log

4. after restarting tomcat and apache i went to this url in web browser
http:///quickstart
and got redirected to
http:///quickstart/app 
and got a message
"The requested URL /quickstart/app was not found on this server."


I have several other project with servlets running on the same instance of
tomcat/apache. Any idea what i might be missing with wicket quickstart?

thank you in advance!

Vicky

-- 
View this message in context: 
http://www.nabble.com/problem-deploying-quickstart-application-on-tomcat%2Bapache-%28mod_jk%29-tp21882831p21882831.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: How to execute Wicket project in Eclipse

2009-02-06 Thread Trent Larson
You will have to run your Wicket application with a J2EE application server.

I've found Run-Jetty-Run to be extremely easy-to-use:

http://code.google.com/p/run-jetty-run/

Trent

On Fri, Feb 6, 2009 at 2:43 PM, Swapna Rachamalla <
swapna.rachama...@gmail.com> wrote:

> Hi All
>
> I have installed Apache wicket plug-ins in Eclipse.
>
> Now iam able to create Wicket Project from File->New->Other->Wicket->Wicket
> Project.
>
> Then it is asking for Project name. So gave some name..
>
> Then it is creating MyApplication which extends WebApplication and
> configured in the web.xml file.
>
> then i created HelloWorld.java
>
> package com.example;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.basic.Label;
>
>
> public class HelloWorld extends WebPage {
>
>HelloWorld()
>{
>add(new Label("msg","sfjhdsjfdhjdjkf"));
>}
>
> }
>
> and modified MyApplication.java file
>
> public class MyApplication extends WebApplication {
>public MyApplication() {
>
>}
>
>public void init() {
>
>}
>
>@Override
>public Class getHomePage() {
>// TODO Auto-generated method stub
>return HelloWorld.class;
>}
> }
>
> and created HelloWorld.html
>
> 
> 
> Insert title here
> 
> 
> Message goes here
> 
> 
>
> Now Iam unable deploy and run the application.
> can u Plz suggest me how to run this application.
> Iam not using Maven for building the files and i configured Apache Geronimo
> 2.0 Server in Eclipse
>
> Thanks
> Swapna
>


Handling 404 in wicket?

2009-02-06 Thread Marc Ende
Hi,

within a Project there is the need for a "customized" 404-Page.
Users with a misspelled url should get a standard 404-Page and
some "hints" which pages they possible wanted to show. The other
point is that I would like to reuse the templates, inheritance and so on
and not to create some "special" jsps for this.

I've some messages on this list in mind which are related to this
topic but I haven't found them anymore.
Ist there anything easy (like an "setErrorPage") to get all requests
which are directed to non existing Pages?


Thanks for your help

Marc



signature.asc
Description: OpenPGP digital signature


Re: Using Eclipse & Wicket for Modular Webapps

2009-02-06 Thread Thomas Mäder
fixed.


>
>
>
> On Fri, Feb 6, 2009 at 9:40 PM, Thijs Vonk  wrote:
>
>> Looks really interresting, I've read the pdf. but it seems that there is a
>> part missing at the end...
>>
>>
>>


Re: Using Eclipse & Wicket for Modular Webapps

2009-02-06 Thread Thomas Mäder
Hi Thijs,

You are right, the last sentence is garbled. It really is the last sentence,
thought, so You didn't miss anything relevant, though. I'll fix it tomorrow
morning.

thanks for the find

Thomas

On Fri, Feb 6, 2009 at 9:40 PM, Thijs Vonk  wrote:

> Looks really interresting, I've read the pdf. but it seems that there is a
> part missing at the end...
>
>
> On 2/6/09 6:02 PM, Thomas Mäder wrote:
>
>> Hi Folks,
>>
>> I've been experimenting with getting the Eclipse plugin engine up inside a
>> wicket application. The idea is to build Wicket applications out of
>> plugins.
>> You can find an article about my experiences (+sample code) here:
>> http://devotek-it.ch/stuff.html
>> I'm grateful for any feedback, both concerning the Eclipse/OSGI and the
>> Wicket part.
>>
>> enjoy the weekend
>>
>> Thomas
>>
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Thomas Mäder
Wicket & Eclipse Consulting
www.devotek-it.ch


How to execute Wicket project in Eclipse

2009-02-06 Thread Swapna Rachamalla
Hi All

I have installed Apache wicket plug-ins in Eclipse.

Now iam able to create Wicket Project from File->New->Other->Wicket->Wicket
Project.

Then it is asking for Project name. So gave some name..

Then it is creating MyApplication which extends WebApplication and
configured in the web.xml file.

then i created HelloWorld.java

package com.example;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;


public class HelloWorld extends WebPage {

HelloWorld()
{
add(new Label("msg","sfjhdsjfdhjdjkf"));
}

}

and modified MyApplication.java file

public class MyApplication extends WebApplication {
public MyApplication() {

}

public void init() {

}

@Override
public Class getHomePage() {
// TODO Auto-generated method stub
return HelloWorld.class;
}
}

and created HelloWorld.html



Insert title here


Message goes here



Now Iam unable deploy and run the application.
can u Plz suggest me how to run this application.
Iam not using Maven for building the files and i configured Apache Geronimo
2.0 Server in Eclipse

Thanks
Swapna


Re: Using Eclipse & Wicket for Modular Webapps

2009-02-06 Thread Thijs Vonk
Looks really interresting, I've read the pdf. but it seems that there is 
a part missing at the end...



On 2/6/09 6:02 PM, Thomas Mäder wrote:

Hi Folks,

I've been experimenting with getting the Eclipse plugin engine up inside a
wicket application. The idea is to build Wicket applications out of plugins.
You can find an article about my experiences (+sample code) here:
http://devotek-it.ch/stuff.html
I'm grateful for any feedback, both concerning the Eclipse/OSGI and the
Wicket part.

enjoy the weekend

Thomas

   



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



Re: IoC: how to best handle non-serializable fields in wicket

2009-02-06 Thread francisco treacy
proxy i meant as in the proxy pattern - it delegates

francisco

On Fri, Feb 6, 2009 at 8:41 PM, Igor Vaynberg  wrote:
> salve doesnt add a proxy, it removes the field and rewrites any field
> read with a lookup.
>
> -igor
>
> On Fri, Feb 6, 2009 at 11:32 AM, francisco treacy
>  wrote:
>> another option is to use salve (http://code.google.com/p/salve/).
>> instead of calling guice's injector as a service locator you use
>> @Dependency, that will lookup and inject your dependency (behind the
>> scenes it adds the class a proxy through bytecode instrumentation).
>>
>> public class myLDM extends LoadableDetachableModel {
>>
>>  @Dependency myDAO;
>>
>>  public Object load() {
>>  return myDAO.get(...);
>> }
>>
>> francisco
>>
>> On Fri, Feb 6, 2009 at 3:06 PM, Martin Grigorov  wrote:
>>> I have seen such code somewhere:
>>>
>>>
>>> public class myLDM extends LoadableDetachableModel {
>>>
>>> transient @SpringBean myDAO;
>>>
>>> public Object load() {
>>>  InjectorHolder.getInjector().inject(this);
>>>  return myDAO.get(...);
>>> }
>>>
>>> }
>>>
>>> El vie, 06-02-2009 a las 13:21 +0100, Martijn Dashorst escribió:
 How would you inject the dao then?

 Martijn


 On Fri, Feb 6, 2009 at 12:00 PM, Sergey Didenko
  wrote:
 > Hi Andreas,
 >
 > Well, may be my question is silly, but:
 >
 > What about making "dao" a local variable in your component handlers?
 > Then you can get rid of that serializing-deserializing of dao as a
 > Component member.
 >
 > Does this approach have too much overhead? Does it make some things 
 > impossible?
 >
 > Cheers, Sergey.
 >
 > -
 > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 > For additional commands, e-mail: users-h...@wicket.apache.org
 >
 >



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

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



Re: IoC: how to best handle non-serializable fields in wicket

2009-02-06 Thread Igor Vaynberg
salve doesnt add a proxy, it removes the field and rewrites any field
read with a lookup.

-igor

On Fri, Feb 6, 2009 at 11:32 AM, francisco treacy
 wrote:
> another option is to use salve (http://code.google.com/p/salve/).
> instead of calling guice's injector as a service locator you use
> @Dependency, that will lookup and inject your dependency (behind the
> scenes it adds the class a proxy through bytecode instrumentation).
>
> public class myLDM extends LoadableDetachableModel {
>
>  @Dependency myDAO;
>
>  public Object load() {
>  return myDAO.get(...);
> }
>
> francisco
>
> On Fri, Feb 6, 2009 at 3:06 PM, Martin Grigorov  wrote:
>> I have seen such code somewhere:
>>
>>
>> public class myLDM extends LoadableDetachableModel {
>>
>> transient @SpringBean myDAO;
>>
>> public Object load() {
>>  InjectorHolder.getInjector().inject(this);
>>  return myDAO.get(...);
>> }
>>
>> }
>>
>> El vie, 06-02-2009 a las 13:21 +0100, Martijn Dashorst escribió:
>>> How would you inject the dao then?
>>>
>>> Martijn
>>>
>>>
>>> On Fri, Feb 6, 2009 at 12:00 PM, Sergey Didenko
>>>  wrote:
>>> > Hi Andreas,
>>> >
>>> > Well, may be my question is silly, but:
>>> >
>>> > What about making "dao" a local variable in your component handlers?
>>> > Then you can get rid of that serializing-deserializing of dao as a
>>> > Component member.
>>> >
>>> > Does this approach have too much overhead? Does it make some things 
>>> > impossible?
>>> >
>>> > Cheers, Sergey.
>>> >
>>> > -
>>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> > For additional commands, e-mail: users-h...@wicket.apache.org
>>> >
>>> >
>>>
>>>
>>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: IoC: how to best handle non-serializable fields in wicket

2009-02-06 Thread francisco treacy
another option is to use salve (http://code.google.com/p/salve/).
instead of calling guice's injector as a service locator you use
@Dependency, that will lookup and inject your dependency (behind the
scenes it adds the class a proxy through bytecode instrumentation).

public class myLDM extends LoadableDetachableModel {

 @Dependency myDAO;

 public Object load() {
  return myDAO.get(...);
}

francisco

On Fri, Feb 6, 2009 at 3:06 PM, Martin Grigorov  wrote:
> I have seen such code somewhere:
>
>
> public class myLDM extends LoadableDetachableModel {
>
> transient @SpringBean myDAO;
>
> public Object load() {
>  InjectorHolder.getInjector().inject(this);
>  return myDAO.get(...);
> }
>
> }
>
> El vie, 06-02-2009 a las 13:21 +0100, Martijn Dashorst escribió:
>> How would you inject the dao then?
>>
>> Martijn
>>
>>
>> On Fri, Feb 6, 2009 at 12:00 PM, Sergey Didenko
>>  wrote:
>> > Hi Andreas,
>> >
>> > Well, may be my question is silly, but:
>> >
>> > What about making "dao" a local variable in your component handlers?
>> > Then you can get rid of that serializing-deserializing of dao as a
>> > Component member.
>> >
>> > Does this approach have too much overhead? Does it make some things 
>> > impossible?
>> >
>> > Cheers, Sergey.
>> >
>> > -
>> > 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



Proper hook for conversational state that also works with tests

2009-02-06 Thread cpopetz

Hi,

I'm currently responsible for maintaining the Seam/Wicket integration for
the Seam team.  Seam maintains a "conversational" context, a session-based
map that is keyed by an id associated with a set of requests.  Previously
the wicket integration worked by wrapping every redirect or outgoing url and
adding the conversation id as a parameter, and then restoring the
conversation based on that parameter in a servlet filter.  While this works,
it's ugly, and doesn't play with with various URL coding strategies.  

So instead, I've been working on storing the conversational id in Page
metadata.  I did this by providing a new WebRequestCycleProcessor subclass
which in resolve() looks for IPageRequestTarget or
BookmarkablePageRequestTarget, pulls the page out, and restores the
conversation if the parameter is present in metdata.  Correspondingly, in
respond(), I do the inverse.  

This works great when running in-container, but isn't playing well with
tests that use ajax.  When an ajax link is clicked in-container, the full
request cycle is step()ed through.  But BaseWicketTester.clickLink(), which
I presume is the appropriate thing to use, does:

AjaxLink link = (AjaxLink)linkComponent;

setupRequestAndResponse(true);
WebRequestCycle requestCycle = createRequestCycle();
callOnBeginRequest(requestCycle);
AjaxRequestTarget target = new 
AjaxRequestTarget(link.getPage());
requestCycle.setRequestTarget(target);

link.onClick(target);

// process the request target
processRequestCycle(requestCycle);


This means that the link's onClick method is called before my request cycle
hooks have a chance to restore conversational state.  

Is there an alternate way I should be hooking into wicket so that I can
reliably intercept requests to pages and retrieve/store metadata?

Thank you,
-Clint
-- 
View this message in context: 
http://www.nabble.com/Proper-hook-for-conversational-state-that-also-works-with-tests-tp21876375p21876375.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



Using Eclipse & Wicket for Modular Webapps

2009-02-06 Thread Thomas Mäder
Hi Folks,

I've been experimenting with getting the Eclipse plugin engine up inside a
wicket application. The idea is to build Wicket applications out of plugins.
You can find an article about my experiences (+sample code) here:
http://devotek-it.ch/stuff.html
I'm grateful for any feedback, both concerning the Eclipse/OSGI and the
Wicket part.

enjoy the weekend

Thomas

-- 
Thomas Mäder
Wicket & Eclipse Consulting
www.devotek-it.ch


Re: Another question for best practices

2009-02-06 Thread uwe janner
ok, i got it :-)

the downside is, that then you have the names of the css in the java  class;
as this is more the duty of the html designer, i looked for a way to let the
html designer say which css to take (and pull it from a static source) and a
mechanism that converts this to the "real" url by wicket.
so i used the  solution.

uwe.

On Fri, Feb 6, 2009 at 5:15 PM, Thomas Mäder wrote:

> No, what I meant was a single tag link and a list view:
>
> 
>
> and in code:
>
> List cssFiles= Array.asList(new String[] { "base.css", "special.css" });
> add(new ListView("cssList", cssFiles) {
>  public void populateItem(ListItem item) {
> String cssFile= item.getModelObjectAsString();
> item.add(new AttributeModifier("href",  new AbstractReadOnlyModel() {
>public Object getModel() {
>   return +"/"+cssFile
>}
> });
>  }
> });
>
> this is off the top of my head, just to see if we're even on the same page.
>
> Thomas
>
> On Fri, Feb 6, 2009 at 12:15 PM, uwe janner 
> wrote:
>
> > hi thomas,
> >
> > i dont really get your idea, maybe an example?
> >
> > what i did was: write the followning in the html:
> >
> > 
> >  and many more ...
> > 
> >
> > and then i "repeat" myself in the page class (CssLink just puts the
> dynamic
> > url part before the original href value):
> >
> > add( new CssLink("baseCss"));
> > ... and many more ...
> > add( new CssLink("specialCss"));
> >
> >
> >
>
>
> --
> Thomas Mäder
> Wicket & Eclipse Consulting
> www.devotek-it.ch
>


Re: How to remove open-close tags of

2009-02-06 Thread Igor Vaynberg
no

-igor

On Thu, Feb 5, 2009 at 11:53 PM, based  wrote:
>
> Hi Igor,
>
> Thanks for your reply, I have created the jira rfe. To be able to continue
> to development, i created a new IResponseFilter to remove  tags from
> responseBuffer.
> Do you see any concern in this?
>
> Thanks in advance
>
>
> igor.vaynberg wrote:
>>
>> add an rfe into jira to break this out into a setting
>>
>> -igor
>>
>> On Thu, Feb 5, 2009 at 7:40 AM, based  wrote:
>>>
>>> Hi,
>>>
>>> We have a big SpringMVC based web project. And we are developing new
>>> modules
>>> with wicket and including them to current View-Engine by using
>>> request.include(). (We have some customizations of course.)
>>>
>>> The problem is about header resources, when i include a wicket component,
>>> it
>>> is also adding css and javascripts to source within a  tag. But in
>>> the
>>> middle of body content as normal :(.
>>>
>>> Basically my requirement is removing automatically added 
>>> open-close
>>> tags for some pages. I need to determine this according to Page.
>>>
>>> HtmlHeaderContainer class is providing  tag writing functionality.
>>> There is a method which is named "renderOpenAndCloseTags", and this
>>> covers
>>> my requirement. (This method is returning true for all cases)
>>> But i could not find a way to override this method.
>>>
>>> Is there any(other) way to do this?
>>>
>>> Thanks.
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-remove-open-close-tags-of-%3Chead%3E-tp21853872p21853872.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-remove-open-close-tags-of-%3Chead%3E-tp21853872p21868046.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



Re: Another question for best practices

2009-02-06 Thread Thomas Mäder
No, what I meant was a single tag link and a list view:



and in code:

List cssFiles= Array.asList(new String[] { "base.css", "special.css" });
add(new ListView("cssList", cssFiles) {
  public void populateItem(ListItem item) {
 String cssFile= item.getModelObjectAsString();
 item.add(new AttributeModifier("href",  new AbstractReadOnlyModel() {
public Object getModel() {
   return +"/"+cssFile
}
 });
  }
});

this is off the top of my head, just to see if we're even on the same page.

Thomas

On Fri, Feb 6, 2009 at 12:15 PM, uwe janner  wrote:

> hi thomas,
>
> i dont really get your idea, maybe an example?
>
> what i did was: write the followning in the html:
>
> 
>  and many more ...
> 
>
> and then i "repeat" myself in the page class (CssLink just puts the dynamic
> url part before the original href value):
>
> add( new CssLink("baseCss"));
> ... and many more ...
> add( new CssLink("specialCss"));
>
>
>


-- 
Thomas Mäder
Wicket & Eclipse Consulting
www.devotek-it.ch


Re: How to get at the 404 request URL?

2009-02-06 Thread Jörn Zaefferer
Thanks Jonas, exactly what I was looking for!

Jörn

On Fri, Feb 6, 2009 at 4:20 PM, Jonas  wrote:
> Hi,
>
> this isn't actually related to wicket, but anyway, I think what you're
> looking for is
> the servlet request attribute "javax.servlet.error.request_uri"
> See: http://www.servlets.com/soapbox/servlet23.html
> specially the section 'New error attributes'
>
> regards,
> Jonas
>
>
> On Fri, Feb 6, 2009 at 3:28 PM, Jörn Zaefferer
>  wrote:
>> Hi,
>>
>> I'm using a servlet error-page mapping to display my custom NotFound
>> page for 404s (eg. as described here:
>> http://herebebeasties.com/2006-12-20/using-a-servlet-filter-for-404-error-page/)
>>
>> 
>>wicket-filter
>>/*
>>REQUEST
>>ERROR
>> 
>>
>> 
>>404
>>/404
>> 
>>
>> I have some anlayzing code on my NotFound page to check where the 404
>> occured, eg. by looking at the referrer and logging the request URI.
>> This works when I use setResponsePage(NotFound.class) in other pages,
>> but not for the error-page mapping, as
>> HttpServletRequest#getRequestURI() returns just /404, which isn't
>> helping at all.
>>
>> Any ideas on how to get at the original URI that triggered the 404?
>>
>> Jörn
>>
>> -
>> 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: The same *.css and *.js on multiple pages

2009-02-06 Thread Trent Larson
One solution is the "extend" functionality (eg. "wicket:child" and
"wicket:extend").  We use a "BasePage" that all our pages extend, and it
contains all our javascript.  It doesn't add anything else, so there is
almost no HTML (just the "html", "head", and "body" tags) and the Java file
for that page is just a blank class.  (Just make sure that, if they add
anything else to the header, all the extending pages use a "wicket:head" tag
for the additional content.)

Trent



On Fri, Feb 6, 2009 at 8:36 AM, Vasily Vasilkov wrote:

> Hi
>
> I have a few *.css and javascript files. These files are used by all
> pages of my application. Sometimes, I need to change (add/remove)
> files in header of my pages. So, what is the easiest way to do this?
>
> P.S. Will HeaderContributor help me?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


The same *.css and *.js on multiple pages

2009-02-06 Thread Vasily Vasilkov
Hi

I have a few *.css and javascript files. These files are used by all
pages of my application. Sometimes, I need to change (add/remove)
files in header of my pages. So, what is the easiest way to do this?

P.S. Will HeaderContributor help me?

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



Re: How to get at the 404 request URL?

2009-02-06 Thread Jonas
Hi,

this isn't actually related to wicket, but anyway, I think what you're
looking for is
the servlet request attribute "javax.servlet.error.request_uri"
See: http://www.servlets.com/soapbox/servlet23.html
specially the section 'New error attributes'

regards,
Jonas


On Fri, Feb 6, 2009 at 3:28 PM, Jörn Zaefferer
 wrote:
> Hi,
>
> I'm using a servlet error-page mapping to display my custom NotFound
> page for 404s (eg. as described here:
> http://herebebeasties.com/2006-12-20/using-a-servlet-filter-for-404-error-page/)
>
> 
>wicket-filter
>/*
>REQUEST
>ERROR
> 
>
> 
>404
>/404
> 
>
> I have some anlayzing code on my NotFound page to check where the 404
> occured, eg. by looking at the referrer and logging the request URI.
> This works when I use setResponsePage(NotFound.class) in other pages,
> but not for the error-page mapping, as
> HttpServletRequest#getRequestURI() returns just /404, which isn't
> helping at all.
>
> Any ideas on how to get at the original URI that triggered the 404?
>
> Jörn
>
> -
> 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: example application for spring wicket hibernate

2009-02-06 Thread cmoulliard

Another very interesting example is described here in the java world
publication :

http://www.javaworld.com/javaworld/jw-09-2008/jw-09-wicket3.html

This is (from my point of view) the best spring/hibernate implementation see
with Wicket (have a look to the code of the example : scramble-spring)

Compare to the phonebook that I know, spring service dependency is injected
in the web page through @SpringBean which is not the case in phone-book
example

Regards,

Charles

yowzator wrote:
> 
> It's in /trunk/wicketstuff-core/phonebook
> 
> Tauren
> 
> On Thu, Jan 22, 2009 at 12:21 PM, Dane Laverty
>  wrote:
>> I'd like to check out the phonebook app as well, but I can't find it.
>> The link at
>> http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook
>> says the SVN repository is at
>> https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wick
>> et-phonebook/ . That doesn't work, but if I replace the https with http,
>> then I get to a directory tree. However, I don't see any phonebook app
>> under trunk in there. Am I missing something obvious?
>>
>> -
>> 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
> 
> 
> 


-
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: 
http://www.nabble.com/example-application-for-spring-wicket-hibernate-tp20293119p21874186.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: IoC: how to best handle non-serializable fields in wicket

2009-02-06 Thread Sergey Didenko
I see, it's against Guice philisophy:

http://docs.google.com/Doc?id=dd2fhx4z_5df5hw8

> The idea of bootstrapping is fundamental to dependency injection. Always 
> explicitly asking the Injector for dependencies would be using Guice as a 
> service locator, not a dependency injection framework.
>
> Your code should deal directly with the Injector as little as possible

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



Re: static pages & dynamic pages. How to have the same layout

2009-02-06 Thread Nino Martinez
For my static pages, I use markup inheritance (as I do with all the 
other pages) so that I have zero replication of layouts... This makes it 
very simple.. Of course theres a little performance overhead but for me 
it does not matter.. Application mainentaince are whats most important 
in my case.


regards Nino

Nino Martinez wrote:
Im actually using that exact approach..I think it's somewhat ok, 
because it brings continuity to the architecture...



Vika wrote:

Hi,
I am completely new to Wicket and  trying to decide if this is 
something I

would want to use for my project. My website has some static and some
dynamic pages that have to share the same look. Currently I am using
SiteMesh to achieve this.  Can I accomplish this with Wicket without 
having

to write a dummy java class for every static html page ?

thank you in advance

Vicky
  





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



How to get at the 404 request URL?

2009-02-06 Thread Jörn Zaefferer
Hi,

I'm using a servlet error-page mapping to display my custom NotFound
page for 404s (eg. as described here:
http://herebebeasties.com/2006-12-20/using-a-servlet-filter-for-404-error-page/)


wicket-filter
/*
REQUEST
ERROR



404
/404


I have some anlayzing code on my NotFound page to check where the 404
occured, eg. by looking at the referrer and logging the request URI.
This works when I use setResponsePage(NotFound.class) in other pages,
but not for the error-page mapping, as
HttpServletRequest#getRequestURI() returns just /404, which isn't
helping at all.

Any ideas on how to get at the original URI that triggered the 404?

Jörn

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



Re: IoC: how to best handle non-serializable fields in wicket

2009-02-06 Thread Sergey Didenko
Yes, I mean something like this, with injector initialized in WebApplication.

On Fri, Feb 6, 2009 at 4:06 PM, Martin Grigorov  wrote:
> I have seen such code somewhere:
>
>
> public class myLDM extends LoadableDetachableModel {
>
> transient @SpringBean myDAO;
>
> public Object load() {
>  InjectorHolder.getInjector().inject(this);
>  return myDAO.get(...);
> }
>
> }
>
> El vie, 06-02-2009 a las 13:21 +0100, Martijn Dashorst escribió:
>> How would you inject the dao then?

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



Re: Clickable Image in a ListView (thumbnail principle)

2009-02-06 Thread frankmuel


Jeremy Thomerson-5 wrote:
> 
> Your code's looking good - you're on the right track.  The ease of the
> next
> step will blow your mind and you'll love wicket even more  (I hope :)
> 

Well, I do. It immediately worked. Thanks for your time!

Frank Mueller

-- 
View this message in context: 
http://www.nabble.com/Clickable-Image-in-a-ListView-%28thumbnail-principle%29-tp21864007p21873060.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: IoC: how to best handle non-serializable fields in wicket

2009-02-06 Thread Martin Grigorov
I have seen such code somewhere:


public class myLDM extends LoadableDetachableModel {

transient @SpringBean myDAO;

public Object load() {
  InjectorHolder.getInjector().inject(this);
  return myDAO.get(...);
}

}

El vie, 06-02-2009 a las 13:21 +0100, Martijn Dashorst escribió:
> How would you inject the dao then?
> 
> Martijn
> 
> 
> On Fri, Feb 6, 2009 at 12:00 PM, Sergey Didenko
>  wrote:
> > Hi Andreas,
> >
> > Well, may be my question is silly, but:
> >
> > What about making "dao" a local variable in your component handlers?
> > Then you can get rid of that serializing-deserializing of dao as a
> > Component member.
> >
> > Does this approach have too much overhead? Does it make some things 
> > impossible?
> >
> > Cheers, Sergey.
> >
> > -
> > 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: IoC: how to best handle non-serializable fields in wicket

2009-02-06 Thread James Carman
If the interface extends Serializable and you implement it, you
implement Serializable.  That's not a good idea for service/dao
classes.

On Thu, Feb 5, 2009 at 7:12 PM, Adriano dos Santos Fernandes
 wrote:
> Andreas Petersson wrote:
>>
>> hi timo, thanks for the links.
>>
>> well, i've modeled my application after reading the mentioned example.
>>
>> from Wicket, Guice and Ibatis example:
>>
>> public class MyPage extends WebPage {
>>@Inject
>>protected MyDao myDao;
>>
>>
>> ---
>> i wonder: myDao is most likely not serializable.
>> WebPage is. WebPage should get serialized. so why the heck does this not
>> throw an error? what kind of magic is going on here?
>
> My understand (of a guice newbie) is that your DAO class is not required
> (and will not be, using guice) serializable. But you should have a
> serializable interface. Wicket-ioc/guice will create a serializable proxy
> with a transient instance of the implementation. When it's null, a instance
> will be reinjected reinjected.
>
>
> Adriano
>
>
> -
> 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: Browser auto form filling

2009-02-06 Thread Ryan Gravener
Override getInputName()

Ryan Gravener
http://ryangravener.com/flex | http://twitter.com/ryangravener


On Fri, Feb 6, 2009 at 7:39 AM, John Patterson  wrote:

>
> Hi,
>
> I use generated forms for a "Contact Us" page and have noticed that my
> email
> address is not automatically filled in for me like on many sites.  I guess
> this is due to the name of the form input being something like
> "rows:0:row:input" which Safari has not come across before.  Is there any
> way to change the input name attribute or control this behaviour another
> way?
>
> Thanks,
>
> John
> --
> View this message in context:
> http://www.nabble.com/Browser-auto-form-filling-tp21871687p21871687.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
>
>


Browser auto form filling

2009-02-06 Thread John Patterson

Hi,

I use generated forms for a "Contact Us" page and have noticed that my email
address is not automatically filled in for me like on many sites.  I guess
this is due to the name of the form input being something like
"rows:0:row:input" which Safari has not come across before.  Is there any
way to change the input name attribute or control this behaviour another
way?

Thanks,

John
-- 
View this message in context: 
http://www.nabble.com/Browser-auto-form-filling-tp21871687p21871687.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: IoC: how to best handle non-serializable fields in wicket

2009-02-06 Thread Martijn Dashorst
How would you inject the dao then?

Martijn


On Fri, Feb 6, 2009 at 12:00 PM, Sergey Didenko
 wrote:
> Hi Andreas,
>
> Well, may be my question is silly, but:
>
> What about making "dao" a local variable in your component handlers?
> Then you can get rid of that serializing-deserializing of dao as a
> Component member.
>
> Does this approach have too much overhead? Does it make some things 
> impossible?
>
> Cheers, Sergey.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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



Re: Another question for best practices

2009-02-06 Thread uwe janner
hi thomas,

i dont really get your idea, maybe an example?

what i did was: write the followning in the html:


 and many more ...


and then i "repeat" myself in the page class (CssLink just puts the dynamic
url part before the original href value):

add( new CssLink("baseCss"));
... and many more ...
add( new CssLink("specialCss"));

would look shorter if i do it in a loop iterationg over { "baseCss",
. "specialCss" } but the bad thing about it is that i have to keep
these two in sync;
so i think i would implement it like this:


  
    and many more ...
  


and in the page i would add my custom ChangeHrefInBodyComponent, which would
directly change the hrefs in the body markup (not the child link components)
- bc i dont want to add those components explicitly by hand:
add( new ChangeHrefInBodyComponent( "cssLinks" );

or even simpler:

  
    and many more ...
  


and nothing to add in the page (as with  )

cheersuwe!



On Thu, Feb 5, 2009 at 8:51 PM, Thomas Mäder wrote:

> What I would have tried is this: have a list view of web markup containers.
> As a list item, create a WebMarkupContainer (mapped to the  tag). Add
> an attribute modifier that fixes up the "href" attribute of the link tag.
> You get the filename ("header.css") from the ListView's model. Or am  I
> missing somthing here?
>
> Thomas
>
> --
> Thomas Mäder
> Wicket & Eclipse Consulting
> www.devotek-it.ch
>


Re: IoC: how to best handle non-serializable fields in wicket

2009-02-06 Thread Sergey Didenko
Hi Andreas,

Well, may be my question is silly, but:

What about making "dao" a local variable in your component handlers?
Then you can get rid of that serializing-deserializing of dao as a
Component member.

Does this approach have too much overhead? Does it make some things impossible?

Cheers, Sergey.

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



Re: Web application using Wicket and iBATIS can't find DAOs?? ...pls help...its urgent

2009-02-06 Thread Rob Sonke
Btw, we're working with the same combination (spring/ibatis/wicket) and 
you'll love it :)


Rob


Kai Mutz wrote:

Edwin Ansicodd  wrote:
  

Thank you Kai for your post!!



2) Install a SpringComponentInjector in your application, e.g.
class MyApplication extends WebApplication {
  public void init() {
   super.init();
   addComponentInstantiationListener(new
SpringComponentInjector(this));
   }
}
  

Yes, also did this:

public class JPSApplication extends SpringWebApplication implements
IUnauthorizedComponentInstantiationListener{

@SpringBean private LookupTableDAO ltDAO;

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

addComponentInstantiationListener(new
SpringComponentInjector(this)); //for the SpringBean
InjectorHolder.getInjector().inject(this);



You do not need the last line here. Adding the SpringComponentInjector is
sufficient. AFAIK the InjectorHolder is needed within classes, which do not
extend a wicket component.

Cheers, Kai



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

  


Re: A doubt regarding "best-practices"

2009-02-06 Thread Kent Tong


Daniel Ferreira Castro wrote:
> 
> I think, in my opinion, that the approach of declaring the Form as an
> inner
> class makes the code more "dirty".  I mean, the Page class grows a lot and
> by inspecting the code is hard to understand at a first glance the scope
> of
> each entity and field.  So I prefer to declare the Form as a top class
> instead inner class.
> 

No. First of all, your page class should not keep growing larger and larger.
You should put most of the logic into your domain classes, not in the page
class. Once you do that, your page should be clean and easy to understand
despite the presence of an anonymous Form subclass.

Second, the structure of the Java code should match the structure of the
HTML file. This will make it easier to understand how they work together.



-
--
Kent Tong
Wicket tutorials freely available at http://www.agileskills2.org/EWDW
Axis2 tutorials freely available at http://www.agileskills2.org/DWSAA
-- 
View this message in context: 
http://www.nabble.com/A-doubt-regarding-%22best-practices%22-tp21849426p21869946.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



Bug in wicket-stuff phonebook

2009-02-06 Thread cmoulliard

Hi,

I would like to mention that there is a bug in the maven pom.xml file of the
project phonebook because the properties files located here
"wicketstuff-core\phonebook\src\main\java\wicket\contrib\phonebook\web\page"
are not at copied in the WAR generated. In consequence, the following error
is generated :

WicketMessage: Can't instantiate page using constructor public
wicket.contrib.phonebook.web.page.ListContactsPage()

Root cause:

java.util.MissingResourceException: Unable to find property: 'actions' for
component: [class=wicket.contrib.phonebook.web.page.ListContactsPage]
at org.apache.wicket.Localizer.getString(Localizer.java:342)
at org.apache.wicket.Localizer.getString(Localizer.java:118)
at org.apache.wicket.Component.getString(Component.java:1869)
at org.apache.wicket.Component.getString(Component.java:1856)

Can the owner of this application adapt the pom.xml to copy these properties
files in the WAR ?

Regards,




-
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: 
http://www.nabble.com/Bug-in-wicket-stuff-phonebook-tp21869788p21869788.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: Web application using Wicket and iBATIS can't find DAOs?? ...pls help...its urgent

2009-02-06 Thread Kai Mutz
Edwin Ansicodd  wrote:
> Thank you Kai for your post!!
>
>> 2) Install a SpringComponentInjector in your application, e.g.
>> class MyApplication extends WebApplication {
>>   public void init() {
>>super.init();
>>addComponentInstantiationListener(new
>> SpringComponentInjector(this));
>>}
>> }
>
> Yes, also did this:
>
> public class JPSApplication extends SpringWebApplication implements
> IUnauthorizedComponentInstantiationListener{
>
>   @SpringBean private LookupTableDAO ltDAO;
>
>   public void init(){
>   super.init();
>
>   addComponentInstantiationListener(new
>   SpringComponentInjector(this)); //for the SpringBean
>   InjectorHolder.getInjector().inject(this);

You do not need the last line here. Adding the SpringComponentInjector is
sufficient. AFAIK the InjectorHolder is needed within classes, which do not
extend a wicket component.

Cheers, Kai



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



RE: Web application using Wicket and iBATIS can't find DAOs?? ...pls help...its urgent

2009-02-06 Thread Edwin Ansicodd

Thank you Kai for your post!!

>I think it is rather a Wicket/Spring integration question. Thus look at
>http://cwiki.apache.org/WICKET/spring.html

Yes, it's a very good link!!

>You have to
>
>1) Declare your wicket application in your application context, e.g.
>

Yes, I did this in applicationContext.xml:  





>2) Install a SpringComponentInjector in your application, e.g.
>class MyApplication extends WebApplication {
>   public void init() {
>super.init();
>addComponentInstantiationListener(new
>SpringComponentInjector(this));
>}
>}

Yes, also did this:

public class JPSApplication extends SpringWebApplication implements
IUnauthorizedComponentInstantiationListener{

@SpringBean private LookupTableDAO ltDAO;

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

addComponentInstantiationListener(new 
SpringComponentInjector(this));
//for the SpringBean
InjectorHolder.getInjector().inject(this);

>3) Add the ContextLoaderListener to your web.xml
>
>org.springframework.web.context.ContextLoaderListener
>

Also had this in my web.xml:

 

org.springframework.web.context.ContextLoaderListener
 

My error was that all my DAOs and my sqlMapClient was defined in a file
called persistance.ibatis.xml.  I needed to include this file in my
applicationContext.xml :




Without this declaration it seems Spring couldn't find the DAOs.

Thank you once again for your assistance!!

Kind regards

Edwin
-- 
View this message in context: 
http://www.nabble.com/Web-application-using-Wicket-and-iBATIS-can%27t-find-DAOs---...pls-help...its-urgent-tp21860375p21869434.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: Custom Domain Exception Handling

2009-02-06 Thread Sven Meier
In our projects we let domain and service exceptions trickle down into 
Wicket and be handled in a custom RequestCycle.
Of course this requires them to be RuntimeExceptions, but this seems to 
be en vogue anyway.


Nice thing is this technique works non-form requests (e.g. links) too.

Sven

Igor Vaynberg schrieb:

class myform extends form {
  public void process() {
   try  {
 super.process();
   } catch (basedomainexception e) {
 error(e.getusermessage());
   }
}
 }

-igor

On Thu, Feb 5, 2009 at 5:49 AM, walnutmon  wrote:
  

All,

I am working with a domain where the POJOs have a method that checks there
values, and throws an exception with the error message if there is a problem
with one of there property values.  I am using panels to model these
objects, is there something I can do to utilize this behavior when a form
submits.  So that the form submit, and persisting of the models properties
will make the panel aware that there is an error.

I"m not looking for a full explanation of an implementation, just a quick
explanation of how the model objects properties get persisted.

Thanks!
Justin
--
View this message in context: 
http://www.nabble.com/Custom-Domain-Exception-Handling-tp21851678p21851678.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


  



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



Re: Problems Ajax with Portlet 2.0 in Liferay 5.2.1

2009-02-06 Thread Benjamin Ernst
Thanks Thijs, this works!

-- Benjamin

On Thu, Feb 5, 2009 at 6:38 PM, Thijs Vonk  wrote:

> This is an issue with Liferay (see
> http://issues.liferay.com/browse/LPS-1911)
> You can probably fix it by making sure that portlet-name (in portlet.xml)
> and the wicketfilter mapping url-pattern are identical (portlet.xml &
> web.xml)
>
>
>
> On 2/5/09 4:30 PM, Benjamin Ernst wrote:
>
>> Hi,
>>
>> I am Testing the new Portlet 2.0 with Liferay and have some problems with
>> Ajax-calls.
>>
>> I am using wicket 1.4-SNAPSHOT(Revision 741130) and Liferay Portal
>> Standard
>> Edition 5.2.1 (Augustine / Build 5201 / February 3, 2009).
>>
>> I have a simple page with one label and one Ajaxlink:
>>
>>  public HomePage(final PageParameters parameters) {
>>
>> final Label label = new Label("label", new
>> PropertyModel(this, "value"));
>> label.setOutputMarkupId(true);
>> add(label);
>>
>> AjaxLink link = new AjaxLink("link")
>> {
>>
>> @Override
>> public void onClick(AjaxRequestTarget target) {
>> value = value + 1;
>> target.addComponent(label);
>> }
>>
>> };
>> add(link);
>> }
>>
>> The portlet is shown correctly but when I click the Ajaxlink nothing
>> happens. In the Ajax-Debug-Log appears the following text:
>>
>> INFO:
>> INFO: Initiating Ajax POST request on
>> http://localhost:8080/web/guest/home?random=0.9410006487742066
>> INFO: Invoking pre-call handler(s)...
>> INFO: Received ajax response (84 characters)
>> INFO:
>> The requested resource (/ACE_PortletTest-1.0-SNAPSHOT/portlettest/) is not
>> available
>> ERROR: Error while parsing response: Could not find root
>> element
>> INFO: Invoking post-call handler(s)...
>> INFO: Invoking failure handler(s)...
>>
>> This is the log form Java when the Ajax-Link is clicked:
>>
>> DEBUG - 0-SNAPSHOT]- servletPath=/ACETEST,
>> pathInfo=/invoke,
>> queryString=null, name=null
>> DEBUG - 0-SNAPSHOT]-  Path Based Forward
>> DEBUG - WicketPortlet  - Portlet "RESOURCE_PHASE" for wicket
>> url:/portlettest/?wicket:interface=:0:link::IBehaviorListener:0:
>> DEBUG - 0-SNAPSHOT]- servletPath=/portlettest/,
>> pathInfo=null, queryString=wicket:interface=:0:link::IBehaviorListener:0:,
>> name=null
>> DEBUG - 0-SNAPSHOT]-  Path Based Include
>> DEBUG - WicketPortlet  - redirect url after inclusion:null
>> DEBUG - WicketPortlet  - end of request, wicket
>> url:/portlettest/?wicket:interface=:0:link::IBehaviorListener:0:
>> DEBUG - 0-SNAPSHOT]-  Disabling the response for futher
>> output
>> DEBUG - 0-SNAPSHOT]-  The Response is vehiculed using a
>> wrapper: com.liferay.portal.servlet.AbsoluteRedirectsResponse
>>
>> Here is my web.xml and my portlet.xml:
>>
>> 
>> http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance";
>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
>> version="2.4">
>>
>> ACE_PortletTest
>>
>> 
>> org.apache.wicket.detectPortletContext
>> true
>> 
>>
>> 
>> configuration
>> development
>> 
>> 
>>
>> 
>> wicket.ACE_PortletTest
>>
>> org.apache.wicket.protocol.http.WicketFilter
>> 
>> applicationClassName
>> de.acando.ace.WicketApplication
>> 
>> 
>>
>> 
>> wicket.ACE_PortletTest
>> /portlettest/*
>> REQUEST
>> FORWARD
>> INCLUDE
>> 
>> 
>>
>> 
>> http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd";
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="1.0"
>> xsi:schemaLocation="
>> http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
>> http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd";>
>>   
>> ACE Test
>> ACETEST
>> ACETEST
>>
>>
>> org.apache.wicket.protocol.http.portlet.WicketPortlet
>> 
>>   wicketFilterPath
>>   /portlettest
>> 
>> 
>>   text/html
>>   VIEW
>>   EDIT
>> 
>> 
>>   text/xml
>>   VIEW
>>   EDIT
>> 
>> 
>>   ACE Portlet Test
>>   ACE Portlet Test
>> 
>>   
>>   
>> javax.portlet.escapeXml
>> false
>>   
>> 
>>
>>
>> I have no idea whats wrong.
>>
>> Thanks for any help in advance,
>>
>> -- Benjamin
>>
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>