spring

How to use property from property file specified in PropertyPlaceholderConfigurer in JSP

In my application context I have defined properties file: <context:property-placeholder location="classpath:application.properties" /> I want to get value of the property defined in that file on JSP page. Is there a way to do that in the way ${something.myProperty}? ...

Is it possible to access Spring MVC annotated session vars across multiple controllers?

I have a web app running Spring 3.0 and using Spring-MVC. I have a few controllers set up like this: @Controller @RequestMapping("/admin") @SessionAttributes({"clientLogin", "selectTab", "user", "redirectUrl"}) public class AdminController { ... } @Controller @SessionAttributes({"clientLogin", "selectTab", "user", "redirectUrl"}) publi...

Spring/Spring Security 3.0.x execution flow

Hi all, I'm currently in the process of migrating an application from Spring 2.5.6 to Spring 3.0.4 and Spring Security 3.0.2 and I was wondering if there was some kind of execution flow for both of these framework so that developpers could know what is being called before what. For those of you who are doing this kind of migration, I ca...

webservice call is not authenticated using HTTP Basic authentication

Hi, I am using Glassfish 3.0 with Spring Security 3.0 and exposed one of my EJBs as webservice using JAX-WS 2.0 annotation. I have generated WSDL and other portable artifacts and can access the webservice using a WS-client. Using JAAS I can make the webservice secured with "HTTP Basic Authentication" (using jdbc realm). But using Spring...

Is it OK to have singleton DAO objects?

Consider the following classes' structure: BaseDAO with methods to crest PreparedStatement and get connection from pool AccountDAO extends BaseDAO to work with Account table via JDBC. This class is singleton AccountService witch calls methods of AccountDAO like this: AccountDAO.getInstance().login(name, password). AccountDAO is a Spr...

Memory Leak - com.mysql.jdbc.ConnectionPropertiesImpl$*ANY*ConnectionProperty

I seem to have a memory leak, one of the culprits seems to be the ConnectionProperty, whether it is String, Int or Boolean ones. e.g.:'com.mysql.jdbc.ConnectionPropertiesImpl$BooleanConnectionProperty', millions seem to be staying around and not being GC'd. Here are my settings for the DB, Session Factory, Hibernate and Pooling etc..: ...

Spring MVC - Session - Request

I have a Spring MVC (3) Controller and I trying to put in the annotations but failed Heres my code outline @Controller public class SpringController{ @RequestMapping("/welcome") public String myHandler(@RequestParam("id" String id)){ //My RequestParm is able to do the job of request.getParameter("id") HttpSession session = request...

Integrating multiple web components (wars)

We have multiple modules (e.g. master data module, physical module, derivative module, risk module etc) having one war for each of them. Since master data module will be used by all other modules, we can put dependency of mdm jar in all other modules. All modules other than master data requires some functionality from each other. We don'...

Spring: Inject bean depended on context (session/web or local thread/background process)

Is it possible to create a factory or proxy that can decide if thread is running in (Web)Request or background-process (ie. scheduler) and then depending on that information, it creates a session bean or a prototype bean? Example (pseudo Spring config :) <bean id="userInfoSession" scope="session" /> <bean id="userInfoStatic" scope="pro...

Spring MVC Multiaction Controller getParameter returning null

I am new to Spring MVC, need guidance My jsp is like : <form:form name="form1" method="post" action="input.htm?method=getHealth"> ....... <td > <form:select path="envList"> <form:options items="${envList}"/> </form:select> </td> My .java is like: public class InputController extends MultiActionController { public ModelAndView ge...

How can I create a dynamic number of DefaultMessageListenerContainer MDPojos in Spring?

I need to create a variable number of these based on a configuration value, the intention is to have multiple consumers where each corresponds to a physical resource that can only be used by one thing at a time to process the message. ...

Are methods in a Singleton class thread safe?

Is Concurrent method access in singleton class thread safe? I am using Spring framework (MVC) with the default scope as Singleton. For example, if the controller of my web application is a Singleton class, are the methods declared to access Model/Business/DB classes thread safe, if accessed by multiple threads at the same time? How abo...

Recommended data model and data source for a Spring MVC website administration / configuration page?

I am interested in having a web configuration/admin page for a website. Is it more common to store a websites configuration in a database, xml, or .properties files? What does the data model (classes) usually look like? If stored in a file, is concurrent access typically handled and how? Are there any good examples for a generic site a...

Problem with Velocity - ResourceNotFoundException when using with Spring MVC

I am using Spring MVC for my web application and I am integrating Velocity for templating my emails. I am getting the following 500 error when It attempts to send my email. org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/WEB-INF/velocity/registrationEmail.vm' I am aware of what this means and what ...

Using Spring annotations, how can we use DI with a superclass via annotations?

I have the following class defined as a bean: @Repository("userDao") public class UserDao extends JdoDaoSupport implements IUserDao {...} The class JdoDaoSupport requires a persistenceManagerFactory injected into it. I've declared the persistenceManagerFactory bean in XML, how do I inject it to my superclass using annotations? JdoDa...

Any readable, working Flex+BlazeDS+Spring+GAE (storing more than one table in GAE Datastore) tutorial?

I need a readable tutorial on working with Flex+BlazeDS+Spring+GAE (storing more than one table in GAE Datastore). Is there any such? ...

Hibernate Interceptors or Events for Audit Trail?

I record a history of all changes to some entities and am about to implement a mechanism similar to Envers to take care of this automatically. My question is whether to use Hibernate interceptors or their event system? It seems like interceptors is a little simpler and does all I need. And Hibernate's own documentation suggests using ...

Spring Security: How do I reset SPRING_SECURITY_LAST_EXCEPTION.message?

I am able to display the SPRING_SECURITY_LAST_EXCEPTION.message ("Bad Credentials") when a user tries to log in with incorrect credentials. My login jsp currently uses the following code: <c:if test="${not empty SPRING_SECURITY_LAST_EXCEPTION.message}"> <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}" /> ...

Deploying a Spring app as ear to Glassfish v3 - Ambiguous DeploymentException "Module type not recognised"

Hi, I am trying to deploy an .ear to Glassfish v3. The .ear is a "Spring" application made up of two modules: domain.jar (entities, persistence) service.jar (business logic with spring bean config). I'm creating the .ear with Maven ear plugin and the resultant dir structure of the .ear is as follows: /APP-INF/lib/domain.jar;servic...

Unable to locate Spring NameSpaceHandler - Spring's mvc-basic in equinox using MANIFEST.MF similar to web-console Spring DM sample webapp

Trying to deploy Spring's mvc-basic in Equinox container. Brief error (full below): org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context] Offending resource: ServletContext resou...