spring

should a Service layer be a Spring bean?

Can or should a Service layer be a Spring bean? If so, how should it be got from a calling application, a consumer of a service? Because the consumer must be aware that such a bean exists, so it in any case must use Spring to make use of Service methods. ...

Reduce frequency of deployments in a Java web application using Spring-MVC

Is there a simple way to have your "Service Layer" deployed separately from your web layer, so that I can reduce the number of times per week that I have to, package, build and deploy the entire WAR file? I'm using Tomcat mostly, but I'm hoping for something more generic to Java web servers ...

Does spring mvc can trim all string obtained from forms?

I know struts2 default config will trim all string obtained from forms. For example. In form I type " whatever " in form and submit finally I will get "whatever". It's will auto trim the string. I want to know is that spring mvc have this function too? THX. ...

SpringFramework3.0: How to create interceptors that only apply to requests that map to certain controllers?

In it's simplest form, I want an interceptor that checks session data to see if a user is logged in, and if not redirects them to the login page. Obviously, I wouldn't want this interceptor to be used on say the welcome page or the login page itself. I've seen a design that uses a listing of every url to one of two interceptors, one doi...

How to figure out which jars are needed?

How can I systematically determine which jars I'll need, and thus should include in my pom.xml file (I'm using maven as my project management tool)? When learning spring, to keep things simple, added all the jars (even the ones I never used) to the classpath. Right now for the most part, I'm guessing which jars to include. For exampl...

struts2: accessing external service from type converter

is it possible to inject a service reference into custom type converter? my situation is quite typical in fact, I have a combo, which binds to collection of entities. On submit I get only an ID of selected entity and have to refetch the real object in my action. I was thinking about more elegant way to do this, and it seems like making ...

Apache CXF 2.2.7 and Spring 3.0

Apache CXF is shipped with Spring 2.5.6, can I also use the Spring 3.0 framework without serious troubles. ...

CGLIB proxy error after spring bean definition loading into XmlWebApplicationContext at runtime

I load additional singleton beans definitions at runtime from external jar file into existing XmlWebApplicationContext of my application: BeanFactory beanFactory = xmlWebApplicationContext.getBeanFactory(); DefaultListableBeanFactory defaultFactory = (DefaultListableBeanFactory)beanFactory; final URL url = new URL("external.jar"); fin...

Problem with Autowiring & No unique bean

I have 2 classes (B,C) extends class A. @Service public class A extends AbstratClass<Modele>{ @Autowired A(MyClass br) { super(br); } @Service public class B extends A{ @Autowired B (MyClass br) { super(br); } @Service public class C extends A{ @Autowired C (MyClass br) { super(br); ...

Servlet Mapping Help - Possible to Avoid Referencing Context Name?

Hi all, I am working on a Spring application using Tomcat 6 and Spring 2.5. I'm trying to get my URL mapping correct. What I would like to have work is the following: http://localhost:8080/idptest -> doesn't work But instead, I have to reference the context name in my URL in order to resolve the mapping: http://localhost:8080/&lt;...

HibernateTemplate alwaysUseNewSession

Hi, I had a problem where I was using the hibernate template to do most of my DB work but I had a part of the system that directly accessed the session to do batch persisting. I noticed that the hibernate template session was old and would be storing cached values which didnt take into account the objects save with the session directly. ...

Spring MVC 3.0: Avoiding explicit JAXBElement<> wrapper in method arg

I have the following method and want to avoid having to explicitly show the JAXBElement<> syntax. Is there some sort of annotation that would allow the method to appear to accept raw MessageResponse objects but in actuality work the same as shown below? I'm not sure how clear that was so I'll say this: I'm looking for some syntactic suga...

Spring 3 JSR-286 (portlets) docs

I know that Spring 3 supports JSR-286 (portlets version '2.0'). However I can't find a lot of documentation on that. Can anyone share some links about this? Thank you. ...

OJB Reference Descriptor 1:0 relationship? Should I set auto-retrieve to false?

Hi, I am having an issue while using Apache OJB with Spring 2 inside my web app. I'm using OJB reference-descriptor with 2 foreign key properties. I have an object A (parent) and object B (referenced object). The thing is, for an object A, there may or may not be an object B. In the case where there is no object B to go with Object A...

"Detecting" and loading of "plugins" in GAE

Hi! I have a "plugin like" architecture and I want to create one instance of each class that implements a dedicated interface and put these in a cache. (To have a singleton-ish effect). The plugins will be provided as jars and put into the app engine war file before the app is uploaded. I have tried to use the ClassPathScanningCandid...

Image Upload directly from client to remote server? Spring/Tomcat

Just wondering what the common solution is for this. We have two web servers that are load balanced and a separate server that holds our images. Our current process is that a user uploads an image directly to the web server (which ever they are connected to) and we enter a job into our DB. Another process checks for image jobs every few ...

Spring internalisation

English properties file can be read bt when i click on french link it couldnt read.Can u tell me the stepwise process to do this.I hav images which need to be in french when i click in french.. ...

Special characters incongruence

Hello I'm building a Spring MVC web application that runs on Tomcat 6.0.20 and JDK 1.6.0_19. When I send some special characters through an HTML form some of them are stored as question marks ? For example these symbols are stored correctly: €, á, é, í, ‰, etc But some symbols are replaced with ? like: ₤, ♪, ☺ MySQL tables charset is u...

What is the best way to get a reference to a spring bean in the backend layers?

I have two spring config files and I'm specifying them in my web.xml as in below. web.xml snippet .. <context-param> <param-name>contextConfigLocation</param-name> <param-value>WEB-INF/classes/domain-context.xml WEB-INF/classes/client-ws.xml</param-value> </context-param> <listener> <listener-class>org.springf...

PHP Programmer wanting to learn Spring

I'm a PHP programmer and I want to try creating a webapp using the Spring framework. The problem is I'm clueless and I don't know where to start. What tutorials/books/websites do you guys suggest that I should learn from? What's IoC? Do I use it alongside MVC? What components of the Spring framework should I use? How do I know what to...