spring

template method pattern

May i know how to create childClass if my childClass method getInfoFromDB() and saveToDB() need to do different logic? public abstract class BaseClass { public abstract Object doTransaction(); public Object executeTrans() { //do something tx.begin(); this.doTransaction(); tx....

What are the benefits of Spring Actionscript considering Dynamic Proxies and Reflection is limited

What are the benefits of Spring Actionscript considering Dynamic Proxies are not possible in the current version of Actionscript and Reflection is quite limited. So for example I could specify my object creation in an XML application context, but why would I do that when I can simply specify that in code, and hence take advantage of sta...

Introducing Spring MVC

I'd like to introduce Spring MVC to an application that has up till now used simple direct access to JSP files i.e www.example.com/login.jsp which contains the business logic and presentation details. I'd like to strip out the business logic and keep only the presentation in the JSP. To do this, I've moved the jsp file from webapp/login...

@Autowired and TransactionProxyFactoryBean?

I have a repository class that is created in XML like so: <bean id="stuffRepositoryTarget" class="my.stuff.RepositoryImpl"> <!-- some params --> </bean> <bean id="stuffRepository" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" primary="true"> <property name="target" ref="stuffRepositoryTarget" /> <...

Hibernate,Spring and Struts, No session bound to thread

Hi all, just a simple question about a great problem... In my web app i use Struts, Spring and Hibernate. I've a lot of Business (classes that edit the database with Hibernate), many action that interact with Business. In Spring configuration i've inject SessionFactory in Business and the Business into Actions. When I call a busines...

Which one should I learn? Spring+Hibernate or Java EE?

I've been doing some Java development, and have learnt my basics. I would like to take my skill to the next level by learning frameworks that are mainstream. I hear about Spring + Hibernate all the time. Lately, there has been some talk on Java EE with EJB 3 etc. I know there is a lot of war going on, but I'm looking for an answer. I k...

Java Execution Context Class Explain

I wanted to grab the concept of "Execution Context class" . I'm refering to this post at http://tinyurl.com/ryjn5o . Can anyone enlighten by explain more on how to create such class ? ...

call valang validator in MultiActionController ModelAndView method... possible? how?

hello dudes. is this possible? i am basically making a Spring CRUD web app using MultiActionController class and would want my forms validated. i have used a SimpleUrlController before and valang works perfectly. ...

ThreadLocal when using hibernate session/JDO persistenceManager

I trying to understand the best prastice of using ThreadLocal for the above questions. From my understanding the reason of using this is to ensure only one session/pm created for entire application. My question is is there any impact of using threadlocal like this on clustering application? (example google app engine) ? if u use "trans...

java logging vs Log4j in Spring framework. Which one is the most suitable.

Hi, We are developing a web-based application in Java using the Spring framework. We are wondering which Logging system would be the most appropriate for it, whether Log4j or JUL (java.util.Logging), which is integrated with jdk. As far as I'm concerned, the former is more popular among developers and offers higher customization option...

Spring Remoting Serialization and De-serialization

We have been using Spring Remoting in our project for sometime. It is used with some other systems to access our web-services. We are currently evolving in terms of what parameters web service takes; but at the same time we are trying to be independent of our consumers. So, currently my question is around how serialization and deserial...

JNDI Context :: Name jms not bound in this Context

I am trying to configure a JMS server (OpenJMS) into a Spring application and when I refer the resources using the notation "jms/<> I get a "name" not bound exception. Any clue what is missing? javax.naming.NameNotFoundException: Name jms is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:768)...

Using Spring's JDBC support to get output parameters

I'm using Spring's JDBC support to run SQL queries and updates on an Oracle database. I'd like to insert a row and then get the key that it was assigned (using an Oracle sequence). In normal JDBC code, I would include a RETURNING INTO clause and then register an output parameter (well described here) However, I would like to just use ...

Forcing Spring's MBeanExporter to use a particular MBeanServer

I have a web application running on JBoss 4.2.2. In order to monitor performance I have enabled the internal platform JMX server that ships with Java 5. In other words, I added: -Dcom.sun.management.jmxremote to JBoss' launch script. This works as expected. However, as a result of this, all MBeans are now registered on the platform MB...

How to inject spring beans into a jsp 2.0 SimpleTag ?

Currently my jsp 2.0 tags that need spring beans use this code: ac = WebApplicationContextUtils.getWebApplicationContext( servletContext); ac.getBeansOfType(MyRequestedClass.class); The I just get the first matching bean. This code works fine, but has the undesired drawback that I spend about half my page rendering time looking up sp...

Pentaho Acegi Security Framework Digest Authentication & Ruby on Rails

Hi all, At the moment I have a Ruby on Rails application which maintains my Users, I have a seperate application (Pentaho) which uses Acegi/Spring Security to authenticate Users. I have been able to change the way Acegi/Spring Security authenticates Users and now it points to my Ruby on Rails application's database and I can get Users ...

global properties in spring

Hi - is it possible to define in a spring context file, and one or more properties that can be accessed in <bean> elements. The example below illustrates best what I need - I want to define the property FOO once and then reference it multiple times in my various <bean> definitions: <beans xmlns="http://www.springframework.org/sche...

Displaying computed data with external dependencies

I'm building a report that needs to include an 'estimate' column, which is based on data that's not available in the dataset. Ideally I'd like to be able to define a Java interface public int getEstimate(int foo_id, int bar_id, int quantity); where foo_id, bar_id and quantity are available in the row I want the estimate presented. T...

Spring MVC and Flex integration over BlazeDS???

Hello dear Stackoverflow - community, my quastion is, which is the best way to integrate existent spring-MVC-Project with flex. I'am using Spring-2.5 lib with annotations. e.g my list controller: package xxx.xxx.controller; @Controller public class ListController { @Autowired private ColorHome colorHome; @RequestMapping("/admin/c...

JPA using multiple database schemas

I'm having a bit of trouble with one particular issue using JPA/Spring: How can I dynamically assign a schema to an entity? We have TABLE1 that belongs to schema AD and TABLE2 that is under BD. @Entity @Table(name = "TABLE1", schema="S1D") ... @Entity @Table(name = "TABLE2", schema="S2D") ... The schemas may not be hardcoded in an ...