spring

Spring MVC: disable DefaultAnnotationHandlerMapping

I'm using Spring MVC with <mvc:annotation-driven /> I've implemented my own mapping handler extending DefaultAnnotationHandlerMapping, but I'm not sure how to use it. I've declared it like this: <bean class="es.kcsolutions.boulevard.DispatcherMappingHandler" /> It works, but, obviously, DefaultAnnotationHandlerMapping works too and a...

Help needed with Spring/Hibernate Lazy-loading

Hi, I know that this has been discussed lot of times. I just can't understand how this work or where my mistake is. I think giving you a reduced example is the best way to show you what I'm trying to do and what assumptions I'm taking... I have a Product class with a name. The name is a String property that is lazy. My DAO: public ab...

Tiles 2 And No mapping found for HTTP request with URI - Spring-MVC

I want to use Spring-Tiles intergration. Here you can see how my app looks like. So my question is: why Spring-MVC dispatcher Servlet can not resolve my Target page ??? ...

Is there an easy way to turn empty Java/Spring form input into null strings?

Is there an easy way to turn empty form input into null strings in java? I'm using spring mvc and SimpleJdbcInsert to insert the object into a MySQL database. I'd like to set the blank input to NULL in the database rather than ''. I have quite a few fields, and I'm hoping for a way to do this without manually checking every value. Th...

Maximize a JSR168/Spring portlet when it changes to Edit mode

Related/similar question: 2795890 Our team is working on a portlet that has a rather comprehensive configuration view. Currently we are using the maximized view of the portlet to display the configuration page -- but really we should be taking advantage of the Edit view and put the configuration there. The problem is that when our porta...

Rolling back a transaction in a Grails Service

I have been updating all my services to be transactional by using Grail's ability to rollback when a RuntimeException is thrown in the service. I have, in most cases, doing this: def domain = new Domain(field: field) if (!domain.save()) { throw new RuntimeException() } Anyways, I wanted to verify that this indeed will rollback the ...

Applet in client-server infrastructure

Hello! I have a general question concerning client-server design. We have a Java server with Spring, a GWT client program and some HTTP-servlets for our site. At the moment we also want to develop an applet which would communicate with that server in such a way GWT-client and site requests do. Is it a good idea to communicate with the...

How do I prevent unauthorized users from deleting objects in my domain model?

I got similar domain model 1) User. Every user got many cities. @OneToMany(targetEntity=adv.domain.City.class...) 2) City. Every city got many districts @OneToMany(targetEntity=adv.domain.Distinct.class) 3) Distintc My goal is to delete distinct when user press delete button in browser. After that controller get id of distinct and p...

JSF data transfer between UI and business layer

Hi, We are using JSF in UI, Spring in business layer, Hibernate in persistence layer. Now my question is how to pass data from the JSF UI to spring business layer. Can I directly use my business object in my backing bean or should I transfer data between the layer through DTO? Can one explain me with clear explanation if possible with p...

Is context:annotation-config an alternative to @AutoWired?

Is it correct that I can put context:annotation-config in my XML config and it will automatically inject the bean class without needing any annotations? So instead of using these annotation types: public class Mailman { private String name; @Autowired private Parcel Parcel; public Mailman(String name) { th...

Confused about using SpringMVC Vs JEE project in Netbeans

Hi all, I want to start a my first JEE project. I have read a lot that springMVC framework is a good choice (never used though) My earlier experience with java is not much. only some small app development using Netbeans. so I have some experience using Netbeans. but I see that I can start a JEE project in Netbeans. so what kind of ...

Componentizing complex functionality in an MVC web app

Hi Everyone, This is question about MVC web-app architecture, and how it can be extended to handle componentizing moderately complex units of functionality. I have an MVC style web-app with a customer facing credit card charge page. I've been asked to allow the admins to enter credit card payments as well, for times when credit cards ...

Whats the relationship between Spring and javax.enterprise.inject?

I was reading a Wikipedia article about Java EE application servers here: http://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Edition#Java_EE_5_certified It says that 2 APIs that Java App Services implement are: javax.enterprise.inject javax.enterprise.context These both relate to application context and dependency injection JSR-...

How to use pom.xml/Maven to initialize a local thoughtsite (App Engine sample) project in Eclipse?

This sample app ("thoughtsite") for App Engine contains a pom.xml in its trunk: http://code.google.com/p/thoughtsite/source/browse/#svn/trunk But I don't know what command to run in Maven to set up the project locally. (The README doesn't mention anything about Maven.) I tried to just import the project code directly into Eclipse but ...

Using prepared statements with JDBCTemplate

Hi. I'm using the Jdbc template and want to read from the database using prepared statements. I iterate over many lines in a csv file and on every line I execute some sql select queries with it's values. Now I want to speed up my reading from the database but I just can't get the Jdbc template to work with prepared statements. Actually...

Spring transactions not committing

I am struggling to get my spring managed transactions to commit, could someone please spot what I have done wrong. All my tables are mysql InnonDB tables. My RemoteServiceServlet (GWT) is as follows: public class TrainTrackServiceImpl extends RemoteServiceServlet implements TrainTrackService { @Autowired private DAO dao; @Override ...

How to get around LazyInitializationException in scheduled jobs?

I am working on a J2EE server application which is deployed on Tomcat. I use Spring source as MVC framework and Hibernate as ORM provider. My object model has lot of Lazy relationships (dependent objects are fetched on request). The high level design is like Service level methods call a few DAO methods to perform database operation. The ...

How do I get spring-ws + tomcat to log errors

I'm creating a Spring-WS based webservice and running it in tomcat. I made some change and now get a fault with OperationUnsupportedException. I'd like to see the entire stack trace that Spring-WS is getting, but cannot figure out how to have it logged. Does anybody know how to have this stack trace logged somewhere? ...

Spring, Need to use a a bean declared in a ApplicationContextFactory servlet, in a DispatcherServlet

Hello, i have a web.xml with these 2 servlet: <servlet> <servlet-name>ApplicationContextFactory</servlet-name> <servlet-class>com.bamboo.common.factory.ApplicationContextFactory</servlet-class> <load-on-startup>1</load-on-startup> </servlet> AND <servlet> <servlet-name>dispatcher</servlet-name> ...

How to preserve object identity across different VMs

To be specific let me illustrate the question with Spring http-remoting example. Suppose we have such implementation of a simple interface: public SearchServiceImpl implements SearchService { public SearchJdo processSearch(SearchJdo search) { search.name = "a funky name"; return search; } } SearchJdo is itself...