Re: Wicket-auth-roles + EJB 3 (Authentication and Authorization)

2009-03-22 Thread Marc Ende

Hi Barry,

I've running three webapps using wicket (1.3) wicket-security 
(SWARM/WASP) together with JAAS.

It's working great. Ok, the logout isn't very nice but it's doing it's job.
At first I had the same impression that's a hack and complicated but 
now, using it several times. It looks easy and it makes sense to me.


Thinks I had to do:
- Create a "CustomPrincipal"
   Just let it implement 
"org.apache.wicket.security.hive.authorization.Principal"
  
- Create a "CustomSubject"

   Extends "org.apache.wicket.security.hive.authentication.DefaultSubject"

- Create a "CustomLoginContext"
   Extends "org.apache.wicket.security.hive.authentication.LoginContext"
   implement the JAAS Login in the login() method of the CustomLoginContext
   and take care that the subject is filled with the username and the 
gorups (of jaas)

   are filled in as principals in the subject.

- Modify your WebApplication to extend Swam
   Extend "org.apache.wicket.security.swarm.SwarmWebApplication"
   implement setUpHive and getLoginPage

- create your hive-file.

You wanted to use w1.4, so I think that you'll have to patch swarm/wasp 
a little bit to work with 1.4


M.
  


Barry van Someren schrieb:

Hi all,

I've been busy on a project of mine that uses Wicket 1.4 RC 2 as a
frontend to a collection of EJB3 beans containing my business logic.
As users of this application will be able to use webservices as well
to use the application I'd also like to use authentication and more
importantly authorization on the side of the EJB's

I'm fairly familiar with EJB security but not very familiar with
Wicket security and I'm wondering what is the best course of action to
authenticate a user inside the Wicket application AND to put these
credentials inside the EJBContext?
I'm looking at 
http://cwiki.apache.org/WICKET/servlet-container-authentication.html
and seeing if I can somehow integrate the two, but it sounds a bit
like a hack.

Any other suggestions worth looking at?
Google is not returning much unfortunately.

Many thanks!

  



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



Re: handling not mounted URLs

2009-03-22 Thread Jan Kriesten

Hi Brill,

> Ahh... are you try to set up an RESTful type of URI where the path is
> relevant to the request being executed?

no, not really, my usecase is much simpler. :) If I encounter an unmounted path
I just want to create a frameset which has a target on another server. And the
target url should get the pathinfo appended.

> Hmm... how about a IRequestTargetUrlCodingStrategy?

I first thought to go that way, just that you can't mount '/' - so that's no
option either.

Best regards, --- Jan.


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



Wicket Page Expired Exception

2009-03-22 Thread Sandyc

Hi,

 we are developing a website with apache wicket. I have scenario where i
have to go back to the previous page from the current page.i tried using the
MixedParamUrlCodingStrategy for passing the parameters from the current page
to the previous page but i get a page expired exception.Please help me
-- 
View this message in context: 
http://www.nabble.com/Wicket-Page-Expired-Exception-tp22654936p22654936.html
Sent from the Wicket - User mailing list archive at Nabble.com.


Re: handling not mounted URLs

2009-03-22 Thread Jan Kriesten

Hi Jeremy,

> Maybe I'm just sleepy - but where did you put that code?  It's not java.

heh - that's Scala. :-)

The code belongs to the HomePage class.

Best regards, --- Jan.


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



YUI DateField not setting model object property?

2009-03-22 Thread Brill Pappin
I'm using the YUI DateField on a form that has a CompoundPropertyModel  
as its object, however the field doesn't seem to be setting the  
property on the base POJO.
The form components are all using the simple wicket id method of  
accessing the POJO properties via the CompoundPropertyModel.


Did I miss something on this component? does it not work the way a  
normal form field works?


If anyone can tell me what they have done to get it working, I'd be  
much obliged.


- Brill

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



Re: handling not mounted URLs

2009-03-22 Thread Brill Pappin
Ahh... are you try to set up an RESTful type of URI where the path is  
relevant to the request being executed?


I had to do something like that for an images resource recently...  
although it may be more at the mercy of Wicket than what you need.


Hmm... how about a IRequestTargetUrlCodingStrategy?
This is on the verge of guessing now, but i think it will allow you to  
mount it and then check if you want to process the request with it.


What I used it for was some Apple javascript (Dashcode stuff) that was  
being insistent on the paths it used for its resources and which  
didn't match those used for a Wicket resource.
The coding strategy would essentially checked if the path began with  
some known value, and then used a PackageResourceStream to load the  
wicketized version of the content.


The code for the strategy is below in case it gives you the clues you  
need to resolve your issue.


- Brill

public class IPhoneImageRequestTargetUrlCodingStrategy implements
IRequestTargetUrlCodingStrategy {

@Override
public IRequestTarget decode(RequestParameters requestParameters) {
String path = requestParameters.getPath();
ResourceStreamRequestTarget target = new 
ResourceStreamRequestTarget(
new PackageResourceStream(DashboardPage.class, 
path));
return target;
}

@Override
public CharSequence encode(IRequestTarget requestTarget) {
return null;
}

@Override
public String getMountPath() {
return "Images";
}

@Override
public boolean matches(IRequestTarget requestTarget) {
return false;
}

public boolean matches(String path) {
return path.startsWith("Images/") && path.endsWith(".png");
}

@Override
public boolean matches(String path, boolean arg1) {
return matches(path);
}

}






On 23-Mar-09, at 1:12 AM, Jan Kriesten wrote:



Hi Brill,

