I have a bean that i want to inject with a named list using Spring util namespace <util:list id="myList"> but Spring is looking for a collection of beans of type String instead. My broken test is:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class ListInjectionTest {
@Autowired @Qualifier("myList") private ...
In MVC (such as JSP and Spring), is it bad practice to view related code in the controller?
In my case, the controller does some work and then hands off the results to the view (JSP). In the case of a status message, I can pass the entire message text to the view, or pass a key and let the JSP map it to the message text.
Example:
Mess...
We have many Spring web applications to make on a WebLogic server and are curious about when WARs should go in an EAR and when they should just exist as WARs. Occassionally, the WARs will need to access common logic JARs, but I don't see why these would need to go into an EAR when they could just be packaged into the WARs.
From what I u...
This is an example of using ThrowawayController in Spring MVC:
public class DisplayCourseController
implements ThrowawayController {
private Integer id;
public void setId(Integer id) { this.id = id; }
public ModelAndView execute() throws Exception {
Course course = courseService.getCourse(id);
...
I have recently found your reply in a topic about using multiple persistence.xml files from multi module project. You said something about MergingPersistenceUnitManager. Could you please tell me where can I find it ? The link you provided seems not to work.
...
I'd like to use spring support for sending mails. My project is built with maven-2 and I use spring-core 2.5.5 I tried to look in maven central repo for artifact to include in my pom.xml, and the only one I found is spring support. The problem is that the highest version in repo is 2.0.8 and it depends on spring-core v. 2.0.8. Should I ...
The current version of Hibernate is 3.26 and Spring is 2.54 when I create a Spring and Hibernate project based off the default Archetype. How can I have Maven grab the newest release versions? I tried changing my spring version from 2.5.4 to 2.5.6 but 2.5.4 was still included in the generated war file.
...
Under what exact circumstances do @SessionAttributes get cleared? I've discovered some confusing behaviour when trying to use two models in a page.
When I do a GET followed by a POST using this controller...
@Controller
@RequestMapping("/myPage*")
@SessionAttributes(value = {"object1", "object2"})
public class MyController {
@Reque...
I have a following object:
public class TestObject
{
public String Something { get; set; }
}
and a following objects file:
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.n...
I want to display custom error message in jsp for spring security authentication exceptions.
For wrong username or password,
spring displays : Bad credentials
what I need : Username/Password entered is incorrect.
For user is disabled,
spring displays : User is disabled
what I need : Your account is diabled, please contact ad...
I'm reading Spring Framework reference, chapter about JMS integration. There are some examples for sending text messages and asynchronously receiving them (by listeners). And there is also an example for JmsTemplate function convertAndSend which converts given object to a message. The reference says:
By using the converter, you and y...
I am working with your typical three layered application that has a presentation layer, a business layer, and a DAO layer. It is a Java web application that uses Spring MVC, Spring Security, and Spring's transaction management from the business layer down. It is communicating with an Oracle 10g database.
I have a business layer method ...
I am working on a struts2/spring/hibernate application running in Tomcat 5.5 server. i have defined my struts action in session scope. The problem i am facing is even when the server session times out, and at that time, if the user clicks on any link in the application, he is redirected to the login page.(This is right and as expected) B...
Hi,
I'm following the examples from Modular Java but I'm having trouble with chapter 6 and adding the Spring DM modules to my project.
I run: pax-import-bundle -g org.springframework.osgi -a spring-osgi-extender -v 1.2 -- -DwidenScope -DimportTransitive
When running pax-provision the Spring DM bundles are not resolved. I get complaint...
Hello all,
I've run into a problem I can't figure out and Google search does not return much (I should of thought about posting my question here first ;-).
So I've got a GWT app, that makes a rpc call to a server to save/create a new entity. However, the Spring-Hibernate back-end throws an exception with the following error message:
...
I am trying to run a Spring webapp using maven with the
mvn tomcat:run
command, but whenever I navigate to http://localhost:8080/myApp, I get the error: "The requested resource () is not available". Nothing shows up in the logs. I think my app is supposed to be deployed to "/" instead of "/myApp". Is there a way to do this?
Maven out...
I have a webApp whit Spring and works correctly when I use HSQLDB in server mode but in file mode it only passes the unit test. This is my data source:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="org.hsqldb.jdbcDriver" />
<property na...
I wanted to wire the Google App Engine user service in Spring by first creating a UserServiceFactory bean and then using that to get an instance of UserService.
<bean id="googleUserServiceFactory"
class="com.google.appengine.api.users.UserServiceFactory"></bean>
<bean id="googleUserService"
class="com.google.appengine.api...
I was reading through spring framework documentation and found a section on raising events in Spring using ApplicationContext. After reading few paragraphs I found that spring events are raised synchronously. Is there any way to raise asynchronous events? your help is much appreciated. I am looking something similar which would help me t...
It doesn't seem to be working right now. I get a
java.lang.NullPointerException
I have a class that implements an interface
public class LearnerDao implements BaseDao {
private BaseDao dao;
public void setDao(BaseDao dao) {
this.dao=dao;
}
.
.
.
}
This is my wiring
<bean id="pm" factory-bean="pmf" facto...