spring

Forward to JSP after call to ServletOutputStream

As near as I can tell, this falls under a "you can't do that". I'm about to re-think my solution and work around it, but I thought that asking here was worth at least a shot. My JSP/Spring/Struts Servlet produces reports, writes them to PDF, and queues them for download, then waits for the user to request more reports. The details aren'...

Usage question: Spring AOP vs. AspectJ weaving

I am working on profiling a legacy application using Spring AOP and I want to get some data points around a decision I need to make. This is what I have done so far: I have created the code and configuration using Spring AOP which would help me to profile the beans that are being managed by the Spring container. While profiling the dao...

Spring Security in a distributed application.

We recently upgraded our application to Spring 3.0 and Spring Security 3.0. Apart of the additional work we want to do is to separate the backend from the front end for various reasons. We plan to use Spring's transparent RMI solution for exposing our services to our front end. However, the way things are designed today both the front an...

jpaTamplate how to autocommit...?

I am using JPA i have setup transaction on service layer using @Transactional.. it is working fine.. but when i test Dao (Junit) transactions using JpaTemplate are not getting commited.. although same test with JdbcTemplate were getting comitted... So how to enable auto-commit for JpaTemplate...? ...

Glassfish ThreadDeath issue on redploy with Spring MVC and hibernate

I have a spring MVC application that is deployed on a glassfish server. During execution of this application I get a ThreadDeath exception. The exception occurs on the first form submission of the application (which involves a query to a DB using hibernate). The error goes away if I restart the application server. I shouldn't have to res...

Spring: Injecting a private inner class as an outer class's member?

Hi I have the following class structure public class Outer{ private Mapper a; .... private class MapperA implements Mapper { } private class MapperB implements Mapper { } } In my Spring config file I would like to create a an Outer bean, and assign one of MapperA or MapperB as a property. Is this possible?...

Log runtime Exceptions in Java using log4j

Hi, I am currently building an application using Tomcat, Spring, JAVA. I am using Log4J as my logging library. I currently am logging everything to a text file. One of the issues I'm having is that RuntimeExceptions are not being logged to any files. I was wondering if there was a way to log all RuntimeExceptions that maybe thrown ...

Enterprise Application

I am thinking about a platform for study application (it is team work). I mean standart JEE 5 (or maybe try raw JEE 6) and Spring. What is your choose? (I don't mean Spring MVC but Spring Beans and EJB3.0) Also i would like to know whar app server you use? (now i use glassfish v2) Thanks, WBR, Den Bardadym. ...

ConcurrencyFailureException

Hi, How can I cause ConcurrencyFailureException in my Spring DAO when it accesses Mysql(myISAM) And Oracle(10g) ? I want to make a real database exception (not the mock one) from my Java code. Thanks ...

image uploading using MultiPart

I am writting the code to upload a file using Spring's MultipartFile on server for that I have written following code if(!partnersContentBean.getFile().isEmpty()){ MultipartFile file = partnersContentBean.getFile(); if(file.getOriginalFilename().endsWith(".jpeg")||file.getOriginalFilename().endsWith(".jpg")|| file.getOrigi...

Spring BlazeDS + Flex + JBoss Project setup in eclipse using Maven

Hello, I would like to know how to proceed to set up a work environment in order to develop Spring BlazeDS applications. Those server applications are meant to be accessed via AMF remoting from some client Flex application. Actually I have Maven and m2eclipse set up and working, local JBoss v6.0M2 running, Flex 4 plugin installed. Ide...

Accessing MySQL datasource bean in Spring

I am trying to create a datasource bean for MySQL from within my Spring project (in springtoolsuite), and I want to access the MySQL JNDI (run by JBoss application server). My Bean declaration <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" scope="singleton" > <property name="jndiName" value="java:/MySqlDS...

spring batch insert using hibernateTemplate, JdbcTemplate

I have a few questions related to batch insert in Spring. When I do something like that: public void save(Car car) { String sql1 = "insert into Car values (1, 'toyota')"; String sql2 = "insert into Car values (2, 'chrysler')"; String sql3 = "insert into Car values (3, 'infinity')"; String[] tab = new String[2]; tab[0] = sql1;...

Is this a perfect problem for the factory pattern?

I want to design the file storage part of my application with some flexibility, so one can store files in either S3 or on the web server's hard drive. I also want this to be flexible on a per user basis, so in their user settings they can choose if they want their files stored in S3 or on the servers file system. I am thinking of somet...

How to google for spring 3.0 documentation?

When giving links to spring docs it would be best to link the 3.0 ones, but googling isn't quite productive with them (yet). Is there some "shortcut" (like for java core classes)? For example: "spring factory-method 2.5.6" gives the docs about 2.5.6, but "spring factory-method 3.0" doesn't give anything from 3.0. If you know the name o...

Spring WebContent Resources - Access outside ServletContext

I have a Spring Web MVC application that I'd like to serve a large, partially generated file. I've added that file to my WebContent directory and all works fine there. However, I'd also like to access that file from my various build/deploy scripts, which read and parse the file. My current approach is to keep a copy of the file under t...

SPRING: How do you programmatically instantiate classes based on information passed from Flex UI

Imagine the UI passes back an XMl node as such: <properties> <type> Source </type> <name> Blooper </name> <delay> <type> Deterministic </type> <parameters> <param> 4 </param> </parameters> <delay> <batch> <type> Erlang </type> <parameters> <param> 4 </param> <param> 6 </param> </parameter...

Streaming Dynamic Files from Spring MVC

I've got a Spring Web MVC application (and also a BlazeDS application, though not as relevant) where files are dynamically generated based on certain client actions. I'd like to just map a certain directory on the file system to Spring MVC (or the app server) url and let it serve the files in that directory (with streaming and standard ...

Using Spring Framework is it possible to connect two different databases based on some business logic.

I have a web application which connects to an Oracle database. The application is now going to have a new set of users. A new db is being planned for this new set of users. Is it possible to connect to the appropriate db based on the user who logs in. As of now the database configuration is done through JNDIName entry in an xml file. ...

What happened to the Spring Modules project?

I read on Spring web site that the Spring Modules project is now deprecated in favor of Spring Extensions. However, unless I am missing something, Spring Extensions does not support Lucene like Spring Modules did. Am I missing something? ...