what about setting up an "error page" using the standard servlet  
method

that points to a wicket page?


the point is: you will still get a 404 error code for the page  
(which the

user/search engine shouldn't, since it's not an error).

Best regards, --- Jan.

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




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



Re: handling not mounted URLs

2009-03-22 Thread Jeremy Thomerson
Maybe I'm just sleepy - but where did you put that code?  It's not java.




On Mon, Mar 23, 2009 at 1:00 AM, Jan Kriesten wrote:

>
> Hi Jeremy,
>
> > Can you mount another filter that, if Wicket does not respond, instead
> > responds with either a valid page or a redirect back to a valid Wicket
> page?
>
> no, that's no option. I got the ErrorPage-Version working in the way that I
> manually set the status code with
>
> val uri = req.getAttribute( "javax.servlet.error.request_uri"
> ).asInstanceOf[String]
> if( uri!=null ) {
>  val res = getResponse.asInstanceOf[WebResponse].getHttpServletResponse
>  res.setStatus( 200 )
> }
>
> That way you get a 200 on the client.
>
> Best regards, --- Jan.
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: handling not mounted URLs

2009-03-22 Thread Jan Kriesten

Hi Jeremy,

> Can you mount another filter that, if Wicket does not respond, instead
> responds with either a valid page or a redirect back to a valid Wicket page?

no, that's no option. I got the ErrorPage-Version working in the way that I
manually set the status code with

val uri = req.getAttribute( "javax.servlet.error.request_uri" 
).asInstanceOf[String]
if( uri!=null ) {
  val res = getResponse.asInstanceOf[WebResponse].getHttpServletResponse
  res.setStatus( 200 )
}

That way you get a 200 on the client.

Best regards, --- Jan.



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



Re: handling not mounted URLs

2009-03-22 Thread Jeremy Thomerson
Can you mount another filter that, if Wicket does not respond, instead
responds with either a valid page or a redirect back to a valid Wicket page?

--
Jeremy Thomerson
http://www.wickettraining.com



On Mon, Mar 23, 2009 at 12:12 AM, Jan Kriesten
wrote:

>
> Hi Brill,
>
> > what about setting up an "error page" using the standard servlet method
> > that points to a wicket page?
>
> the point is: you will still get a 404 error code for the page (which the
> user/search engine shouldn't, since it's not an error).
>
> Best regards, --- Jan.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: handling not mounted URLs

2009-03-22 Thread Jan Kriesten

Hi Brill,

> what about setting up an "error page" using the standard servlet method
> that points to a wicket page?

the point is: you will still get a 404 error code for the page (which the
user/search engine shouldn't, since it's not an error).

Best regards, --- Jan.

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



Re: handling not mounted URLs

2009-03-22 Thread Brill Pappin
what about setting up an "error page" using the standard servlet  
method that points to a wicket page?


There are a few different ways you can capture errors:

in the web.xml for instance you can use a construct something like  
(check the syntax):


 
javax.servlet.ServletException
/mypath


of to capture an HTTP error:


404
/mypath


So just mount a page at that path and your page should get called when  
you get an error.




- Brill

On 23-Mar-09, at 12:20 AM, Jan Kriesten wrote:



Hi,

I've set up a Wicket application as ROOT with URL pattern /* and  
have some

mounts on it.

Now I want all unmounted stuff handled thru the Homepage-class (i.e.  
get the

path-info for a redirect). Is there a way to do this?

ATM, I get a "404 : /test/ was not found on this server." when calling
http://localhost:8080/test/

Best regards, --- Jan.


-
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



handling not mounted URLs

2009-03-22 Thread Jan Kriesten

Hi,

I've set up a Wicket application as ROOT with URL pattern /* and have some
mounts on it.

Now I want all unmounted stuff handled thru the Homepage-class (i.e. get the
path-info for a redirect). Is there a way to do this?

ATM, I get a "404 : /test/ was not found on this server." when calling
http://localhost:8080/test/

Best regards, --- Jan.


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



Wicket serialization problems for OSGi users

2009-03-22 Thread David Leangen

I know there have been a few people inquiring about this from time to
time.

I write about my experiences here, in the hope that this is helpful:

  http://bioscene.blogspot.com/2009/03/serialization-in-osgi.html



Cheers,
=David




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



AjaxGoFilter

2009-03-22 Thread taha siddiqi
Hi

I was working on AjaxFallbackDataTable and FilterForm.

Although there is a GoFilter but there is no AjaxGoFilter. Am I
missing something here ?

Thankyou
taha

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



Re: eclipse and html extensions in src/main/java

2009-03-22 Thread Brill Pappin

Fund the culprit.
The stack trace below suggests its MoreUnit (a handy little plugin  
particularly for those that use TDD)


!ENTRY org.eclipse.ui.workbench 4 2 2009-03-22 19:08:25.463
!MESSAGE Problems occurred when invoking code from plug-in:  
"org.eclipse.ui.workbench".

!STACK 0
java.lang.IllegalArgumentException: Compilation unit name must end  
with .java, or one of the registered Java-like extensions
	at  
org 
.eclipse 
.jdt 
.internal.core.PackageFragment.getCompilationUnit(PackageFragment.java: 
214)
	at  
org 
.eclipse 
.jdt 
.internal 
.core.JavaModelManager.createCompilationUnitFrom(JavaModelManager.java: 
881)
	at  
org.eclipse.jdt.core.JavaCore.createCompilationUnitFrom(JavaCore.java: 
2503)
	at  
