spring

How to use multiple ViewResolvers in Spring?

I am working on a web app where I have most of my pages making use of apache tiles (2.1.2), but a few of them need to just be plain jsps. I am having a problem in that both an InternalResourceViewResolver and a UrlBasedViewResolver will try to resolve the view no matter what, so that no matter which ordering I use, it will either fail o...

Building a HTTP link inside a Spring bean which is not a Controller

For a bean which emails users confirmation links, I'd like to generate the URL dynamically, which means that I should know: the protocol; the server (virtual host) name; the server port the context path. on which the application is running. I will not be running a Controller at that time, so I'd like to retrieve this data somehow. ...

The hunt for the J2ME-friendly IoC container is on!

Hi all, I'm in the beginning phases of a Blackberry/J2ME project -- and along with other limitations that come with this wonderful platform, the lack of support for reflection and 1.3 language level mean that the vast majority of existing IoC containers are unusable. (Google has Guice for Android with no AOP, but even that requires sup...

Example of Spring missuse

Our software shop does a big enterprisey system and one of its part is a sophisticated monitoring and log viewer tool. Recently one of our teems rewrote it, since previous version was really lacking some essential features. And it was really ugly. Since this team is bored with enterprisey stuff and they heard of IoC and Spring ("Seem...

Using the Spring Security plugin with Grails without the domain model

We're using Grails but with an existing model layer and DAO layer. We have an app written already in Spring MVC, using Spring for IoC and also Security. I'm trying to port the control and view over to Grails as a proof of concept. I have Grails working fine with IoC but am having some trouble getting Grails to work with Spring Securit...

Struts/Spring with Tiles error-page

I'm still a newbie, and I'm not sure how else to implement custom error pages. I'm using tiles, and I believe this project has the struts2 and spring framework mangled together. I did the basic stuff in my web.xml: <error-page> <error-code>404</error-code> <location>/WEB-INF/jsps/404error.jsp</location> </error-page> Works p...

mixing autoproxycreator and proxyfactories in spring

How do I mix BeanNameAutoProxyCreator and (Transaction)ProxyFactoryBean in such a way that there is only one proxy? I want to create a proxy with JamonInterceptor, but some have also an transaction interceptor/factory bean defined and these show up as $ProxyXYZ in Jamon. I use spring 2.5.6 ...

Error 500: Filter [Spring OpenEntityManagerInViewFilter]: could not be loaded

hi Experts, I am trying to deploy a Spring application on WAS 6.0 (JDK 1.4.2). Day back I was getting tons of (Unsupported major.minor version 49.0) errors. I replaced most of the jar files and now I am left with only one error on: org/springframework/orm/jpa/support/OpenEntityManagerInViewFilter (Unsupported major.minor version 49.0) ...

Spring custom namespaces with Maven

Hi, I wrote my own custom namespace for a Spring based project I'm working on. The project is built with maven, and I'd like to put my xsd files in the resources directory. The problem is the spring.schemas directory requires me to define where I put my xsd file. In my dev environment it will be resources/schemas/myschema.xsd. But, when...

Spring RuntimeBeanReference

Hi, I have a custom namespace I'm parsing for a Spring project, and I'm having trouble with RuntimeBeanReferences. I have a class MyClass that takes a List. In my beandef file, I have a bean defined of type MyObject named "MyObj". In my custom namespace parser, I have code that looks like this: RootBeanDefinition myBean = new RootBean...

Should validators in spring access the database?

I'm not really sure if it's a good design decision to make the validators validate commands based on the state of the database. For example if I need to validate a User bean besides checking if the email and username are empty etc. I also need to reject values if they are already used. Should this kind of logic go in the validators or th...

How can I configure Spring to save as much memory as possible?

We're deploying an application on a semi-embedded device that has memory constraints. Looking to save whatever we can we are analysing heap dumps of the app and attacking the biggest consumers. We use Spring 2.5 together with Spring DM 1.1 and we notice that some of our bundles with more complex Spring contexts are using up quite a bit...

The proper way to deploy a Hibernate-based J2EE app to a remote server..

I have a pretty monstrous Java app in development here. As of now, it's only ever been deployed on my locally installed Tomcat/MySQL setup. For completeness, the app is an online game server written using Spring, Hibernate with MySQL currently on the backend. Now, I can easily package up the WAR and get that on the remote server.. The ...

Spring MVC form input value is always null

Hi all, I'm new to Spring MVC, but not new to web development in Java. I'm attempting to create a simple form->controller example. I have a form, a form controller (configured in a context XML pasted below) and my model (a simple bean). When I submit the form the value of my text input is always null, regardless. Any ideas? Form cont...

How can I cancel a long-running query using Spring and JDBCTemplate?

The JDBC java.sql.Statement class has a cancel() method. This can be called in another thread to cancel a currently running statement. How can I achieve this using Spring? I can't find a way to get a reference to a statement when running a query. Nor can I find a cancel-like method. Here's some sample code. Imagine this takes up to 10 ...

Disable Hibernate auto update on flush on read only synonyms

I have a table and two databases which have the same table, but one is a symlink of the other one and only read is permitted on this table. I have mapped the table to Java using Hibernate and I use spring to set the Entity Manager's data source as one of the two databases based on some input criteria. I call only read only operations ...

Best java webframe backend for GWT frontend?

What is the best java based web framework backend for a GWT frontend? Possible Backends: seam, jsf, spring web ... ? Specially I am interested in practical experience and PROS and CONS. Btw: - No dynamic typed Languages please - Have anybody tried seam or spring for this? ...

presentation layer to go with apache torque

I'm planning on using Apache torque as my object-relational mapper (ORM), and I was wondering if anybody has any suggestions around what framework to use for presentation layer with torque. maybe Spring? I don't know if this helps, but my application is basically going to be bunch of forms to input data and based on that data, I'll gene...

Testing Quartz CronTrigger trigger

Assuming that I have a CronTriggerBean similar to <bean id="midMonthCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="reminderJobDetail" /> <property name="cronExpression" value="0 0 6 15W * ?" /> </bean> What is the best way to test that this bean will actually trigger...

Which Java templating system should I use to generate emails?

I have a website that uses JSP as its view technology (and Spring MVC underneath). Unfortunately, JSP is just a pain to use for anything that doesn't involve an HTTP session. I would like to be able to occasionally send my users some email, and I want to use something JSP-like to render the email's contents. Technologies I'm aware of ...