Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Michael Houlo

Ranch Hand
+ Follow
since Jun 07, 2010
Belgium
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Michael Houlo

Mudassar Hakim wrote:Hi, what you have mentioned is definitely weird. So let me ask you from the basic, have you repeated the mentioned problem scenario for 3-4 times& received the same behavior again & again also are you pretty sure this is happening when you access using the admin credentials (just a little bit doubtful, you know the saying to err is human) . , Do let me know more about your observation on the same.
Regards



Dear,
I repeated it x times, always the same issue. However, as my AdminController, I was using an AbstractController and now I'm using a SimpleFormController.
Don't ask me why, but now, the USER can't access the admin page anymore.. But I have the opposite scenario, When the User disconnects, If I log in as an ADMIN and then access the Admin page trought the URL, I have access denied.. If i used the admin link, I'm granted to access the page.
So the problem is in the cache i guess...
9 years ago
Dear,

I'm using the Intercept-url tag from Spring Security to control the access of my Admin page.
It works like a charm but I have a problem in one situation.
If I log in as an ADMIN, my admin page link is visible. When I click on it, I access the admin page.
If I log in as an USER, my admin page link is not visible. If I try to access it trought the URL /admin.html, i'm redirected to the "access denied page".

However, if I'm logged in as an ADMIN and then disconnect trought the disconnect button (And I do NOT close the browser), when I log in as an USER the admin page link is still not visible but when i try to access it trought the url /admin.html, it works and i'm authentified as an admin.. If I click on another link, I'm again logged in as an user..

Pretty weird, I don't understand.
Here are my files :

applicationContext-security.xml


UserDetailsServiceImpl :


If you need anything else, tell me
Thanks a lot for your help guys
9 years ago

David O'Meara wrote:Can you post the solution please?
I'm guessing your JNDI URL was incorrect.



You're right.
I had to specify a new dependency in my geronimo-web.xml using this synthax : <dep:artifactId>jdbc_oracleJndi</dep:artifact>
and then link it this way :


Hope it helps.
Dear,

I'm trying to use my application server connection pool trought Hibernate.

When i use hibernate without a connection pool, it works.
When i use my connection pool without hibernate, it works.
When i use my connection pool with hibernate, i've got the following error :


my web.xml :

my geronimo.xml

my hibernate.cfg.xml


I use a "HibernateUtil" class, the error appears at the following code line :


Could you please tell me what am I missing ?
I tryed X different configurations, always the same problem..
Thanks a lot !
Dear,

My bean id is generated by an oracle sequence which is incremented and affected by a trigger.
I have to specify it in my bean, i see a lot of example on internet, but always with xml files... I'm using annotations..

Here is what i tryed :

I have an unknown property "TAB_ID"

If i disable the oracle trigger and use this following code, it works.. Hibernate will manage the sequence, but that's not what i want..


Since the bean doesn't know the id is managed by oracle, when i do "save(myObj)", the record is correctly inserted, but the id returned is "0" ..
Furthermore, when i use saveOrUpdate(myObj), even if the id already exist (i'm updating an existing record), hibernate will insert a new record instead of updating the existing one...

Could you tell me how to do ?
Thanks a lot !

Shiaber Shaam wrote:Thanks, But, what about HBM files? when do we choose to use it?



Thing is : hbm files are just xml files with just a .hbm extension to highlight the fact that your xml file is an hibernate configuration file...
Dear,

My SimpleFormController send a Customer(commandclass) object to my jsp which display client information.
A customer may have multiple contacts (Contact is another object which is not the commandClass).
If you click on edit on a contact, a form appears with the selected contact information.
I only can send the new information to the Controller trought the request object since it's not the commandClass...
Then, how can i use a Validator to check values ??

I'm able to save/update but not to use a validator..

Here is part of my SimpleFormController :


Here is part of my jsp :


Could you please tell me how can I do it ? What's the good way to do it ?
Thanks
9 years ago
I don't really get it .. What do you mean ?
You just want to populate a dropdown list with another table as input data ? somethings like this ?
If so, just use your referenceData method.
9 years ago

Mark Spritzler wrote:Well you can define three different beans with different ids, but the same class, then qualify each instance variable to each of the three beans.

You can also try <bean scope="prototype"

adding scope="prototype" to your bean definition and that might work.

Why do you need three? Does the bean hold any state, if not, one bean should be plenty to support as many clients using it at the same time.

Mark>



The CommonManager instanciate a CommonDao (using Hibernate). The table reached by the DAO depends of the class used to define the CommonManager.
Eg: private CommonManager<Initiative> initiativManager; => the methods getList() or getObjectById(long ident ) of my DAO will reach my Initiative table.
That is why i need three instances... However, since the CommonManager instanciate the CommonDao using @Autowired, the same instance of the bean CommonDao is also used.. So, generating three beans of the same class CommonManager won't resolve the problem since it'll still uses the same CommonDao.

I resolved my problem by using this :
In my Controller :


And the class CommonTypePropertyEditor.java :


It works.
However, i don't understand how come it's possible to use the same instance of an object but with different declarations..
I mean.. I have ONE instance of the CommonManager bean, but once as <TypeLieu>, once as <TypeCommunication> and once with <Initiative>...
Can you explain this ?

Still, i'm going to try your solution.

Thanks a lot for your reply and sorry if my english isn't that good :P
9 years ago
Hello,

I made a common Manager and a common Bean to access different tables of my DB (using hibernate).
In a controller, i'm using @Autowired & @Qualifier to automaticly get my bean.

It works pretty well, but now, i'm facing a problem.

I need multiple instance of the common Manager in my controller.
Here is my code :


Here is a part of my springmvc-servlet.xml


The thing is : tlocationManager, tcommManager and initiativManager are the SAME object !
I need it to be different instances..

I searched on the web and found out that you add to a bean definition an attribute or a property singleton="false".
Unfortunately, i tryed it and i've got an error saying this attribute/property is not valid.

How can i solve it ?
Your help would be really appreciated !
9 years ago
I tought it could have something to do with Spring :/
Hello guys,

I generated Beans from Oracle 10g tables. I have Clob fields.
I want to get info from my form textarea which is injected in my bean. I got the following error :


So i tought i could modify the initBinder to convert my String to clob manually..

I do'nt have a string to clob error anymore, but in my textarea, i have a clob and not the text..

So i modified my bean and added a var String rapCommentString and i converted automaticly the clob as a string.. But no success..

Is there a way to manage it properly ?
If you need any information, just tell me.

Thanks in advance!
Hello guys,

I'm trying to use Spring+Hibernate+tapestry using WASCE 2.
I'm facing this error :

And this is my Login.java class

However, I followed a tutorial (took the sources from it) so it should work.
Furthermore, the line number 16 doesn't send to something special.

The tutorial worked with apache and i'm using WASCE2, There is no Geronimo-web.xml file set.
May the problem come from it ?
Can you tell me what it could be ?
Also, let me know if you need to see another file..

Thanks.
9 years ago
Hello,

I tought it has something to do with Spring since it only appears with projets containing errors.
I'm not making any ear/war file on my own. I'm using the development server, i guess it's making one on its own by compiling classes & jsp's
9 years ago