org 
.moreunit 
.elements.EditorPartFacade.getCompilationUnit(EditorPartFacade.java:43)
	at  
org 
.moreunit 
.annotation 
.MoreUnitAnnotationModel 
.updateAnnotations(MoreUnitAnnotationModel.java:170)
	at  
org 
.moreunit 
.annotation 
.MoreUnitAnnotationModel.(MoreUnitAnnotationModel.java:67)
	at  
org 
.moreunit 
.annotation 
.MoreUnitAnnotationModel.attach(MoreUnitAnnotationModel.java:132)
	at  
org 
.moreunit 
.annotation 
.AnnotationUpdateListener.partOpened(AnnotationUpdateListener.java:43)
	at org.eclipse.ui.internal.PartListenerList 
$5.run(PartListenerList.java:132)

at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)



On 22-Mar-09, at 4:29 PM, Thomas Mäder wrote:

Bill, if you have a stack trace in the log, we might take a stab at  
guessing

the culprit (it's not often the base Eclipse tooling, but some add-on
plugin).

Thomas

On Sun, Mar 22, 2009 at 9:18 PM, Brill Pappin  wrote:


Hmm, I'll have to investigate.
I *don't* get it when I have it set up with the HTML in the resourses
folder.


- Brill Pappin
Sent from my mobile.


On 22-Mar-09, at 1:58 PM, Igor Vaynberg   
wrote:


if you get this error then you are screwed whether the markup fles  
are

in src/main/java or src/main/resources because they are both
configured as classpath folders in eclipse.

anyways, im using the latest 3.4 and dont have this problem.

-igor

On Sun, Mar 22, 2009 at 10:04 AM, Brill Pappin   
wrote:


I get the HTML editor as well but I also get some dialog popping  
up when

I
load the HTML from the src.

I just updates to the latest this morning, so maybe there is  
something

new.

- Brill Pappin
Sent from my mobile.


On 22-Mar-09, at 12:38 PM, John Krasnay  wrote:

Works fine for me without any special configuration. I use the  
Eclipse

JEE version and HTML files come up in the HTML Editor.

Check which editor is associated with *.html files under Window >
Preferences, then under General/Editors/File Associations.

Eclipse remembers the last editor you used to open a particular  
file, so
you might have to right-click the file in Package Explorer and  
select

Open With > HTML Editor.

jk

On Sun, Mar 22, 2009 at 12:24:38PM -0400, Brill Pappin wrote:



So eclipse is having trouble with the html extension files in  
the java

source directory.

I set up a demo for Wicket Skunkworks to demo the components  
we're
working on, and I used the "standard wicket pattern" of putting  
the
html alongside the java in order to make things clearer to how  
must
people expect to see a wicket project, however Eclipse is  
complaining
every time I open an HTML resource saying that its expecting a  
source

file:

An error has occurred. See error log for more details.
Compilation unit name must end with .java, or one of the
registered Java-like extensions

Aside form registering an HTML extension as a compilation unit,  
does

anyone know how to resolve this annoying issue?

This is the first time I have run across it because up until  
now I

have kept my resources in src/main/resources.

- Brill

-
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





--
Wicket & Eclipse Consulting
www.devotek-it.ch
thomasmaeder.blogspot.com



-
To unsubscribe, e-mail:

Re: Why are we top-posting...

2009-03-22 Thread Thomas Mäder
Nazis!

And now that this thread is dead, we can all go and enjoy our lives ;-)

Thomas

On Sun, Mar 22, 2009 at 6:50 AM, taha siddiqi  wrote:

> Now you all get a gun and shoot me :)
>
> I got your point
>
> How many times 
>
> No No No .. Enough 
>
> This is a declaration 
>
> I, TAHA, WILL NEVER SAY THAT TOP POSTING IS BAD OR BOTTOM POSTING IS
> GOOD
>
> CLOSE THIS POST... PLEASE .
>
> taha
> (internally still a bottom-poster by heart)
>
>
> On Sat, Mar 21, 2009 at 2:59 PM, Stephen Swinsburg
>  wrote:
> > You read text from bottom to top?
> >
> > I thought this was dead and buried, people can post however they like and
> we
> > are not going to conform to someone's 'standard'. Think of it this way,
> it's
> > a mailing list where people write and read emails. How do you read and
> write
> > your email? Pretty sure you'd hit a quick 'Reply' and type your message
> at
> > the top like 99% of the rest of the world? Why change it for a mailing
> list?
> > It's not designed so that one final post has every piece of information
> in
> > it, that is what threads are for. What if someone erases part of the
> email
> > when they reply? You'd be stuffed then!
> >
> >
> >
> > On 21/03/2009, at 5:50 AM, C. Bergström wrote:
> >
> >> A: Because it messes up the order in which people normally read text.
> >> Q: Why is it such a bad thing?
> >> A: Top-posting.
> >> Q: What is the most annoying thing on usenet and in e-mail?
> >>
> >> -
> >> 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
>
>


-- 
Wicket & Eclipse Consulting
www.devotek-it.ch
thomasmaeder.blogspot.com


Re: eclipse and html extensions in src/main/java

2009-03-22 Thread Thomas Mäder
Bill, if you have a stack trace in the log, we might take a stab at guessing
the culprit (it's not often the base Eclipse tooling, but some add-on
plugin).

Thomas

On Sun, Mar 22, 2009 at 9:18 PM, Brill Pappin  wrote:

