spring

Set Hibernate session's flush mode in Spring

Hi! I am writing integration tests and in one test method I'd like to write some data to DB and then read it. @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath:applicationContext.xml"}) @TransactionConfiguration() @Transactional public class SimpleIntegrationTest { @Resource private DummyDA...

Refresh view with Spring WebFlow transition

I'm trying to add localisation to my web app which is built with Spring WebFlow and facelets. I want to add support for english and french. I've created my two messages_fr.properties and messages_en.properties files. My template which I use for all my jsf pages has the following code to define the messages bundle and two links to switch...

action-servlet ?

Hi all, I'm new to Java WEB Development please help with this !! my link in the action-servlet is http://myproject.co.in:9090/a/userSignUp.action i got a new user registration page and i have given an action for the log in button.. but if i click the button its redirecting to this page .. please help and thank you for your tim...

Config Spring for works with hibernate and entities mapped by annotations

Hi all, im using hibernate and i maps my entities with annotations (so no xml files). I finally decided to try spring framework but I encountered some problems to make it work. All tutorials i found are very dispersive and most of them use xml file to map an entity... Can you help me to correctly write a xml config file for spring+hibe...

Using abstract factory with Spring framework

Hi! I have some Abstract Factory public interface AbstractViewersFactory { IAbstractShapeViewer createRectangle(BaseOperationsListener<RectangleDTO> p); IAbstractShapeViewer createOval(BaseOperationsListener<OvalDTO> p); IAbstractShapeViewer createTriangle(BaseOperationsListener<TriangleDTO> p); } And Its implementation ...

Suggest Generalization code for Calling Stored Procedure in Spring

public class TestProcedure extends StoredProcedure { TestProcedure(BasicDataSource dataSource, String procName) { this.setDataSource(dataSource); this.setSql(procName); this.declareParameter(new SqlParameter("@test", Types.INTEGER)); } public List<Detail> executeProcedure(Integer studentId) { Map inParams = new HashMap(...

Is it possible to reference a Java app from a Grails app?

Hi, We have a Java/Spring/Hibernate codebase which is the core to our pretty large platform. We also have quite a few separate Java webapps (Struts or Spring MVC) running alongside which reference the core system, pulling in the applicationContext and services from it. We have a requirement to build another webapp that also references ...

Spring annotation configuration does not find directories/classes in JARs

I have the same problem as these guys: http://stackoverflow.com/questions/1242656/spring-annotation-based-controllers-not-working-if-it-is-inside-jar-file http://forum.springsource.org/showthread.php?t=64731 ...but the difference is that I use Maven 2 as a build tool. How do I achieve the same effect using Maven 2? I saw this soluti...

loading a variable spring applicationContext.xml file based on a property specified outside of the app war file?

I have a need to change the spring applicationContext.xml file that is used based upon a property, this property MUST be defined somewhere outside of the war file (ie. it can't be in web.xml). Currently, I've arrived at the following solution (see my answer below), wondering if there's a better way to do this? ...

managing hibernate sessions

I am trying to debug a web app that is having some performance issues. i turned on hibernate logging and i am seeing a lot of this: 2010-10-28 10:58:00,423 DEBUG [org.hibernate.impl.SessionImpl] - opened session at timestamp: 5276786198212608 2010-10-28 10:58:01,390 DEBUG [org.hibernate.impl.SessionImpl] - opened session at timestamp: 5...

How do you figure out what is causing '/login' to be called?

I was looking at the Firebug output for my index page and noticed that my /login handler is getting called at some point during the execution of the index page. It doesn't redirect to the /login page though for some reason. But I can't tell which resource is triggering /login to be called. Is there some way of outputting the source of ...

Spring MVC: Relative URL problems

I have a controller bound the URL: "/ruleManagement". Inside my JSP, I have a form that forwards (on submit) to "ruleManagement/save" url. When there are errors with the input fields, I want it to return back the original form View. This is where the problem starts... Problem 1) Now that the URL is "/ruleManagement/save", my form sub...

Binding Multiple Command Objects of Same Type in Spring MVC

I have a several command objects of the same type to bind, each of which represents a row from a form. How do I bind these in an annotation based controller? How do I access them on the JSP? ...

How to add SOAP Headers to Spring Jax-WS Client?

How can I add SOAP Headers to Spring Jax-WS Client? Specifically, I have a Jaxb object I would like to add to the header but xml examples would be appreciated. I am using Spring's JaxWsPortProxyFactoryBean described here. Also, I am generating my client as described here which is working less the headers I need to add. Thank you. ...

Spring+hibernate and @Transactionl annotation, how it works?

Hi guys, what is the difference between use @Transactional over a method and not use it? I write some simple test but seem to be no difference. I want to learn how to manage transaction using spring and annotation. thank all. ...

Spring JmsTemplate and Apache ActiveMQ, why so many connections?

Hello, I have a web application that runs text processing jobs in the background once a message is received on an ActiveMQ which is listened to by a Spring MessageListener....the problem I"m encountering is that once I process around 30 background jobs, ActiveMQ stops processing any messages, Spring message listener loses its JMS connec...

Transaction rollback on Spring JDBC tests

I'm trying to get JDBC transaction rollback when using Spring-test without success. When I run the following the SQL update is always committed. package my.dao.impl; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.Rollback;...

RoR web tier with Java middle/backend

I'm looking for some advice/feedback about using different languages in a layered architecture. Right now the architecture in question is an all java stack (db, middle tier, and web tier) using Spring to tie everything together. We've been tossing around the idea of using Ruby on Rails for the web tier, but I'd like to know if anyone has...

EclipseLink with Spring - Can't persist into Db

I am using Spring + EclipseLink 2 to manage entity on a Derby database. Select object from db works fine but when I try to persist one, nothing happens. Program executes correctly and no exception are thrown. I probably did something wrong, as I'm not familiar with Spring, thanks for your comments and suggestions :) The ServerDaoDb meth...

What is the correct way to initialize collection of an entity (POJO) in Spring-Hibernate project?

I have a POJO class, say Foo, which has a Set of other entity instances, say bars. Also there are standart misc classes for such project: service and dao for both Foo and Bar. I want BarService to get the Set of Bar instances associated with some Foo. Now I have the following code, wich I believe is conceptually bad. public class Foo...