spring

Spring aop multiple pointcuts & advice but only the last one is working

I have created two Spring AOP pointcuts that are completely separate and will be woven in for different parts of the system. The pointcuts are used in two different around advices, these around-advices will point to the same Java method. How the xml-file looks: <aop:config> <aop:pointcut expression="execution(......)" id="pointcutO...

Spring MVC: easiest way to see incoming requests

I am debugging a Spring MVC (3.0) app, deployed on tomcat. I want to see in my console or log files all the incoming requests. Including 404s, both generated by my app or by spring because it didn't find an appropriate controller. I'd like to see something like this: GET /index.html GET /img/logo.png GET /js/a.js GET /style/b.css POST...

How can I make properties in properties files mandatory in Spring?

I have an ApplicationContext.xml file with the following node: <context:property-placeholder location="classpath:hibernate.properties, classpath:pathConfiguration.properties" /> It specifies that both properties files will be used by my application. Inside pathConfiguration.properties, some paths are defined, such as: PATH_ERROR=/...

How can I map a spring controller to a url with .jsp extension?

Hi. We are in the process of migrating a jsp-only application to Spring-MVC. For various reasons we can't change the extension of the current pages. (calls to login.jsp need to handled by a spring controller that will use a jsp file as view). We are doing this iteratively, so some pages need to stay jsp files (calls to welcome.jsp won'...

How can I translate text inside controller in Spring Framework 3 ?

I need to send email confirmation, so now I have to localize sent message. I have initialized i18n in spring and now it works perfectly in jsp pages, but how can I use it in my controllers? ...

Get all existing session beans from all users in Spring

Is there a way to get all existing session beans managed by Spring at runtime? Getting them for the current user is easy. Any suggestions? Thanks, XLR ...

Ability to switch Persistence Unit dynamically within the application (JPA)

My application data access layer is built using Spring and EclipseLink and I am currently trying to implement the following feature - Ability to switch the current/active persistence unit dynamically for a user. I tried various options and finally ended up doing the following. In the persistence.xml, declare multiple PUs. Create a clas...

Spring Sample Application

Could anyone point me towards some good, detailed, sample Spring applications? Ideally those with good test coverage! ...

spring add default value to form:select

I'm developing a spring application, now I've added a dropdownlist to one of my jsp pages using: <form:select multiple="single" path="users[y.count-1].X" items="${Y}" itemValue="id" itemLabel="name"/> Now I'd like to add the default value "Nothing selected", however I can't seem to find how to do this. I've tried: <form:select multip...

Pointcut matching methods with annotated parameters

I need to create an aspect with a pointcut matching a method if: Is public Its class is annotated with @Controller (Finally does not) One of its parameters (can have many) is annotated with @MyParamAnnotation. I think the first two conditions are easy, but I don't know if its possible to accomplish the third with Spring. If it is no...

Spring & Hibernate SessionFactory - recovery from a down server

So pre spring, we used version of HibernateUtil that cached the SessionFactory instance if a successful raw JDBC connection was made, and threw SQLException otherwise. This allowed us to recover from initial setup of the SessionFactory being "bad" due to authentication or server connection issues. We moved to Spring and wired things in...

javamail smtp issue

I am using spring to send mail and for some reason its stripping the from email address. I ma sending the complete address form the sender to the mails server. I can see the mail (.eml) file in the Dropbox under c:/inetpub/mail but its not sent Following is the log of from the mail server 10.105.21.299, taq02, 5/4/2010, 14:50:32, SMTPS...

What is Dispatcher Servlet in Spring?

http://maestric.com/wiki/lib/exe/fetch.php?w=&amp;h=&amp;cache=cache&amp;media=java:spring:spring_mvc.png In the above image, HTTP request sends something to Dispatcher Servlet. My Question is what does Dispatcher Servlet do. Is it something like getting the information thrown from the web page and throwing it to the controller. ...

Spring @RequestMapping and trailing slash problem

I am trying to map a method in a Controller using the annotation with URI template: @RequestMapping(value="/select/{customerNumber}/{resource}", method=RequestMethod.GET) It appears that this does not get mapped if there is a trailing slash at the end of "resource". Update: Using Spring 3.0.2 release Update: @RequesMapping seems to ...

ActiveMQ broker configuration error when specifying persistenceAdapter: "One of '{WC[##other:"http://activemq.apache.org/schema/core"]}' is expected"

I am setting up a simple ActiveMQ embedded broker. It works fine, until I try to configure a persistence adapter. I am basically just copying the configuration from http://activemq.apache.org/persistence.html#Persistence-ConfiguringKahaPersistence. When I add this configuration to my Spring configuration, like so: <?xml version="1.0"...

Wicket testing - AnnotApplicationContextMock - There is no application attached to current thread main

I've written a couple of tests for a small web app, but I get an error when I try to run the page specific tests that makes use of WicketTester. Google sends me to a mailing list for Apache Wicket, where a user experienced the same exception. He/she said the problem was that AnnotApplicationContextMock was initialized before the Wicket ...

Upgrading dojo in Spring-js from 1.3 to 1.4

We have a project where we're using Spring-js. With it comes Spring-dojo and the full dojo package. But in the current version of Spring-js (2.0.9), it's using dojo 1.3. Is there a way to upgrade manually to dojo 1.4? Or even a new Spring-js.jar-file that can be donwloaded that uses dojo 1.4? ...

Spring MVC Table selected row

Hi, in a Spring MVC 2.5 application i'm using a spring <form:form> component and in this form a table with c:forEach is rendered. In each row a submit button is placed in. If i start a submit by clicking a button i would like to knwo, which button has processed the submit. <form:form commandName="formObject"> <table class="data-table"...

How to introduce 'Remember me' checkbox to existing project with Spring Security?

I have a pretty standard project with Spring Security. I have a login form and I need to add 'Remember me' checkbox there. How can I do that? I can provide some code if necessary. ...

Problem with Spring creating instance of Action class with null Service object

I've inherited a project using spring/hibernate/struts in which I'm currently trying to setup a couple of beans. When I startup the server, I can see right away (from myEclipse) that a couple instances of my ActionClass are being created properly. The problem is that when I make a call to that ActionClass, I can see another instance of t...