> Hmm, I'll have to investigate.
> I *don't* get it when I have it set up with the HTML in the resourses
> folder.
>
>
> - Brill Pappin
>  Sent from my mobile.
>
>
> On 22-Mar-09, at 1:58 PM, Igor Vaynberg  wrote:
>
>  if you get this error then you are screwed whether the markup fles are
>> in src/main/java or src/main/resources because they are both
>> configured as classpath folders in eclipse.
>>
>> anyways, im using the latest 3.4 and dont have this problem.
>>
>> -igor
>>
>> On Sun, Mar 22, 2009 at 10:04 AM, Brill Pappin  wrote:
>>
>>> I get the HTML editor as well but I also get some dialog popping up when
>>> I
>>> load the HTML from the src.
>>>
>>> I just updates to the latest this morning, so maybe there is something
>>> new.
>>>
>>> - Brill Pappin
>>>  Sent from my mobile.
>>>
>>>
>>> On 22-Mar-09, at 12:38 PM, John Krasnay  wrote:
>>>
>>>  Works fine for me without any special configuration. I use the Eclipse
 JEE version and HTML files come up in the HTML Editor.

 Check which editor is associated with *.html files under Window >
 Preferences, then under General/Editors/File Associations.

 Eclipse remembers the last editor you used to open a particular file, so
 you might have to right-click the file in Package Explorer and select
 Open With > HTML Editor.

 jk

 On Sun, Mar 22, 2009 at 12:24:38PM -0400, Brill Pappin wrote:

>
> So eclipse is having trouble with the html extension files in the java
> source directory.
>
> I set up a demo for Wicket Skunkworks to demo the components we're
> working on, and I used the "standard wicket pattern" of putting the
> html alongside the java in order to make things clearer to how must
> people expect to see a wicket project, however Eclipse is complaining
> every time I open an HTML resource saying that its expecting a source
> file:
>
>  An error has occurred. See error log for more details.
>  Compilation unit name must end with .java, or one of the
> registered Java-like extensions
>
> Aside form registering an HTML extension as a compilation unit, does
> anyone know how to resolve this annoying issue?
>
> This is the first time I have run across it because up until now I
> have kept my resources in src/main/resources.
>
> - Brill
>
> -
> 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
>
>


-- 
Wicket & Eclipse Consulting
www.devotek-it.ch
thomasmaeder.blogspot.com


Re: eclipse and html extensions in src/main/java

2009-03-22 Thread Brill Pappin

Hmm, I'll have to investigate.
I *don't* get it when I have it set up with the HTML in the resourses  
folder.



- Brill Pappin
  Sent from my mobile.


On 22-Mar-09, at 1:58 PM, Igor Vaynberg  wrote:


if you get this error then you are screwed whether the markup fles are
in src/main/java or src/main/resources because they are both
configured as classpath folders in eclipse.

anyways, im using the latest 3.4 and dont have this problem.

-igor

On Sun, Mar 22, 2009 at 10:04 AM, Brill Pappin   
wrote:
I get the HTML editor as well but I also get some dialog popping up  
when I

load the HTML from the src.

I just updates to the latest this morning, so maybe there is  
something new.


- Brill Pappin
 Sent from my mobile.


On 22-Mar-09, at 12:38 PM, John Krasnay  wrote:

Works fine for me without any special configuration. I use the  
Eclipse

JEE version and HTML files come up in the HTML Editor.

Check which editor is associated with *.html files under Window >
Preferences, then under General/Editors/File Associations.

Eclipse remembers the last editor you used to open a particular  
file, so
you might have to right-click the file in Package Explorer and  
select

Open With > HTML Editor.

jk

On Sun, Mar 22, 2009 at 12:24:38PM -0400, Brill Pappin wrote:


So eclipse is having trouble with the html extension files in the  
java

source directory.

I set up a demo for Wicket Skunkworks to demo the components we're
working on, and I used the "standard wicket pattern" of putting the
html alongside the java in order to make things clearer to how must
people expect to see a wicket project, however Eclipse is  
complaining
every time I open an HTML resource saying that its expecting a  
source

file:

  An error has occurred. See error log for more details.
  Compilation unit name must end with .java, or one of the
registered Java-like extensions

Aside form registering an HTML extension as a compilation unit,  
does

anyone know how to resolve this annoying issue?

This is the first time I have run across it because up until now I
have kept my resources in src/main/resources.

- Brill

--- 
--

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



Wicket-auth-roles + EJB 3 (Authentication and Authorization)

2009-03-22 Thread Barry van Someren
Hi all,

I've been busy on a project of mine that uses Wicket 1.4 RC 2 as a
frontend to a collection of EJB3 beans containing my business logic.
As users of this application will be able to use webservices as well
to use the application I'd also like to use authentication and more
importantly authorization on the side of the EJB's

I'm fairly familiar with EJB security but not very familiar with
Wicket security and I'm wondering what is the best course of action to
authenticate a user inside the Wicket application AND to put these
credentials inside the EJBContext?
I'm looking at 
http://cwiki.apache.org/WICKET/servlet-container-authentication.html
and seeing if I can somehow integrate the two, but it sounds a bit
like a hack.

Any other suggestions worth looking at?
Google is not returning much unfortunately.

Many thanks!

-- 
Barry van Someren
---
Linked in: http://www.linkedin.com/in/barryvansomeren
Skype: BvsomerenSprout
WWW: http://java-monitor.com/forum/index.php

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



Re: eclipse and html extensions in src/main/java

2009-03-22 Thread Igor Vaynberg
if you get this error then you are screwed whether the markup fles are
in src/main/java or src/main/resources because they are both
configured as classpath folders in eclipse.

anyways, im using the latest 3.4 and dont have this problem.

