spring

Java - getting jar dependencies right

Hi I'm relatively new to Java & maven, and so to get to know my way around, I decided to do a project as a means for learning. I picked a pretty common stack : Java 1.6 Hibernate (with annotations) Spring (with annotations) JUnit 4 Tomcat Oracle XE / In-mem hsqldb By far one of the biggest problems I've experienced is getting the ...

Integrating grails into an existing spring application?

What if you don't want to start a separate project for grails but instead sneak it into an existing webapp? I have to build an admin interface/crud for some new entities and thought it would be a perfect way to learn grails. ...

Can you use Future/Futuretask objects with Spring TaskExecutors?

Is it possible to use Java FutureTask with a Spring TaskExecutor to get a Future object? I'm looking for a TaskExecutor that implements the Java ExecutorService interface, in particular the submit() method. Looking through the Spring Javadocs doesn't reveal any classes like this. Is there some alternate method to handle futures through...

Security Reinforcement: How to collect visitors' IP addresses in Grails Framework?

How to make a logging list of Users' IP addresses, should this be done via tomcat or grails or a combination of both ...

Ouput XML with Freemarker

We are using freemarker for templates in our web application. We are using spring's FreeMarkerViewResolver for this. Is there a way in freemarker to change the content type on the response to text/xml is there a way to do this in the template? ...

How do I manually open a hibernate session?

I have a rather large project involving spring and hibernate. Right now, I'm backing certain objects out of hibernate and into memory, and I've hit a sort of snag. I have the following setup. Class A contains a number of primitives and a class B. B contains primitives and a class C, which was previously lazy-loaded. Now I have this ...

Narrowing problem with Spring MVC annotation-based controller and @RequestMapping

Consider this Spring MVC Controller: @Controller @RequestMapping("/test*") public class TestController { @RequestMapping(method = RequestMethod.GET) public void doStuff(Model model){ ... } @RequestMapping(params = "myParam") public void doStuff(@RequestParam("myParam") int myParam, Model model){ ... } } When I p...

configurable vs component with spring and aspectj

When using aspectj, why use @Component over @Configurable. I've got spring and aspectj setup for @Transactional support, aspects on self-invocation, and injection into JPA entities. This works great. I'm using @Component for most classes that need injection, and thus either having them injected into their dependencies. Or, when I can'...

Example link Required for Uses of acegisecurity framework with spring

Hello, I am currently developing my project using Spring, Sutruts2 & Hibernate. Now i want to apply acegi security for authentication & authrization purpose. But, i m totally new with acegi, so i want to use acegisecurity framework with spring configuration. If anyone have link for an simple example of acegi with spring, struts2 & hi...

db2 referential integrity problem

Situation is pretty serious, we have a table in DB2 on AS400 which has defined foreign key to another table, so we are entering record which have regular ID of referenced table so when we enter SQL insert through front end tool everything went fine. Problem arises when this insert is to be done through java application which uses Sprin...

How can I chop down a transaction in Spring with JPA?

I have this code: run big query: Select all unprocessed objects from table A for each result create or update an output object in table B update input object: Set it to "processed" I'd like to have a transaction over the loop body, that is after one row of input is processed, the updated objects should be committed, so when th...

Tips or tools for debugging Spring applications?

I am trying to use Spring for the first time in an application. The general issue that comes up again and again is that I have no idea how to debug Spring. The framework is so configuration heavy that traditional code debugging seems fruitless. Short of turning on the debugging level logs (which are lacking) and scanning through I have n...

JGoodies memory leak?? - Out of Memory Exception when Spring tries to display the view

I am getting an Out of Memory exception sometimes during or after the validation of component happens. I was trying to profile a large validation result <= 20000, and it worked, so I went bigger. The exception occurs at values > 20000, does anyone know of any inherent jgoodies memory leaks, with the validation framework, the component ...

Fixing Null EntityManger in Spring MVC application?

In the following code I am trouble with my injected EnitityManager, which always shows up as null; public class GenericController extends AbstractController { @PersistenceContext(unitName = "GenericPU") private EntityManager em; protected ModelAndView handleRequestInternal( HttpServletRequest request, ...

Store Custom properties in aplicationContext.xml Spring file

Hello, I need to store some configuration parameters for a web application that uses spring framework. Typically I'll use a configurationfile.properties file but i wonder if i can store that values in the applicationContext.xml file. One workaround could be to create a JavaBean class to store the values, and build that class using spr...

Why would Spring's HibernateTemplate's loadAll() method generate updates for each row?

I have a database table consisting of countries. In my DAO which extends HibernateDAOSupport the following method... public List<Country> getCountries() { return getHibernateTemplate().loadAll(Country.class); } ...generates the following activity: Hibernate: update countries set name=?, iso_alpha_2=?, iso_alpha_3=? where id=? Hiber...

Is there an equivelant to spring's ContextLoader for a non-webapp

I would like a class analogous to spring's ContextLoader/ContextLoaderListener/ContextLoadServlet. These classes are invoked when the application server initializes and puts your configured context into memory. What is the analogy of this for an application that does not have a container wrappering it? This would preclude multiple ins...

better way for dynamic forms with Spring?

What I wonder is if there's a easier/better way to handle dynamic forms (adding form items to the dom via js) when using SpringMVC and Spring forms? Imaging having an Invoice object that have many LineItems. public class Invocie { private List LineItems; public Invoice() { lineItems = ListUtils.lazyList(new ArrayList<LineItem>(), ...

springdoclet usage?

is springdoclet use to generate bean defination xml files? servlet-config.xml..etc ? i trying to find out what is the different springdoclet compared to spring roo ...

How to bind a bean property to another one and observe changes in Spring Framework

Hi, I'm wondering that if there is a way for binding a spring bean's property to another bean's property so if any change on binded property occurs in runtime, what i expect is referencing bean's property also changes. I'll explain more with a little code snippet. <bean id="johnHome" class="example.Contact"> <property name="phone...