spring

How to write a Controller variable value back to the HTML page that sent the Ajax request without a page refresh?

The following JavaScript new Ajax.Request('/orders/check_first_last/A15Z2W2', {asynchronous:true, evalScripts:true, parameters:{first:$('input_initial').value, last:$('input_final').value, order_quantity:$('input_quantity').value}}); triggers an Ajax call to the checkFirstLast method in the OrderController: @Controller @RequestMa...

If a Controller has a @Controller annotation, shouldn't that be enough for Spring without component scanning?

According to the Spring docs, to enable autodetection of annotated controllers, you add component scanning to your configuration: <context:component-scan base-package="org.springframework.samples.petclinic.web"/> My question is, why is this necessary? If a Controller has an annotation to already indicate what it is, shouldn't that be...

What class of object would a serialized ajax form be translated to in an action aparameter of a Spring controller?

If a HTML form contains multiple input fields: <form> <input id="in1" type="text" value="one"> <input id="in2" type="text" value="two"> <input id="in3" type="text" value="three"> </form> and is passed to a Spring controller as a serialized form like this: new Ajax.Request('/doajax', {asynchronous:true, evalScripts:true, parame...

spring mvc annotation validation

I have a form that looks like this public class ValidationForm { private Person person; @Size(min=1,max=10,message="out of range") private String test; //other stuff My validation controller is like this public void processForm(@Valid @ModelAttribute("validateForm") ValidationForm vform, BindingResult result){ My Person ...

Using some beans in Filter bean class ?

Hi all, In my filter bean class, I added some beans dependancy (with @Autowired annotation). But in the method doFilter(), all my dependancy beans have null ... public class FacebookOAuth implements Filter { @Autowired private BusinessLogger logger; @Autowired private IUserSessionInfo userSessionInfo; @Autowired private FacebookOAuth...

Spring autowiring message source vs implementing MessageSourceAware interface?

Which option is better ? I have an interceptor PermissionInterceptor which needs access to message source. As far as I know it can be done by autowiring message source or implementing MessageSourceAware interface as follows. public class PermissionInterceptor extends HandlerInterceptorAdapter { private MessageSource messageSource; ...

With a form class in Spring 3, how do you map a HTML form field called "order_id" to a Java field "orderId"?

Let's say you have a HTML form: <form> <input name = "in1" id="in1" type="text" value="one"> <input name = "in2" id="in2" type="text" value="two"> <input name = "in3" id="in3" type="text" value="three"> </form> With @RequestParam you can bind fields as separate parameters: public String doAjax(@RequestParam("in1") String in1, ...

Spring Security, Spring MVC and Login Sessions

I have my Spring MVC & Spring Security up and running as suggested by Spring's own reference application "petclinic". Everything's fine except that the login does not persist a browser restart. What has to be considered to make sure a logged in user does not need to relogin after browser restart? ...

In spring MVC, where to start and end counter to test for speed execution time?

I want to know how long it takes a particular page to render, where are the various parts in the Spring MVC framework that I can start and stop my timer? BTW, what java class should I use to get the most accurate time in milliseconds? ...

Is HibernateCallback best for executing SQL/procedures?

I'm working on a web based application that belongs to an automobil manufacturer, developed in Spring-Hibernate with MS SQL Server 2005 database. There are three kind of use cases: 1) Through this application, end users can request for creating a Car, Bus, Truck etc through web based interfaces. When a user logs in, a HTML form gets d...

Calling a Spring service class from another

I have two spring bean Service classes in my project. Is it possible to call on from another? if yes, how it can be done? ...

jbpm questions before project start

I need to evaluate the jbpm workflow engine at this time, after read the documentation I got following questions, if someone can point me any hints will be greatly appreciated(sample code for these questions is preferable)! I know jbpm can generate the UI for task with the help of eclipse plugin, is it easy to modify the generated UI...

Problem starting Spring application from Java

I am able to compile and start my Spring project using Maven: mvn -e clean compile exec:java -Dexec.mainClass=de.fraunhofer.fkie.tet.vmware.manager.Test However, when i assemble all jars in a single file using the maven-assembly-plugin (including applicationContext.xml), i always get an Exception during the java call: java -cp tar...

ClassCastException with Weblogic 10.3.3/Pitchfork

Hi. We're trying to deploy a spring application to Weblogic 10.3.3. We created a war file, which works nicely with tomcat, but, when trying to package it up as an ear to use with weblogic, we're getting an issue with Pitchfork: java.lang.ClassCastException: org.springframework.jee.spi.PitchforkUtilsImpl cannot be cast to com.oracle....

Problem deploying Spring application on WebLogic

We're trying to to run an application using Spring on Weblogic 10.3.3. This, apparently, should be straightforward, and just involves ensuring various additional jars (notably pitchfork) are in the library directory for weblogic, and getting the config right. Unfortunately, when we try to deploy, we keep experiencing the error: java.lan...

Autowired bean are not handled in my Controller bean (Spring-MVC)

Hi all, I create a Controller bean to map a dedicated URI. web.xml file : <!-- Spring MVC Servlet (that will route HTTP requests to BlazeDS) --> <servlet> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>co...

Not able to read the property file

Hi, I am working on one web application in which i want to retrieve values from property files which are present outside of the application i.e on system drive. but while doing this i am facing the problem.Interestingly if i put property files at class path location then application works properly. I am using resin server 3.0.23 and s...

difference between applicationContext and spring-servlet.xml in spring

In spring framework are applicationContext.xml and spring-servlet.xml related anyhow ? will the properties files declared in applicationContext be available to DispatcherServlet . On a related note why do I need a *-servlet.xml at all ? why isn't applicationContext.xml alone sufficient ? ...

Input Validating in Spring MVC

I know the Commons Validator framework is the de facto standard for Struts projects to validate input values both on the server side and the client side. Is the same true for Spring MVC projects? The reason I get the impression that it may not is that most Struts books and forums talk a lot about the Commons Validator framework, but on...

Prevent ehcache trying to access internet on startup

I have a fairly simple non-clustered application running ehcache with spring and hibernate. On startup I'm getting this error: <06-Sep-2010 19:14:05 o'clock BST> <Error> <Net> <Failed to communicate with proxy: 10.x.x.x/8080. Will try connection www.terracotta.org/80 now. java.net.SocketTimeoutException: connect timed out How do ...