-igor

On Sun, Mar 22, 2009 at 10:04 AM, Brill Pappin  wrote:
> I get the HTML editor as well but I also get some dialog popping up when I
> load the HTML from the src.
>
> I just updates to the latest this morning, so maybe there is something new.
>
> - Brill Pappin
>  Sent from my mobile.
>
>
> On 22-Mar-09, at 12:38 PM, John Krasnay  wrote:
>
>> Works fine for me without any special configuration. I use the Eclipse
>> JEE version and HTML files come up in the HTML Editor.
>>
>> Check which editor is associated with *.html files under Window >
>> Preferences, then under General/Editors/File Associations.
>>
>> Eclipse remembers the last editor you used to open a particular file, so
>> you might have to right-click the file in Package Explorer and select
>> Open With > HTML Editor.
>>
>> jk
>>
>> On Sun, Mar 22, 2009 at 12:24:38PM -0400, Brill Pappin wrote:
>>>
>>> So eclipse is having trouble with the html extension files in the java
>>> source directory.
>>>
>>> I set up a demo for Wicket Skunkworks to demo the components we're
>>> working on, and I used the "standard wicket pattern" of putting the
>>> html alongside the java in order to make things clearer to how must
>>> people expect to see a wicket project, however Eclipse is complaining
>>> every time I open an HTML resource saying that its expecting a source
>>> file:
>>>
>>>   An error has occurred. See error log for more details.
>>>   Compilation unit name must end with .java, or one of the
>>> registered Java-like extensions
>>>
>>> Aside form registering an HTML extension as a compilation unit, does
>>> anyone know how to resolve this annoying issue?
>>>
>>> This is the first time I have run across it because up until now I
>>> have kept my resources in src/main/resources.
>>>
>>> - Brill
>>>
>>> -
>>> 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: eclipse and html extensions in src/main/java

2009-03-22 Thread Brill Pappin
I get the HTML editor as well but I also get some dialog popping up  
when I load the HTML from the src.


I just updates to the latest this morning, so maybe there is something  
new.


- Brill Pappin
  Sent from my mobile.


On 22-Mar-09, at 12:38 PM, John Krasnay  wrote:


Works fine for me without any special configuration. I use the Eclipse
JEE version and HTML files come up in the HTML Editor.

Check which editor is associated with *.html files under Window >
Preferences, then under General/Editors/File Associations.

Eclipse remembers the last editor you used to open a particular  
file, so

you might have to right-click the file in Package Explorer and select
Open With > HTML Editor.

jk

On Sun, Mar 22, 2009 at 12:24:38PM -0400, Brill Pappin wrote:
So eclipse is having trouble with the html extension files in the  
java

source directory.

I set up a demo for Wicket Skunkworks to demo the components we're
working on, and I used the "standard wicket pattern" of putting the
html alongside the java in order to make things clearer to how must
people expect to see a wicket project, however Eclipse is complaining
every time I open an HTML resource saying that its expecting a source
file:

   An error has occurred. See error log for more details.
   Compilation unit name must end with .java, or one of the
registered Java-like extensions

Aside form registering an HTML extension as a compilation unit, does
anyone know how to resolve this annoying issue?

This is the first time I have run across it because up until now I
have kept my resources in src/main/resources.

- Brill

-
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: eclipse and html extensions in src/main/java

2009-03-22 Thread John Krasnay
Works fine for me without any special configuration. I use the Eclipse
JEE version and HTML files come up in the HTML Editor.

Check which editor is associated with *.html files under Window >
Preferences, then under General/Editors/File Associations.

Eclipse remembers the last editor you used to open a particular file, so
you might have to right-click the file in Package Explorer and select
Open With > HTML Editor.

jk

On Sun, Mar 22, 2009 at 12:24:38PM -0400, Brill Pappin wrote:
> So eclipse is having trouble with the html extension files in the java  
> source directory.
> 
> I set up a demo for Wicket Skunkworks to demo the components we're  
> working on, and I used the "standard wicket pattern" of putting the  
> html alongside the java in order to make things clearer to how must  
> people expect to see a wicket project, however Eclipse is complaining  
> every time I open an HTML resource saying that its expecting a source  
> file:
> 
> An error has occurred. See error log for more details.
> Compilation unit name must end with .java, or one of the  
> registered Java-like extensions
> 
> Aside form registering an HTML extension as a compilation unit, does  
> anyone know how to resolve this annoying issue?
> 
> This is the first time I have run across it because up until now I  
> have kept my resources in src/main/resources.
> 
> - Brill
> 
> -
> 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



eclipse and html extensions in src/main/java

2009-03-22 Thread Brill Pappin
So eclipse is having trouble with the html extension files in the java  
source directory.


I set up a demo for Wicket Skunkworks to demo the components we're  
working on, and I used the "standard wicket pattern" of putting the  
html alongside the java in order to make things clearer to how must  
people expect to see a wicket project, however Eclipse is complaining  
every time I open an HTML resource saying that its expecting a source  
file:


An error has occurred. See error log for more details.
Compilation unit name must end with .java, or one of the  
registered Java-like extensions


Aside form registering an HTML extension as a compilation unit, does  
anyone know how to resolve this annoying issue?


This is the first time I have run across it because up until now I  
have kept my resources in src/main/resources.


- Brill

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



Gravatar image component, help with urls

2009-03-22 Thread Brill Pappin
I'm creating a new component to access Gravatar (see: http://en.gravatar.com/) 
.


