spring

Spring, abstract class and annotations

Hi, I've got a pretty simple abstract class public abstract class AbstractServiceActions { @Autowired protected DatabaseModel dbModel; protected User user; protected boolean complete; protected String serviceResult; public AbstractServiceActions(User user) { this.user = user; this.serviceResult = ""; } public abstract String doActi...

NoClassDefFound error - Spring JDBC

Right now, I'm compiling my .class files in eclipse and moving them over to my %tomcat_home%\webapps\myapp\WEB-INF\classes directory. They compile just fine. I also have in the ...\classes directory a org.springframework.jdbc-3.0.2.RELEASE.jar which I have verified has the org.springframework.jdbc.datasource.DriverManagerDataSource clas...

Testing Hibernate DAO, without building the universe around it.

We have an application built using spring/Hibernate/MySQL, now we want to test the DAO layer, but here are a few shortcomings we face. Consider the use case of multiple objects connected to one another, eg: Book has Pages. The Page object cannot exist without the Book as book_id is mandatory FK in Page. For testing a Page I have to cr...

What happens if a bean attempts to load the Spring application context in its constructor?

Given the following Spring application context and class A, what happens when you run class A? applicationContext.xml (in classpath): <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframew...

How should each class in an application retrieve the Spring application context?

How should each class in an application retrieve the Spring application context? Or, stated another way, how many times should an application invoke new ClassPathXmlApplicationContext("applicationContext.xml")? ...

when to use Hibernate vs. Simple ResultSets for small application

I just started working on upgrading a small component in a distributed java application. The main application is a rather complicated applet/servlet combo running on JBoss and it extensively uses Hibernate for its DataAccess. The component i am working on however is very a very straightforward data importing service. Basically the wor...

Spring Webservices and Json

Hi Is it possible to send json and receive json using spring webservices? Thanks Damien ...

how to initialize spring bean from database

hi,i use spring security and my config is in database: <sec:http auto-config="true" entry-point-ref="casProcessingFilterEntryPoint"> <sec:remember-me /> <sec:session-management> <sec:concurrency-control max-sessions="1" error-if-maximum-exceeded="true" /> </sec:session-management> ...

JdbcTemplate — logging the dataSource connection url

Hi, is there a way to log the JdbcTemplate's DataSource connection URL in Java? The field exists in the DataSource, but there ain't a getter to access it. Of course I could read the DataSource properties from the application context xml, but I'd like to do it the other way. ...

interface com.sun.xml.ws.developer.WSBindingProvider is not visible from class loader

In tomcat web container spring listens to session and executes a destroy-method on a "session-scoped" bean, that invokes a web-service. sometimes this strange exception is raised: interface com.sun.xml.ws.developer.WSBindingProvider is not visible from class loader What can this mean? ...

How to map a search object to a class with more fields with JPA annotations

Hi all, I'm a newbie with JPA. I need to map a search object to a table. The search object has only and id, name. The big object has more fileds id, name, adress and more. I use this as big object view plaincopy to clipboardprint? I use this as big object @Entity @Table(name="users") public class User { @Id @GeneratedValue(strate...

Managing Strategy objects with Hibernate & Spring

This is a design question better explained with a Stack Overflow analogy: Users can earn Badges. Users, Badges and Earned Badges are stored in the database. A Badge’s logic is run by a Badge Condition Strategy. I would prefer not to have to store Badge Condition Strategies in the database, because they are complex tree structure objects...

Which Java MVC Framework best aligns with the Web Application Security Framework Manifesto?

Has anyone in the stackoverflow community ever studied the security characteristics of various J2EE frameworks? I would love to understand what framework best aligns with the Web Application Security Framework Manifesto http://labs.securitycompass.com/papers/secure-web-application-framework-manifesto-v0-08.pdf ...

Best practice to manage the path breadcrumbs in Spring without Web flow

I am engaged in a project where I need to show path bread crumbs to the user like Home (This is linked to home page) >> (page name) and like Home >> contacts and in contacts like Contacts >> create Contacts >> edit etc. Is there a best practice how to do this in spring without he usage of spring web flow? I am not us...

Handling Session ID with Spring

Hi, I'm trying to build a Spring server for GWT (you can think of it as of Javascript AJAX client). But I can't decide on one point of architecture. How should session be created and used? The obvious easiest way - is to use HTTP sessions (cookies and stuff). Looks fine, but I think that sending session ID separate from the headers wou...

Spring MVC handle button event in list

Hi, i created a list of Users <div class="usersList"> <c:forEach items="${users}" var="user"> <div class="listElementAction"> <c:out value="${user.id}"/> </div> <div class="listElement"> <c:out value="${user.firstName}"/> </div> ...

What web platform is right for me?

I've been looking at web frameworks like Rails, Grails, etc. I'm used to doing applications in Spring Framework with Hibernate... and I want something more productive. One of the things I realized is that while some of the things in Grails is sexy, there are some serious problems with it. Grails' controllers: 1) are implemented awfull...

Get command object

I am writing a spring 2.5 application and in my jsp I'm writing my own tags. It's about a list of objects...when I change the number of rows that list shows(a combobox), I am doing a submit on my form returning back to the view(obviosly with the new number of rows returned). When listing with my own tags I need to get the properties fr...

Why my onsubmitg is not firing - Spring

Hi, i have a controller public class EditUserController extends BaseController { public EditUserController() { setCommandClass(User.class); setCommandName("editaUser"); } public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException...

Spring security and authentication provider

I'm trying to implement Spring 3 Security in a project, but I can not get rid of the following error: SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_methodSecur...