spring

warning in faces-config.xml integrating spring with jsf

Hello, I am trying to integrate spring into a jsf application. In faces-config.xml I have included this: <application> <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application> but it shows a weird warning which I...

Tracking down cause of Spring's "not eligible for auto-proxying"

When you start messing around with Spring's auto-proxy stuff, you often run into this behaviour as documented: Classes that implement the BeanPostProcessor interface are special, and so they are treated differently by the container. All BeanPostProcessors and their directly referenced beans will be instantiated on start...

How can I easily mock out a static method in Java (jUnit4)

How do I easily mock out a static method in Java? I'm using Spring 2.5 and JUnit 4.4 @Service public class SomeServiceImpl implements SomeService { public Object doSomething() { Logger.getLogger(this.class); //a static method invoked. // ... } } I don't control the static method that my service needs to invoke so I...

How can one determine page render time in Spring (on Google App Engine/Java)?

We are building an application on Google App Engine in Java using Spring 2.5. I would like to put something in the footer that displays page render time. Where are the best code hooks in either Spring or GAE/J to calculate render time and put it into the Spring model for JSP rendering? ...

How can i have previous value of checkbox in Spring?

Is it posssible to have the previous value of checkbox alongwith new value? My problem is, i have to execute some code, only if the value of checkbox is true, also if it was already true, then i am not suppose to perform the same action again. Currently what i am doing is , for every checkbox i am having previous value holder too. If t...

testing dao with hibernate genericdao pattern with spring.Headache

Hello good fellas! in my journey of learning hibernate i came across an article on hibernate site. i' learning spring too and wanted to do certain things to discover the flexibility of spring by letting you implement you own session.yes i don't want to use the hibernateTemplate(for experiment). and i'm now having a problem and even the t...

How do I setQueryTimeout on SimpleJdbcTemplate?

The Spring Framework has two similar classes: JdbcTemplate is the old, Java 1.4 class, and SimpleJdbcTemplate is newer, with nicer methods. JdbcTemplate has a method setQueryTimeout, which basically gives me access to a method with the same name on the underlying Statement object. Is there any way to do something similar with a SimpleJ...

Hibernate/Spring3: could not initialize proxy - no Session

Hi guys, I'm new at Spring, so I put Spring 3.0M3 on a Tomcat server on my Mac, made an Eclipse project, completed a Hello World and then wanted to make an object persist with Hibernate. I've made a User table on my MySQL server, made a User object with all getters and setters (I really wish Java would take a queue from Objective-C here ...

Ldap invalid credentials not loading authentication failure url

Able to do the custom ldap authentication for external db authorities. But when i am trying to test wrong password the authentication failure url is not showing instead my browser prints the exception details.Below is my securitycontext.xml and exption given <logout logout-success-url="...

Relative References in Expressions in XML bean definitions in Spring 3.0

This is the example from the spring 3.0 reference: <bean id="numberGuess" class="org.spring.samples.NumberGuess"> <property name="randomNumber" value="#{ T(java.lang.Math).random() * 100.0 }"/> </bean> <bean id="shapeGuess" class="org.spring.samples.ShapeGuess"> <property name="initialShapeSeed" value="#{ numberGuess.randomNumb...

Use of Non-Company approved 3rd party software libraries

Is it unethical to use a third party library/framework (spring/ibatis) in your app anyway, even though you've been told it will take too long to approve and you can just make do without? ...

Spring ApplicationContext Bean Scope

When you create a Service bean or Dao bean in your Spring applicationContext.xml file, what is the scope of those beans? Will every person who accesses the web application use the same instance of the bean, or is the bean instantiated for each user's session? ...

Spring MVC View

What are you guys using for your view in Spring MVC. I know Spring MVC has a wide support for views but I'm having trouble finding what works well, what view to use when, etc. Any insight would be great! ...

Receiving an array of Object from a web form using Spring framework

Hi, I have a form JSP web page, this form contains multiple instances of the same Java object, I am using Java Spring Framework to control the "communication" with the controller and the view. My problem is that i would like to be able to receive from the view a simple array containing the instances of my objects wich are currently on...

Is there a good reference for how Grails was architected with Spring?

I have come to Grails without first being a Spring developer. This is great when things work but leaves me lost when things don't work as I expect, or I wish to extend things in ways unanticipated by the existing Grails documentation and reference books. I would also like to learn more about Spring best practices and with a reference I ...

Eclipse keeps changing the Targeted Runtimes

We're using Eclipse 3.4.1 with SpringSource dm Server 1.0. There are two Targeted Runtimes defined (Project / Properties / Targeted Runtimes). The one we setup is called SpringSource dm Server (Runtime) v1.0 There is one pre-defined called SpringSource v1.0 We find that, even though we select SpringSource dm Server (Runtime) v1.0, ...

UrlFilenameViewController does not return View (Spring-MVC)

Hi, According to Spring framework API UrlFilenameViewController's purpose is: Transforms the virtual path of a URL into a view name and returns that view If i request for /info.xhtml, its logical view name is info See UrlFilenameViewController documentation Both web.xml and controller is mapped according to /WEB-INF/web.xml <...

How to use Spring to inject an object in a setter that doesnt follow the Java bean specification ?

I am trying to use Spring and wx-xmlrpc together. The problem is that XmlRpcClient has a setConfig() method that doesnt follow the Java Bean spec : the setter and the getter dont use the same Class. So Spring complaints when I have the following context.xml : <bean id="xmlRpcClient" class="org.apache.xmlrpc.client.XmlRpcClient"> <pr...

Bulk inserts with Spring / Hibernate

Hello, I'm using in my application a mix Spring/Hibernate (nothing original). For a given feature, I have to import the content of a CSV file into a table of my Oracle DB. For now, I juste create the objects, I do HibernateTemplate.saveOrUpdate on each of them (I need to retrieve their newly allocated Id) Then the transaction occ...

Sharing JMS and Hibernate transactions in a Spring MDB using Oracle Streams AQ?

I'm using Oracle 11g for my database and its Oracle Streams AQ feature as JMS implementation. For all I know, it should be possible to implement a Spring based message-driven POJO (MDP) that uses the same data source for both transactional data access and JMS transactions -- all without XA-Transactions (IIRC, this was marketed as a feat...