I wanted to just extend the components the make Image work, because I  
wanted it to work just like an Image and fall back to a standard image  
if the Gavatar image was not present. Unfortunately almost everything  
in Image and its supporting class LocalizedImageResource is final, so  
I ended up having to clone the source.


My problem now is that I need to generate an absolute URI for the  
image resource and I'm not sure what the best way to do that is.
Right now the code is simply using the urlFor method to get an  
application relative path for the resource.


Component.urlFor(ResourceReference)

Is there a way to get the absolute URI of the resource, as in  
including the http://hostname:port/path ??
That URI will be url encoded and passed to Gavatar so that it can fall  
back to it if it doesn't have an avatar image.


If anyone else is interested in helping to improve it, the source is at:
http://wicket-skunkworks.googlecode.com/svn/trunk/wicket-shoebox/
in the wicket skunkworks project.


- Brill 


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



Re: load html according to page parameters

2009-03-22 Thread Brill Pappin
I think for that you might try setting the variation based on the  
parameter.
This would allow you to load different HTML content using the standard  
mechanism.


- Brill

On 22-Mar-09, at 7:17 AM, Vitek Tajzich wrote:


Hi,

I would like to load HTML according to page parameters. So If I get  
as page
parameter "page1" a need to get page1.html or page1_en.html and so  
on...


Any guess?


thank you,

Vitek



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



Re: Wicketstuff Core Dependency Management...

2009-03-22 Thread James Carman
Well, I went ahead and checked in my changes to the pom files to "fix"
this issue.  I would urge all of the project owners out there to make
sure everything looks okay to them.  I did change one library's code
to get stuff working.  One library was directly using the Log4J API
for logging and I considered that bad style, especially since the
wicket community has the opportunity to use the slf4j to adapt to any
logging environment.

On Sat, Mar 21, 2009 at 12:55 PM, James Carman
 wrote:
> I don't mind fixing it at all, but I do believe it should be fixed.  I
> spent a LONG time trying to figure out why my dependencies were
> showing up as "provided" when I clearly set them up in my pom as the
> default scope (compile).
>
>
> On Sat, Mar 21, 2009 at 12:27 PM, Jeremy Thomerson
>  wrote:
>> I'm totally in favor of anyone who knows more about Maven than me to fix it. 
>>  I didn't know about the transitive dependency issue.
>>
>> Here are two things that I would add, though:
>> - other than wicket itself, I don't think the parent should add any required 
>> dependencies - many subprojects may not need them
>>
>> - you should only make the change if you're willing to fix anything that you 
>> break.  That's part of the deal.  Running a mvn clean install and a mvn 
>> site:deploy (it's not deploy, but I can't remember - anyway the site 
>> generation is working and should be tested)
>>
>> Jeremy Thomerson
>> http://www.wickettraining.com
>> -- sent from a wireless device
>>
>>
>> -Original Message-
>> From: James Carman 
>> Sent: Saturday, March 21, 2009 10:17 AM
>> To: users@wicket.apache.org
>> Subject: Re: Wicketstuff Core Dependency Management...
>>
>> Wicket itself doesn't declare the dependencies this way.  So, why
>> should wicketstuff-core?
>>
>> On Sat, Mar 21, 2009 at 11:11 AM, James Carman
>>  wrote:
>>> But, I shouldn't *have* to do that, Brill.  That's the whole point.
>>> Breaking transitive dependency resolution is a bad thing in the maven
>>> world.  We're handing dependencies the wrong way if we're breaking
>>> stuff.
>>>
>>> On Sat, Mar 21, 2009 at 11:07 AM, Brill Pappin  wrote:
 Actually that might mess up the rest of us :)

 If you need those lobs to be includes, simply add them to you pom and 
 change
 their scope so they are included... The build should then override the
 provided scope in the parent.

 - Brill Pappin
  Sent from my mobile.


 On 21-Mar-09, at 9:01 AM, James Carman  wrote:

> The dependencies in the main wicketstuff-core are "scoped" for stuff
> like slf4j and jetty to be "provided".  This totally screwed me up
> when I was trying to write an example application (the log4j stuff
> wasn't showing up because it was marked as provided by the parent
> pom).  Does anyone care if I remove the scope declarations from the
>  section in the wicketstuff-core parent pom?  It
> fixed my problem when I did.
>
> James
>
> -
> 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



load html according to page parameters

2009-03-22 Thread Vitek Tajzich
Hi,

I would like to load HTML according to page parameters. So If I get as page
parameter "page1" a need to get page1.html or page1_en.html and so on...

Any guess?


thank you,

Vitek


Feedback panel problem

2009-03-22 Thread Eyal Golan
Hello,
I am working on a code that someone wrote more than a year ago. (We have
Wicket legacy code already :) )
In the page, there's a FeedbackPanel.

