spring

YUI Uploader with Java back-end

I am trying to use the (flash based) YUI Uploader with a Java (Spring-based) back-end. The typical way of uploading files in the Java Servlet world is to set the ENCTYPE='multipart/form-data' on the HTML form requesting the file from the user. With the right server side APIs (i.e. Commons FileUpload), it is possible to get the file on t...

bean error in spring MVC application.

Plz have a look at http://java.pastebin.ca/1458043 particularly, to access method of Gender in My controller ie method model.addAttribute("genderlist", person.getGender() );` I declare private Person person; @Autowired public ReportController(Person person) { this.person = person; } I get Person bean related error! What could...

spring initBinder and webbindinginitializer example ...

Hi, I read few books on spring2.5 on these topic, but still cannot grab the concepts when to use @initBinder. can anyone share any reference or explain in what situation i can use this on web application? How propertyEditor relate to it? ...

Could I benefit from Spring with BlazeDS

I'm building a small experimental application using BlazeDS AMF, Java and Hibernate, and I was wondering if I could at all benefit from using the Spring Framework? Since I'm using BlazeDS, that acts as my controller, but I might use something like Aspect Oriented Programming for example for logging. What other benefits could I get from...

About Spring BeanFactory

Does every time I new an new BeanFactory the beans in the XML file are to be recreated? In other words, if I set an bean's scope to Singleton, I got the same Object even if I newed another BeanFactory? ...

What naming convention do you use for the service layer in a Spring MVC application?

I'm stuck with figuring out a good naming convention for the service layer in a spring application. For each class in the service layer I first write the interface it should implement and then the actual class. So for example I have the following interface: public interface UserAccountManager{ public void registerUser(UserAccount new...

Usage of Exceptions

In a Spring application, my point of view is that each domain model which in fact is a POJO, should encapsulate all the validation logic in itself. Now whenever there is an update or insertion, they should throw proper exceptions that are modeled after the business process like CustomerNotFound AlreadySold, CannotAllowReturnOfExpiredItem...

Java Project Configuration

I'm curious as to what other people use in the Java world for configuring their applications. I've previously used Spring's PropertyPlaceHolderConfigurer and PropertyOverrideConfigurer to load various properties files and bind them using the default Spring property editors. This is a perfectly acceptable solution for what I've done, ...

AOP, Spring and transaction scoping

Hi, imagine a transactional, multithreaded java application using spring, jdbc and aop with n classes in m packages all taking part in database transations. Now let's say there is the need to scope an arbitrary set of classes within one transaction. Furthermore there is always one class T within the scope that commits the transaction whe...

c:foreach using List: Must evaluate to a Collection, Map, Array, or null

So I'm trying to loop over a List<MyClass> for display in the view of my spring webflow application. However I get the error Must evaluate to a Collection, Map, Array, or null. <c:forEach items="#{orderedStuff}" var="a"> #{a.PrettyName}test </c:forEach> I've also tried $ instead of #. Here is my xml flow definition. <view-state ...

Getting started with Spring + BlazeDS integration. Hello World wanted.

I'm trying to get my hands a small Spring + BlazeDS integration "Hello World"-ish type of sample/tutorial to see the basic, minimum configuration required for using the Spring & BlazeDS integration available from http://www.springsource.org/spring-flex The download I got came with all these test drive samples, but I can't make freakin' ...

When using Spring Web Flow 1, how do I add an object to a list in a bean?

I have a a web flow where I need to capture data on one of the screens. This data is stored in an object which will be held in a list in the bean. On submitting the page I want to be able to create an object, and add it to the list in the bean. Is this possible? Thanks ...

What technology to use to write systray front-end to webapp?

Hi, we have an internal webapplication running on tomcat, build on Spring. The webapplication front-end is build with Flex. I would like to create a cross-platform systray application that allows to go the home page of the application and displays alerts when certain things happen in the server. What would you think is the best techno...

Servlet spring-servlet is not available (Spring+BlazeDS Integration)

I'm trying to setup a Flex project using the Spring + BlazeDS integration by working through the refcard kindly posted by James Ward on refcards.dzone.com. Some problems/challenges are sticking their heads out. The Tomcat deployment is going well, all the files are on the server and I can summon main.swf through the browser. I get the ...

Autowiring Unmanaged Beans Annotated With @Component

I want to use @AutoWired to inject a non-managed bean configured with @Component into a managed bean. I'm pretty sure I have the configuration right, but for some reason I keep getting the exception: No unique bean of type [foo.Baz] is defined: Unsatisfied dependency of type [class foo.Baz]: expected at least 1 matching bean Based on...

JAR files, don't they just bloat and slow Java down?

Okay, the question might seem dumb, but I'm asking it anyways. After struggling for hours to get a Spring + BlazeDS project up and running, I discovered that I was having problems with my project as a result of not including the right dependencies for Spring etc. There were .jars missing from my WEB-INF/lib folder, yes, silly me. After...

Validating multiple forms on one page using Spring Web Flow and JSF

I'm trying to use JSF to validate two different forms in Spring Web Flows. The problem is that validateAllOnClick seems to fire EVERY clientside validator on the page. Setting processIds to the form I want to validate's ID, or input ID, or validator ID just causes none of the client side validators to fire if I also remove validateALlO...

Junit test case for wrapper class

I have a Java class that simply extends a library class and calls a method of its parent with a default parameter. How do I write a Junit test for that? A MockObjectTestCase is good too. Here is an example of what I'm talking about: public class ResourceBundleMessageSource { public String getMessage(String key, Object[] objects, Loca...

Spring context tests can't find config locations

I have a large application spread across multiple Spring bean definition xml files. In my test suite I manually load up the XML files I need using a FileSystemXmlApplicationContext to perform the tests I want to run. This reduces test set up time and allows me to use the same exact configuration files that are used in production. Now I...

NullPointerException With Quartz & Spring

I'm using the Spring Quartz integration, and every time I try to shut down Tomcat, the Quartz processes fail to shut down. This is the stack trace: Exception in thread "org.springframework.scheduling.quartz.SchedulerFactoryBean#0_QuartzSchedulerThread" java.lang.NullPointerException at org.apache.commons.logging.LogFactory...