I have the following in my xml configurations. I would like to convert these to my code because I am doing some unit/integration testing outside of the container.
xmls:
<bean id="MyMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:sql-map-config-oracle.xml"/>
...
I am trying to write a portlet for Liferay (using Tomcat and Spring) and need to use a database via Persistence API/Hibernate. I am using some configuration XMLs (applicationContext.xml, etc.) and annotations to realize that. e.g.
@Component @Scope("application")
public class SomeForm {
@PersistenceContext EntityManager entityManager...
Hi,
I am wondering if JdbcTemplate and RowMapper supports complex object retrieval.
I couldn't find anything with google on this matter (Wrong criteria?). :(
Example:
public class Person() {
private Long id;
private String name;
private PersonDetail personDetail;
}
public class PersonDetail() {
...
}
Tables will loo...
Hi all,
I have code which is structured as Spring beans and dependencies among them. This is only a small part of the code since the rest is 'legacy' code.
At this point in time I would like to perform an action on one of these beans in an existing 'legacy' class that extends javax.servlet.ServletContextListener. This class initializes...
How should I test a service method that is transactional for its simultaneous use (it updates a database row by decreasing a value)?
I have setup a JUnit test class with SpringJunit4ClassRunner and components are @autowired.
Just spawning threads which would call the method doesn't seem to work. I'm not sure whether this has something ...
Hi, complete and utter newbie on spring webflow (and indeed, spring mvc).
30 minutes in... got the first page of my flow appearing, which happens to be a captcha, an input field and a submit button.
The actual captcha value is stored in session and i need to validate that the input field values matches the value in session.
In order to...
Hi, I'm using Spring JdbcTemplate, and I'm stuck at the point where I have a query that updates a column that is actually an array of int. The database is postgres 8.3.7.
This is the code I'm using :
public int setUsersArray(int idUser, int idDevice, Collection<Integer> ids) {
int update = -666;
int[] tipi = new int[3];
tipi[0] = j...
I want to be able to create a Tuple2 from spring config where I explicitly declare the types of my parameters:
<bean class="scala.Tuple2">
<constructor-arg index="0" value="Europe/London" type="java.util.TimeZone" />
<constructor-arg index="1" value="America/New_York" type="java.util.TimeZone" />
</bean>
This does not work...
I have following in my applicaionContext.xml
<bean id="IbatisDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@123.210.85.56:1522:ORCL"/>
<property name="username" value="mydb"/>
...
Design question for using Business Objects as formBackingObjects in a Spring SimpleFormController.
Our controller's responsibility is to allow an End User to add a new Business Object to our web application.
So we are passing our Business Object though the formBackingObject(HttpServletRequest request) method. However, we've run into a...
First let's look at the utility class (most javadoc has been removed to simply the example):
public class ApplicationContextUtils {
/**
* The application context; care should be taken to ensure that 1) this
* variable is assigned exactly once (in the
* {@link #setContext(ApplicationContext)} method, 2) the context is...
I am trying to find the best way to pass complex configurations in a Spring webapp running in Tomcat. Currently I use JNDI to pass data sources and strings from the Tomcat context into the webapp, and this works well.
But, lets say I need to select the implementation of a notification service. There is no way that Spring can conditiona...
When my spring is loading up, it says applicationContext.xml is not found in the classpath by throwing FileNotFoundException as can be seen below. Please help me resolve this problem.
my web.xml content is as follows,
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.or...
Packaging Controllers, Services,etc. i.e.
- com.company.controllers
- com.company.services
Is this a good practice or should be avoided by all means??
Another worth mentioning problem I encountered is in naming services Example
SomthingGatewayService.groovy can't be initialized in both these ways
- SomthingGatewayService somtinggatew...
Is it possible to create a web service operation using primitive or basic Java types when using the Jaxb2Marschaller in spring-ws? For example a method looking like this:
@Override
@PayloadRoot(localPart = "AddTaskRequest", namespace = "http://example.com/examplews/")
public long addTask(final Task task) throws AddTaskFault {
// do som...
Hi everyone,
I'm having a stupid configuration issue with Ibatis in my Spring project. Please don't jump on me about how all this was setup, I'm just following the "in house project structure policy".
So here is the structure, we have the "src/main/resources/META-INF/" folder that contains all of our config files used by the applicati...
Im using the Spring RESTTemplate on the client side to make calls to a REST endpoint. The client in this case is a spring app and using Tomcat as the servlet container.
I'm running into issues making a connection to a https endpoint. I am receiving the following error:
org.springframework.web.client.ResourceAccessException: I/O error:...
Hi. Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using native2ascii and it solved my problem. Is there no other way of converting the file through setting the encoding to ascii in the confi...
Hi,
I am very new to Spring and I have been given some basic instructions to move some code into a new project that uses Spring and I am having trouble with the SimpleFormController (which I was instructed to user).
I have a page and when it loads it has a drop down with data populated from the DB. A list of "messages" is retrieved fr...
Hi
I am using Eclipse webtools to develop a hello world application that runs on oracle 11gR1 development server. I use the Oracle eclipse tools to perform the deployment on the server.
I am following the 'Developing a Spring Framework MVC application step-by-step' guide.
I passed step 1 by having a simple jsp work. But step 2 brings m...