In the constructor, there are some validations. If a validation fails, we
put it in the feedback panel using error(...) .
When opening the page we get the following message and exception:
2009-03-22 12:04:05,941 ERROR [org.apache.wicket.markup.html.WebPage] -
^
2009-03-22 12:04:05,941 ERROR [org.apache.wicket.markup.html.WebPage] - You
probably forgot to add a  or  tag to your markup since no
Header Container was
found but components where found which want to write to the  section.
...[Our code to the header)
2009-03-22 12:04:05,941 ERROR [org.apache.wicket.markup.html.WebPage] -
^
2009-03-22 12:04:05,957 ERROR [org.apache.wicket.RequestCycle] - Error
attaching this container for rendering: [MarkupContainer [Component id =
feedbackul, page = com.eurekify.web.selfservice.RolesSelfServicePage, path =
3:form:feedback:feedbackul.FeedbackPanel$2, isVisible = true, isVersioned =
false]]
org.apache.wicket.WicketRuntimeException: Error attaching this container for
rendering: [MarkupContainer [Component id = feedbackul, page =
com.eurekify.web.selfservice.RolesSelfServicePage, path =
3:form:feedback:feedbackul.FeedbackPanel$2, isVisible = true, isVersioned =
false]]
at
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1601)
at org.apache.wicket.Component.onBeforeRender(Component.java:3684)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1003)
at org.apache.wicket.Component.beforeRender(Component.java:1035)
at
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1589)
at org.apache.wicket.Component.onBeforeRender(Component.java:3684)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1003)
at org.apache.wicket.Component.prepareForRender(Component.java:2168)
at org.apache.wicket.Page.renderPage(Page.java:884)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1177)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1248)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1349)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:387)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
at
com.eurekify.security.SecurityFilter.doFilterInternal(SecurityFilter.java:38)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:285)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
Caused by: java.lang.NullPointerException
at
org.apache.wicket.markup.html.panel.FeedbackPanel.newMessageDisplayComponent(FeedbackPanel.java:324)
at
org.apache.wicket.markup.html.panel.FeedbackPanel$MessageListView.populateItem(FeedbackPanel.java:88)
at
org.apache.wicket.markup.html.list.ListView.onPopulate(ListView.java:573)
at
org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:127)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1003)
at org.apache.wicket.Component.beforeRender(Component.

Re: Extensible wicket application

2009-03-22 Thread Brill Pappin

I'm assuming your using the 1.4 snapshot...

I think that images will be relative to the component (or at least one  
if them up the tree).


The image component uses a resource that will use the arc attribute to  
look for the images, so if the arc attribute is bogus, then one of the  
other methods of locating it better be correct.


- Brill Pappin
  Sent from my mobile.


On 21-Mar-09, at 5:29 PM, Daniel Dominik Holúbek  
 wrote:



Ernesto, thank you very much :)
If my application ever goes to the production, it will be thanks to  
you :)


Regarding the images problem: I think I did not explain it well. I'm  
not
asking where to place them. I placed them almost everywhere, but I  
still
can't access them - in the bundle. You see, I have an "images"  
directory,
and in HTML files, I am accessing them as "img src="images/ 
blah.jpg", but I
still can't get this working. I am expecting only a hint - how are  
you doing

this?

And the database problem - I have the same application deployed as  
standard
webapp, and there it works. I only wanted to know if it isn't some  
specific

Wicket-Hibernate-OSGi problem you might have solved before :)

But thank you all again!

On Sat, Mar 21, 2009 at 6:06 PM, Brill Pappin  wrote:

Yah, the whole argument about where the resources should go or the  
one

before that about top posting or bottom posting.
You'd think we didn't have any actual work to do :)

- Brill


On 21-Mar-09, at 12:39 PM, Ernesto Reinaldo Barreiro wrote:

useless thread?


On Sat, Mar 21, 2009 at 4:17 PM, Brill Pappin   
wrote:


At the risk of starting another useless thread, this is what I do  
for

images and other non HTML resources that are shared:
- if the project is small, they can just sit with the HTML.
- if the project is larger then it might be useful to keep them  
more
separate, under an images directory and use the base page to ref  
them or

even create a loader to manage them.

Ether way, you use them the same way, only prefix the resource  
name with

the subdir if you have separated them out.

As for your db error, that looks like something out side the  
scope of

wicket.

- Brill Pappin
Sent from my mobile.



On 21-Mar-09, at 9:38 AM, Daniel Dominik Holúbek m>

wrote:

Thanks a lot, it works now.

However, two more questions. Where should I place images folder  
and how

should I access it in my html files (or style.css as well)?
And the second one: when i try to insert a record with hibernate  
into my

database, i get this exception:

Batch entry 0 insert into forum.anim_forum (autor, email, title,  
text,

datum, ip, id) values (...) was aborted.

and

org.hibernate.exception.DataException: Could not execute JDBC  
batch

update

Could you (or possibly anyone else) help me with this? :)
Thanks!

On Fri, Mar 20, 2009 at 10:27 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

One more thing. As far as I remember the servlet bridge makes a  
'work



copy'
of the plugins folder if you see you make changes, export the  
plugins,

and
changes do not 'propagate' to the application, try deleting
works/Catalina
folder.

On Fri, Mar 20, 2009 at 9:58 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

Hi Daniel,



I found some time to get it working! The key to the problem was






http://dev.eclipse.org/newslists/news.eclipse.technology.equinox/msg04838.html



So, if you synchronize the projects

com.antilia.wstarter
com.antilia.wstarter.demo

exports them to you bridge it should work. I  attach copy of
bridge.zip,
containing a bridge folder, which is working for me. If you  
unzip it

to

your


tomcat webapps, restart tomcat and go to


http://localhost:8080/bridge/demo-app/

Then you should see the example working.

Best,

Ernesto


On Fri, Mar 20, 2009 at 6:34 AM, Daniel Dominik Holúbek <
dankodo...@gmail.com> wrote:

Right click -> Export -> Plugin development -> Deployable plug- 
ins and



fragments
Have a nice day :)

On Thu, Mar 19, 2009 at 9:32 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

Did you exported them how? As equinox jar files or as simple  
jar




files?





Let




me see if tomorrow I find some time for trying this out  
myself...


Best,

Ernesto

