spring

What are the best Spring converter strategies in the case of a String to convert to a set of object ?

I have the following (simplified) form in one of my view: <form:form commandName="entry" method="POST"> <form:input type="text" path="name"/> <form:input type="text" path="tags" /> <input type="submit" value="Submit"/> </form:form> Which is going to be bind to the following JavaBean: public class Entry { private String name; ...

Spring project expects to be at root directory, freaks out when it's not

I have a spring project that works beautifully when it's located at the web root - i.e. http://myserver/index.html but it breaks terribly when it's not - i.e. http://myserver/spring-project/index.html Is there a way to configure spring to live in a subdirectory? Going through docs has been entirely unhelpful. ...

How do I get RESTful URLS in Spring 3 MVC?

Hi everyone, I'm having a frustrating time with Spring 3 MVC trying to build RESTful web services. I want RESTful URLs, e.g. "my.domain.com/items", not "my.domain.com/items.do" or anything else that includes an extension. My web.xml includes the following. Note the URL pattern: <servlet> <servlet-name>addictedWebServices</servlet...

How to handle new implementation when using AutoWire in spring?

In the grails doc, I read (something along the lines) that the implementation of a server class will bu automatically wired based on the naming convention. If this is true, then how would one go about overriding this behavior down the road say if you have a new implementation? do we have options? like: use @annotations if you don't w...

AspectJ Load-time Weaving in Spring with method-call pointcuts?

I'm experimenting with AspectJ Load-time Weaving in Spring as described here. I've checked out the sample code, and it works as advertised. But when I try to change the pointcut of the PerformanceAdvice from execution(..) to call(..) semantics, the advice no longer gets executed. I know that Spring AOP does not support call(..) semant...

Binding to Collection in SPring MVC 2.5

Hi, I am maintaining a Spring MVC Web apps written in spring 2.5. Now I want to add some enhancement into it but currently encountering some problem. I created a select box and set the multiple option to true and disabled it also. The only way to populate the the select is thru making some ajax call. <form:select path="dataFiles" mu...

Configuration alternative to Spring @Transactional

Is there any configuration based alternative to the @Transactional annotation in Spring? I want to keep my java classes as free from Spring as possible, i.e. as decoupled as possible from any framework. ...

Spring aop pointcut expression to access method return type

I have a service interface with many methods, all of which take a Request object and return a Response object. All request objects have a common ancestor and all response objects have a different common ancestor (which has a success flag and a message field). Now I want to have an around aspect that checks permissions etc, performs the ...

How to add error on spring mvc simpleformcontroller

Hi All, I have this problem in my spring mvc 2.5 apps and I am not sure what should I do. Kindly look at my code: public class AddStationController extends SimpleFormController { private SimpleStationManager stationManager; protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, ...

Steps to run spring mvc basic sample application

So I open up intelliJ ultimate and opened up this application using the pom.xml : https://src.springframework.org/svn/spring-samples/mvc-basic/trunk/ The application built just fine, and I ran it with tomcat 6 (which I setup). I just got a default tomcat welcome screen. What am I missing here? Clicking run showed: Jun 23, 2010 8:2...

about j2ee, spring and hibernate

Basically i want to learn this technology. I already know J2SE. My question is, where is the good start to learn Spring and Hibernate? Is the book Head First JSP and Servlets good or what? ...

How to best cache server responses on server side with Jetty and Spring?

I'm using embedded Jetty 6 and Spring Web. What is the best way to cache served pages in this setup to avoid regenerating them on every request? ...

Spring or Struts web based tool to list content of database tables

Hi, Is there an open source web based tool preferably based on Spring(or struts) and Hibernate that will list the contents of a database table? I can write one but there are hundreds of tables so im wondering if i can use an existing open source tool that will list the contents of the table based on what i select. Basically all i wan...

Accent support for mails in Spring Framework

I'm sending a mail with the word Òmnium (see the accent) in the sender using Spring Framework. The code is the one I found for Spring: org.springframework.mail.javamail.JavaMailSenderImpl sender = sender(); javax.mail.internet.MimeMessage msg = sender.createMimeMessage(); MimeMessageHelper helper = new MimeMessageHelper(msg...

RESTEasy-Spring integrated webapp throws cryptic error: NoResourceFoundFailure

I am working on a webapp that uses both the Spring Framework and RESTEasy. The app has been configured to send REST requests for some time, but I recently set it up to receive REST requests as well. I configured my web.xml appropriately, and the app has received and processed REST requests with no problem. here is a web.xml snippet, det...

How to Configure SSL in the Informix Database in a Web Application?

Hi, I have posted the same question 2 month ago here and lot of nice people helped me. I was able to go through all the instructions mentioned in the link below to set up the ssl connections.Below are the links: Configure connections to the data source to use SSL. (link1) Configure your Java Runtime Environment to use SSL. (link2) I...

Jquery $.post question.

I have a form with a text field, that I want to submit using post (Jquery). I am using Java/Spring and Tomcat6 on the server side. Here comes the problem: The text is submitted correctly, unless there is a '.' in it. In that case the text is being truncated (everything after the '.' is ignored. Example: "Hello, this is a test." -> ...

Clustering on tomcat with spring

Hello! I have a Spring web application with singleton services. There're also some singleton variables such as map with session data for all authenticated users and so on. That all works nice on one server, but how could this system be distributed between a few servers? The system runs under Tomcat. Thanks in advance! ...

Instantiating a JdbcTemplate from a java.sql.Connection

Hi! I want to obtain a JdbcTemplate in my Java code. I've already got a working java.sql.Connection. To create a new JdbcTemplate it would normally need an instance of the javax.sql.DataSource interface. Is it somehow possible to obtain a new JdbcTemplatefrom an existing java.sql.Connection? ...

How can I access resources on a parent classpath using Spring 2.5.x?

In my Websphere Portal environment, I'm trying to configure a bean that uses a resource found outside of the WAR (it's in some parent classpath for WAS). I'm sure it's there because I can access it using the following: URL url = getClass().getResource("/config/someProps.properties"); However, in my Spring applicationContext.xml, the f...