Hello, i´m trying to generate reports with jasperreports, acording to documentation i need to configure the ResourceBundleViewResolver like this.
<bean id="resourceBundleView"
class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
<property name="basename" value="views"/>
</bean>
And a file called view.prop...
Can I make the spring service classes final? Is there any harm doing that? Nobody is going to extend the class. Is there any issue?
public final class MyService {
// Depedencies go here.
}
...
Consider the following output from a Tomcat server under Eclipse:
INFO: Initializing Coyote HTTP/1.1 on http-8080
INFO: Initialization processed in 634 ms
INFO: Starting service Catalina
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
SEVERE: Error listenerStart
SEVERE: Context [/MyServlet] startup failed due to previous errors
I ...
I have an extremely simple web application running in Tomcat using Spring 3.0.2, Hibernate 3.5.1, JPA 2, and Derby. I am defining all of my database connectivity in persistence.xml and merely using Spring for dependency injection. I am using embedded Derby as my database.
Everything works correctly when I define the driver and url pro...
If we only need to graphically authorize a user,
view a few tables representation (from database),
ability to change data in the database visually
what tools to use to write such a web application that will run on Tomcat?
What framework allows to do that in the most straightforward, easy-to-manage and elegant way?
...
I do not use HibernateTemplate, but work with getCurrentSession() in my DAO.
I would like to know how to declare Hibernate named queries in a beans.xml file (I do not use hbm.xml).
And maybe Spring has alternative means to declare Hibernate named queries?
...
Hi. I have a Hessian service on Spring + iBatis working on Tomcat.
I'm wondering how to cache results...
I've made the following config in my sqlmap file:
<sqlMap namespace="Account">
<cacheModel id="accountCache" type="MEMORY" readOnly="true" serialize="false">
<flushInterval hours="24"/>
<flushOnExecute statement="Account.a...
I know that in a standalone application I create one of the application context instances which in turn creates the beans from conf files. But I can not see any such code in dispatched servlet. How then are the beans created in a web application?
...
I'm gonna go with this design:
create an object and keep it alive during all web-app session.
And I need to synchronize its state with database state.
What I want to achieve is that :
IF between my db operations, that is, modifications that I persist to a db
someone intentionally spoils table rows, then on next saving to a database
...
Hi all,
I am writing a junit test in order to (surprisingly) test a part of my app as a standalone.
Thing is I execute the following line in a constructor being invoked in the unit test:
WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext();
How would I go about to set up a web context when ru...
Hi,
Spring mvc is a framework that has been long time out there, it is well documented and proven technology. A lot of web sites are using spring.
Seam is a framework based on jsf - rich faces implementation.
It has a lot of ajax based components.
It uses some heavy stuff like EJB, JPA.
All of this is prone to errors and this framework...
I am trying to add a test spring application context to the java runtime, so that my beans can be wired properly for my integration tests.
...
I am trying to write a custom select statement in Hibernate using the getHibernateTemplate() method. I am having problems with the resulting mapping.
Example Code:
List<User> users = getHibernateTemplate().find("Select user, sysdate as latestPost from User as user");
for (User user : users) {
assertNotNull(users.name);
}
The goal of...
I'm trying to create a web application using maven, tomcat and hibernate.
Now I'm getting a cannot find class for org.appache.commons.dbcp.basicdatasource for bean with name datasource... exception.
Without the hibernate aspects it works fine, but if I add
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<pro...
Is it possible to bundle Tomcat with a Spring application with Java WebStart & how ?
...
I am using standard JPA transaction manager for my JPA transactions. However, now I want to add some JDBC entities which will share the same 'datasource'. How can I make the JDBC operations transactional with spring transaction? Do I need to swith to JTA transaction managers? Is it possible to use both JPA & JDBC transactional service wi...
Hi There!
I am using Spring and struts in my application. To support il8n I have created a class
public class ApplicationMessageResource extends ResourceBundle implements MessageSource {
private static MessageSource ms = null; //Injected by spring and contains
parentMessageSourc...
Hi
I want to unit test a RESTful interface written with Apache CXF.
I use a ServletContext to load some resources, so I have:
@Context
private ServletContext servletContext;
If I deploy this on Glassfish, the ServletContext is injected and it works like expected. But I don't know how to inject the ServletContext in my service class...
I've come accross these websites who recommend certain books but they are pretty much old :
http://www.joelonsoftware.com/navLinks/fog0000000262.html
http://www.codinghorror.com/blog/2004/02/recommended-reading-for-developers.html
http://sites.google.com/site/steveyegge2/ten-great-books
Are there books in recent years which every dev...
I am using JdbcTemplate.queryForInt to insert a Row into the DB, and then get the ID back.
The Query is "INSERT INTO metadocs(NAME) values (?) RETURNING METADOCID". If I run the statement in Flamerobin, it works fine.
However, if I run it from Java, I get the following error:
org.springframework.jdbc.UncategorizedSQLException: Prepare...