Lukas Hnatuk

Greenhorn
+ Follow
since May 31, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Lukas Hnatuk

Hi everyone,
I am trying to do some NatveQueries, but I am stuck with @SqlResultSetMapping configuration.

I have those classes:


My question is, how to write propper @SqlResultSetMapping for class LocalUser. My test SQL statement is


and I would like to get one Entitny Local user, with username user, password passwd and List of roles, where is admin with id 1.

I figgured as far something like this:


but it gives me two objects, instead of one.

Can anybody help me please?

Thanks
Now i see a did the wrong way:))) thank you:)
14 years ago
I have the code from this site: http://www.java2s.com/Code/Java/2D-Graphics-GUI/Scribble.htm
I have also read the oracle swing tutorial, but none of it suits me the way i want and this link suits me the best.
14 years ago
Hello, i am trying to make an application, where i can draw to an image, but i stucked.
My problem is:
A have an image and i need to write something in to with my tablet. But I need not to modify the image itself. And sometimes, i need to clear what i have written before, but also i do not need to modify the image. My idea was to write it to the GlassPane, which was over the JPanel, where the image was displayed. The problem is, when i need to erase the text a write(draw with my tablet) before, i remove the picture at the background too.
Here is the code, where i draw to the image:
currentAction:

The funtion reaint the parent is called everyTime the component need to be repainted.
And here is the code of the windows, where i am drawing(writing)

The Rewitable GlassPane is only update JPanel like this:


Can someone please give me some guide, how to to erase the things i drew before?
Lets assume a make a pencil(currentAction) and i need a eraser:))))
14 years ago
Hi,
I was wondered, if there is some way to do method in my Managed Bean iwth parameter. My problem is, that i am trying to do one menu based on roles of user and I need to do component, which would be able to do it.
Eg.


and in managed bean, i would like to have method like this


Is there some way to do this?
14 years ago
JSF
Once again thank you very much.)))) It was you(about moth ago here) who told me, that DIY filter is stupid think and tell me to do it by JAAS and it is you again, who help me out of darkness:)))
14 years ago
JSF
HI, i am trying to do authentication in JSF app, but i stuck. I found, one way is to do it by the JAAS and some realm. I choose jdbcRealm and everything was fine, until I need to display some message to the user(eg you have enterred wrong password(but i do not want to redirect him elsewhere). Another probem is how to redirect the user after the login. Is there any way to do it? I try to google it, but i have found nothing, which was usefull. And my last questing is. Do I have to you the form with j_username, j_password.., or can I do it by some JSF components?
14 years ago
JSF
Hi, i am trying to develop JSF based application with JAAS, but i stuck over a 3 weeks with it and I would appriciate some help:).
I have a login page, lets assume it looks like this:

After login, I get the usenmae and password to the loginManagedBean a call my EJB. EJB has this method:

I do the authentication and if i did lc.getSubject() i see the thinks i need.
Here is the problem: When i leave this method, i cannot find any way get the Subject i just logged in. Is there some way, or i am doing it completly wrong.
The reason why I do not want to use j_username with j_password and some realm is, that I would like to have more control over application(eg redirecting each user to a different page(admins,users...) and i cant find the way.
Can you please tell me, what I am doing wrong, or post some little code, to understand this.
I read the JAAS tutorials, but still i am a lot confused.

My second questin is, how do I find the roles i put to the user?

Here is the LoginModule login and commit methods ( i found some tutorial here, so they are only copied from here:

14 years ago

Tim Holloway wrote:Once you've been around here a while, you'll get mightily sick of hearing me denounce "Do It Yourself" J2EE security systems. I've a list about 12 items long as to why they're a bad idea, and one of them is because this kind of stuff is already, debugged, working and documented in the standard J2EE-defined security framework. Meaning you can spend your time on more profitable endeavours since the J2EE implementers have already done all the dirty work for you. Including figuring out how people would get around it.


If you can tell me some tip, i would be more than glad for it.
I start with JSecurity(now it is Shiro), which was fine, but most of its items did not work. Then I heard about Spring Security, but after two days of trying to understand, how it works i gave up. The same was with JAAS... After more than two weeks of trying,i realized, that most effective would be to do it myself.
14 years ago
JSF
I have a little problem. I tried to do my own filter to determine, which role can acces which part of site. Everithing works fine, until i sent navigation from backing bean.
EG:
In page:

with BackingBean:

When I in filter use this methods:


I am able to say, which page I acces,but only, when I use <h:link>. If i acces to the page from <h:link>, or from browser, everithing is fine. But when I click to the button and execute the perform method, i canĀ“t say, where i was redirected, because only information, i get is index.xhtml, but i need to see private/index.xhtml. Is there any way to fix this?
14 years ago
JSF