spring

Using @Table with schema name in Hibernate 3.3.1ga and HSQLDB

How can I make this work in unit tests using Hibernate 3.3.1ga and HSQLDB: @Entity @Table(name="CATEGORY", schema="TEST") public static class Category { ... } The problem is that Hibernate expects the schema to exist. The second problem is that Hibernate issues the CREATE TABLE TEST.CATEGORY before any of my code runs (this happens de...

problem displaying unicode using Spring MVC

hey guys, I am trying to display some nepali langauage charcaters in my spring MVC webapp with freemarker, i did everything like i have character encoding filter in my web.xml <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> ...

LazyInitializationException with session scoped bean

I'm getting LazyInitializationException with session scoped bean in my service layer. If I load the same bean using a regular dao in my method, I can access it's lazy collections without problems. But if I inject it in my service bean, and then try to access one of its lazy collection, I have a LazyInitializationException. I'm using J...

Which reporting tool to used with struts, spring, hibernate

Hello, I am developing Web Base Application using Spring, Struts2, Hibernate. Now i am in the reporting phase of my system. But i am little bit confused that which tool to use & which not. I had tried Jasper report with struts2 plugin, but facing lots of problem in jrxml file. Now can anyone suggest which reporting tool will be bett...

How to do LDAP authentication and database Authorization in Spring security?

I'm new to Spring, so this question may look like so obvious. I'm trying to implement Spring security and my requirement is to authenticate the user name/password against a LDAP server and once the user is authenticated, I need to retrieve the user roles from a relational database. is it possible to do this in Spring security? ...

Using Spring to inject EasyMock mocks causes ClassCastException

I am trying to get Spring to inject EasyMock mocks in my unit tests. In my applicationContext.xml, I have this: <bean id="mockService" class="org.easymock.EasyMock" factory-method="createMock" name="MockService"> <constructor-arg index="0" value="my.project.Service"/> </bean> In my unit test I have this: @Autowired @Qualifier(...

How to pass global properties in ibatis.

I'm developing a Spring MVC application using ibatis for the database interaction layer. I'd like to be able to set the name of the database via a properties file in my classpath (or via the spring xml configuration) so I can change the database on the fly for a certain application and can be changed by setting the parameter and redeploy...

<security:custom-authentication-provider /> means?

i have a bean in xml like below <bean id="theCustomAuthenticationProvider" class="test.custom.CustomAuthenticationProvider"> <security:custom-authentication-provider /> a.may i know what does security:custom-authentication-provider means when i put it in my bean like above? b. do i need to create <bean id="authenticationManag...

Spring-AOP

i have configured a Spring-AOP on a bean. When i access this bean it returns me a spring proxy class instead of the actual bean. Is there any way i can get the actual bean. ApplicationContext.xml bean id = "abc" class = "abc.java" some.java abc a = (abc)applicationContext.getBean("abc") this throws: java.lang.ClassCastException: $Pr...

method @Secured suppose to throw error when no user authenticated yet

my service look like below @Controller @GwtRpcEndPoint public class ServerServiceImpl implements ServerService { @org.springframework.security.annotation.Secured("ROLE_ADMIN")public String runGwtSprMvcHibJpaDemo(String s) { System.out.println("SecurityContextHolder.getContext()="+SecurityContextHolder.getContext()); Sys...

BeanPropertySqlParameterSource and Doubles

Have a table and a sproc setup in Sybase as follows: create table testtab (f float) create proc insert_testtab @f float as insert testtab values(@f) And a java object that holds a Double class TestObj { Double getF() { return 12.34; } } Using SimpleJdbcCall & BeanPropertySqlParameterSource: SqlParameterSource params = new BeanPrope...

Conditionally Render In JSP By User

I'm trying to make a simple forum just to get the hang of the Spring Security and MVC frameworks. For simplicity's sake, let's I have a JSP to view a forum post, which looks like the following: <body> ... Title: ${forumPost.title} <br> Author: ${forumPost.author.name} <br> Message: {forumPost.message} <br> <securi...

Using @Autowired of spring with scala

hi everyone, i am using spring from scala and i am facing a problem when trying to inject a service with a trait/superclass. This is my code: trait MyServiceHolder{ var myService:MyService = null @Autowired def setMyService(ms:MyService) = myService = ms } @RunWith(classOf[SpringJUnit4ClassRunner]) @ContextConfiguration(Array("...

jersey integration with spring

I want to use Jersey 1.1 with spring 2.5. The exact thing that i need to do is write a interface which would be exposed as the service and implementation in a class that extends the interface. I cannot do it in applicationContext.xml, maybe because the XSD has changed. Could some one provide with a sample code/snippet/file where they h...

How does Spring for Python compare with Spring for Java

I am an avid fan of the Spring framework for Java (by Rod Johnson). I am learning Python and was excited to find about Spring for Python. I would be interested in hearing the community's views on the comparison of these two flavours of Spring. How well does it fit Python's paradigms etc. ...

Recommended logger for use with Java, Hibernate and Spring

My web application is using Java, Hibernate's JPA implementation (EntityManager) and Spring. What are my logger choices and what would you recommend. Ideally the configuration would be simple (one config file for Hibernate, Spring and my code). ...

spring security integrate with facebook connect

may i know is there any tutorials/guideliness on spring security integrate with facebook connect ...

How can I use Spring XML configuration to set a bean property with list of all beans of a certain type?

I have the following XML configuration: <bean id="bean1" class="Simple"/> <bean id="bean2" class="Simple"/> <bean id="tasks" class="java.util.ArrayList"> <constructor-arg> <list> <ref bean="bean1" /> <ref bean="bean2" /> </list> </constructor-arg> </bean> <bean id="list" ...

Portlets - Keeping session alive from server side

Hi, I am implementing jsr 186 portlets, with some servlets to the mix to implement some ajax. The problem is if I only make AJAX calls for some time, I lose the session. Strangely, keeping alive the servlet session does not prevent the portlet session from timing out. Is there a way I can keep the session alive from within my servlets,...

Can Spring Webflow eliminate the need for controller classes?

For a relatively simple application, can Webflow be employed to reduce the need to create form controllers? Well, certainly it can, but I guess what I'm asking is: can and should I write an entire application using Webflow for all of the controller / view logic if my goal for doing so is to reduce the amount of code that I write? I'm s...