spring

using internationalization on list data

i am using Struts2 in application. <s:iterator value="listObject"> <s:component template="abc.vm"> <s:param name="text" value="listValue" /> <s:param name="prefix" value="listIndex" /> </s:component> </s:iterator> listValue is a values of list. i am using iterator to traverse the list. now on listValue, i want to put here in...

Optional Spring bean references

In my application I am using ContextLoaderListener to load context files from many jars using: <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:META-INF/contextBeans.xml</param-value> </context-param> This means I can reference beans from other jars without doing import. In the applicatio...

How can I overload method in Java web-service?

Suppose I have the following methods declared in my web service: @WebMethod() public Long addNewApplication(String applicationName) throws ServiceManagerException { // implementation } @WebMethod() public Long addNewApplication(String applicationName, ApplicationState status) throws ServiceManagerException { // implementation }...

Spring Security LDAP - login problem (ProviderNotFoundException)

Hi, I have problem with LDAP Spring Security, I'm trying to authorise against the LDAP server. I have the spring configuration xml file (security-config.xml) like this: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sec="http...

Programmatic login doesn't work with subDomains ?

greetings all i am using the following method to make an auto login for user after registration to access an authenticated page: public static void autoLogin(User user, HttpServletRequest request, AuthenticationManager authenticationManager) { GrantedAuthority[] grantedAuthorities = new GrantedAuthority[] { new Gran...

Spring 3.0 MVC Ajax example

Hi I'm trying to send Ajax request to Spring MVC controller and map it to Java class accordingly: public class Person implements Serializable { private MutableLong Id = new MutableLong(); @NotEmpty @Size(min = 1, max = 50) String FirstName=null; @NotEmpty @Size(min = 1, max = 50) String LastN...

How to trace session creation

greetings all i have an application which are made with Spring framework and deployed on apache,tomcat and i see on tomcat manager that there are many un-used sessions in the application and i want to trace when this session are created and who is creating them, how to do so ? ...

Spring UserDetailsService is not Serializable session attribute in google-apps-engine

Here we have a Spring based webapp in google apps engine. I've created a UserDetailService class to load the UserDetails from the GAE data store (assuming this is the best approach). @Service("springUserDetailsService") public class SpringUserDetailsService implements UserDetailsService { @Resource(name="userDao") private IUs...

changes are not being reflected in when getting the result after insert thru hibernate

Hi, I am using hibernate and spring mvc, when i insert a record in DB, and try to access that that right after that, then i don't get the result. e.g. if insert a record for newly reg. user and login in him right after registering it then result set is empty. I am using hibernate templates. what could be the problem and what i am m...

Is it possible to alias bean class names in Spring?

I have a string property which looks similar to the following example: <property name="mappingData"> <list> <bean class="com.company.product.longNamingStandard.migration.extractor.FieldMapping"> <property name="elementName" value="entitlement.user"/> <property name="mapping" value="DocUsers"/> </bea...

Binding Properties of Primitive Wrapper Types with Spring MVC

Hello folks, It appears to me that Spring MVC cannot bind properties of primitive wrapper types(e.g. Integer, Boolean, etc). When it tries to bind such properties, it throws the following exception. javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: org.springframework.beans.NotReadablePrope...

Displaytag JSP error - "Can not find tag library descriptor"

I am integrating the displaytag library into my Spring MVC Application. I am using Ant for builds in my project. I have followed the installation directions from the website, which you can find here Installation Instructions for Displaytag It states that the dependencies for displaytag use are the following commons-logging commons-...

how to read System environment variable in Spring applicationContext

How to read the system environment variable in the application context? I want something like : <util:properties id="dbProperties" location="classpath:config_DEV/db.properties" /> or <util:properties id="dbProperties" location="classpath:config_QA/db.properties" /> depending on the environement. Can I have somethi...

POJO to MultiValueMap mapping/binding/conversion in spring 3

I have a POJO I need to format as a MultiValueMap. This MultiValueMap will be used as the request in a POST method using the restTemplate class and will be passed along to my web service as contentType application/x-www-form-urlencoded. Are there any tools or utilities that will do the POJO -> MultiValueMap conversion for me? sample...

How do you serialize a Spring Bean (spring 3)

I understand this is supposed to happen automatically, but it's doing anything but in my experience. Does anyone know how to serialize a Bean which has indirect/direct references to other non-serializable Beans/classes? ...

Storing objects in session within MultiActionController page

hi How to store/cache a List within a Controller in Spring 3.0 Thanks Gauls ...

Mapping problem with Spring

Hi, I'm working with Spring MVC. I have a controller which returns a new ModelAndView(new RedirectView(getSuccessView())). SuccessView is set as home.htm which is a virtual page that maps to WEB-INF/jsp/home.jsp. However I'm getting this error: No mapping found for HTTP request with URI [/Bikes_Spring/WEB-INF/jsp/home.htm] in Dis...

How can I make Spring testcontext framework use multiple data sources?

I'm trying to integration test my application with Spring TestContext framework. I have done this by extending AbstractTransactionalJUnit4SpringContextTests, as usual. However, my application has three different data sources (with names like xDataSource, yDataSource, zdataSource), så when I try to run the test, the autowiring of data sou...

portal:actionURL Spring MVC Portlet

I am trying to create a actionUrl using the following code <portlet:actionURL var="actionUrl"><portlet:param name='action' value='viewModules' /></portlet:actionURL> and map that onto a spring controller However the controller does not respond as the generated url's ampersands are encoded e.g. <snip>&amp;p_p_lifecycle=1&amp;p_p...

Fastest way to process JMS messages from Spring-JMS

I have a JMS queue with a gazillion messages to be processed. I'm going to have a good few listeners that I'm implementing using spring-jms to read from this queue. I'm getting a bit lost on the different ListenerContainers and their possible configurations. My requirements are: Obviously asynchronous processing. No need for transacti...