On Thu, Mar 19, 2009 at 9:14 PM, Daniel Dominik Holúbek <
dankodo...@gmail.com> wrote:

Yes,


that's exactly what I did :)
I checked out the bundles, then exported them from eclipse.  
And

then
installed those bundles along with javax.servlet into the  
bridge

application, bud I got the error when I tried to install

wstarter-demo.






Thanks a lot!


On Thu, Mar 19, 2009 at 8:28 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

I couldn't try today to build the example using servlet  
bridge, to




busy





over


here;-), let me see if I can find some time tomorrow to get  
it


working.





But




normally what I would do is use eclipse for development and  
then


export





the




jar to a bridge/plugins for deployment...


Did you read this page

http

Re: Extensible wicket application

2009-03-22 Thread Ernesto Reinaldo Barreiro
Hi Daniel,

Comments in-lined.

On Sat, Mar 21, 2009 at 10:29 PM, Daniel Dominik Holúbek <
dankodo...@gmail.com> wrote:

> Ernesto, thank you very much :)
> If my application ever goes to the production, it will be thanks to you :)
>

You are welcome.


>
> Regarding the images problem: I think I did not explain it well. I'm not
> asking where to place them. I placed them almost everywhere, but I still
> can't access them - in the bundle. You see, I have an "images" directory,
> and in HTML files, I am accessing them as "img src="images/blah.jpg", but I
> still can't get this working. I am expecting only a hint - how are you
> doing
> this?
>
Wicket can read your images from the class-path. If you put them in a
package (e.g. add a file mylogo.jpg to that package) create a class
Images.class on that package and then

public class Images {

public static final ResourceReference MY_LOGO = new
ResourceReference(Images.class,"mylogo.jpg");

}

then you can do



and

add(new Image("logo",Images.MY_LOGO);


> And the database problem - I have the same application deployed as standard
> webapp, and there it works. I only wanted to know if it isn't some specific
> Wicket-Hibernate-OSGi problem you might have solved before :)
>

Ah, sorry, I didn't get the essence of your question on your previous
e-mail. Can you give me a bit more details about the problem?

Just one thing: if you are trying to access things via JNDI you might find
some problems with class-loading in certain application servers (e.g. with
WebSphere). For solving this you have to use a technique consisting in
replacing the OSGi classloader with the WEB-application classloader at the
moment of accesing JNDI object (buddy classloading I think is called). I
can't remember the details by hart but I can try to come up with an example
if need be.

Another thing that might be useful is put a system property, e.g.
"myapp.isin.bridge=true", whe executing the bridge servlet and then have an
utility:

OsgiUtils {
   public static boolean isDeployment() {
   try {
return Boolean.parse(System.getProperty("myapp.isin.bridge"));
   } catch( ) {
return false;
   }
   }
}

So, that you can do:

if(OsgiUtils.isDeployment()) {
   initialize deplayment
} else{
   initialize development
}

e.g. at configuring Wicket application.

Do you think it would be useful to others if I create a Wicky page explaing
the whole settting?

Best

Ernesto



> But thank you all again!
>
> On Sat, Mar 21, 2009 at 6:06 PM, Brill Pappin  wrote:
>
> > Yah, the whole argument about where the resources should go or the one
> > before that about top posting or bottom posting.
> > You'd think we didn't have any actual work to do :)
> >
> > - Brill
> >
> >
> > On 21-Mar-09, at 12:39 PM, Ernesto Reinaldo Barreiro wrote:
> >
> >  useless thread?
> >>
> >> On Sat, Mar 21, 2009 at 4:17 PM, Brill Pappin  wrote:
> >>
> >>  At the risk of starting another useless thread, this is what I do for
> >>> images and other non HTML resources that are shared:
> >>> - if the project is small, they can just sit with the HTML.
> >>> - if the project is larger then it might be useful to keep them more
> >>> separate, under an images directory and use the base page to ref them
> or
> >>> even create a loader to manage them.
> >>>
> >>> Ether way, you use them the same way, only prefix the resource name
> with
> >>> the subdir if you have separated them out.
> >>>
> >>> As for your db error, that looks like something out side the scope of
> >>> wicket.
> >>>
> >>> - Brill Pappin
> >>> Sent from my mobile.
> >>>
> >>>
> >>>
> >>> On 21-Mar-09, at 9:38 AM, Daniel Dominik Holúbek  >
> >>> wrote:
> >>>
> >>> Thanks a lot, it works now.
> >>>
>  However, two more questions. Where should I place images folder and
> how
>  should I access it in my html files (or style.css as well)?
>  And the second one: when i try to insert a record with hibernate into
> my
>  database, i get this exception:
> 
>  Batch entry 0 insert into forum.anim_forum (autor, email, title, text,
>  datum, ip, id) values (...) was aborted.
> 
>  and
> 
>  org.hibernate.exception.DataException: Could not execute JDBC batch
>  update
> 
>  Could you (or possibly anyone else) help me with this? :)
>  Thanks!
> 
>  On Fri, Mar 20, 2009 at 10:27 PM, Ernesto Reinaldo Barreiro <
>  reier...@gmail.com> wrote:
> 
>  One more thing. As far as I remember the servlet bridge makes a 'work
> 
> > copy'
> > of the plugins folder if you see you make changes, export the
> plugins,
> > and
> > changes do not 'propagate' to the application, try deleting
> > works/Catalina
> > folder.
> >
> > On Fri, Mar 20, 2009 at 9:58 PM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> > Hi Daniel,
> >
> >>
> >> I found some time to get it working! The key to the problem was
> >>
> >>
>