Shak Smith

Greenhorn
+ Follow
since Feb 19, 2010
Merit badge: grant badges
For More
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 Shak Smith

Hello Mark,
The thing with Dhana's problem is that he wants to access a local variable, So lets keep in mind these three things:
-Is not a property
-Is not a returning value (Although I'm not sure, as you said this one is possible )
-It is not even a parameter of the method.

I've spent some time looking on how to do that, but I didn't find anything. If you have a complete example of what to do that, I'll really
appreciate that.

Regards
13 years ago
Can you please post the code?
(jsp, class, struts.action)
13 years ago
Sorry Dhanaprakash, I didn't see that you were using AOP. I believe that now I understand what you are trying to do.
Here's a complete example. Not sure if this is what you want so please let me know whether this is what you were looking for or not:

Here is the file called SecurityAspect.aj (the Aspect)



Here is the DecisionMaker.java class


Here is the main File


Here is the Application Context file:


13 years ago
Not sure if I understood what you want. But have you tried doing this?


in the application context be sure to have this:

Remember that the singleton definition in Spring is not like the one in the gang of four. Check this link
http://static.springsource.org/spring/docs/2.0.x/reference/beans.html#beans-factory-scopes

Remember that you can be wiring beans in your application context file (it is better to do it there than calling "getBean").
Let me know if this works for you.
13 years ago
Hello guys,
I'm playing with Spring Security 2.0.4 in Spring 2.5. Basically I just want to authenticate users using LDAP.
My configuration is like this:


But in eclipse I get the following error
No setter found for property 'userDn' in class 'org.springframework.security.ldap.DefaultSpringSecurityContextSource'
No setter found for property 'password' in class 'org.springframework.security.ldap.DefaultSpringSecurityContextSource'

I'm wondering why is that happening. In the spring security's page seems to work in that way.
http://static.springsource.org/spring-security/site/docs/2.0.x/reference/ldap.html


How am I supposed to configure DefaultSpringSecurityContextSource to work?
How can I set the admin and the password if they are not available in the DefaultSpringSecurityContextSource ??

Thanks for your help on this.

JUST REALIZE THAT I HAD TO ADD THIS TO THE MAVEN POM (Besides the spring security).
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>1.3.0.RELEASE</version>
</dependency>

13 years ago
Do you know the possible causes with this error??

ConnectionManager:398 - aggressively releasing JDBC connection

I have no idea.
Hello,

I'm using the following to retrieve the bean in json.

But it is not retrieving all the properties of the user bean (like id, firstName, etc). Do I have to do something else for achieving this??
When I use <param name="root">user</param> then it works but I can't use the "excludeProperties" param
Please help!!
13 years ago
Hello,
I have this in my struts.xml file

Basically what I want to do is to add another parameter to the result or modify the param "excludeProperties" to another value. I would like to do this in the com.crm.json.RetrieveUsers class. Is it possible?? If it is, how??
Thanks for your help guys.
13 years ago
I just typed Select e and that worked. Thank you!!!
When I do something like this:


I get the following error
Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.manning.hq.ch04.Event
at com.manning.hq.ch04.EventFinder.main(EventFinder.java:43)
It seems that I have two objects (Event and attendees) instead of the Event object that I'm supposed to get.
What can I do to get only the Event object??

Regards
Basically what I want to do is the following;
To be able to create an Event with three Speakers .
Speakers table has an event_id column which is NULL and NO Default value(NULL).
The only way I can do the insertions is by setting insert="false" update="false" in the speakers hbm.
I want to be able to update the speaker's event_id after it was inserted. So leaving the update="false" doesn't work for me.
The problem is that if I change the update to "true" then I'm not able to insert Events or Speakers anymore and I get the following error:
Repeated column in mapping for entity: com.manning.hq.ch04.Speaker column: event_id (should be mapped with insert="false" update="false")
How can I achieve that?


<hibernate-mapping package="com.manning.hq.ch04">
<class name="Event" table="events">
<id name="id" column="uid" type="long">
<generator class="native" />
</id>
<property name="name" type="string" />
<set name="speakers" cascade="save">
<key column="event_id" not-null="true" />
<one-to-many class="Speaker" />
</set>
</class>
</hibernate-mapping>

<hibernate-mapping package="com.manning.hq.ch04">
<class name="Speaker" table="speakers">
<id name="id" column="uid" type="long">
<generator class="native" />
</id>
<many-to-one name="event" class="Event" column="event_id" insert="false" update="false"/>
<property name="name" type="string" />
</class>
</hibernate-mapping>