spring-mvc

How do I create a Spring 3 + Tiles 2 webapp using REST-ful URLs?

I'm having a heck of a time resolving URLs with Spring 3.0 MVC. I'm just building a HelloWorld to try out how to build a RESTful webapp in Spring, nothing theoretically complicated. All of the examples I've been able to find are based on configurations that pay attention to file extensions ("*.htm" or "*.do"), include an artificial dir...

Spring MVC - Set an actionURL parameter with Javascript

Is it possible to dynamically set a Spring MVC portlet:actionURL portlet:param using javascript? I have tried with the following code, but the id value always comes across as null to the controller. I have verified that setting the portlet:param manually passes the value correctly: <portlet:param name="id" value="2" /> I have also ve...

What to do with lookup entities selected from drop down select ? How to send them to the service layer.

I am developing a spring mvc based application. I have a simple pojo form object, the problem is that many properties will be taked from drop down lists that are populated from lookup entities, so I return the entity ID to the form object. public NewCarRequestForm { private makeId; // this are selected from a drop down. private...

Is it possible to inject a bean into a spring form bean

I tried to do it 2 different ways, but neither way worked. @Component public class EmailForm{ ... private QuestionDAO questionDAO; ... @Autowired public void setQuestionDAO(QuestionDAO questionDAO) { this.questionDAO = questionDAO; } ... Another way: @Component public class EmailForm implements ApplicationContextAware { ......

Spring MVC Portlet and Weblogic Portal

Hi everyone, I'm trying to create a Spring MVC Portlet (version 3.0.0) to deploy in Weblogic Portal (10.3.2) but am getting the following error when I go to the portal page that I have put my portlet on: The portlet "helloWorld" is not available. The portlet class org.springframework.web.portlet.DispatcherPortlet is not found. javax.po...

How to handle MaxUploadSizeExceededException

Hello, MaxUploadSizeExceededException exception appears when I upload a file whose size exceeds the maximum allowed. I want to show an error message when this exception appears (like a validation error message). How can I handle this exception to do something like this in Spring 3? Thanks. ...

Nested form data binding with Lists of Objects in Spring MVC

Hi, I have an object like so: public class FormFields extends BaseObject implements Serializable { private FieldType fieldType; //checkbox, text, radio private List<FieldValue> value; //FieldValue contains simple string/int information, id, value, label //other properties and getter/setters } I loop through a list of FormFields a...

testing SpringMVC controllers

Hi, I'm unit-testing my SpringMVC (v. 2.5) controllers using code like the following: public void testParamValidation() { MyController controller = new MyController(); MockHttpServletRequest request = new MockHttpServletRequest(); request.addParameter("foo", "bar"); request.addParameter("bar", baz"); ModelAndView ma...

Does spring mvc can trim all string obtained from forms?

I know struts2 default config will trim all string obtained from forms. For example. In form I type " whatever " in form and submit finally I will get "whatever". It's will auto trim the string. I want to know is that spring mvc have this function too? THX. ...

SpringFramework3.0: How to create interceptors that only apply to requests that map to certain controllers?

In it's simplest form, I want an interceptor that checks session data to see if a user is logged in, and if not redirects them to the login page. Obviously, I wouldn't want this interceptor to be used on say the welcome page or the login page itself. I've seen a design that uses a listing of every url to one of two interceptors, one doi...

From Java GUI to Java Web

I've been doing quite large application recently with Java - Swing. Now I'd like to move to web. Basically - I am not Microsoft guy, Java is fine with me. I've checked some basics of Java EE framework and decided that my choice will be Spring. I already am familiar with JDBC. Learning Spring is one thing, but working just with GUIs (C++ ...

Add Ajax Support to Spring MVC

Hi, I would like to add ajax to an existing spring mvc 2.5 webapps. But i dont know where to start. I think spring does not support ajax integration. Does someone know how can I accomplish this? I was thinking that my ajaxrequest should be catch by the controller interface but I dont know where to start. I dont want to use any ajax ...

Unit Test in Maven requires access to the src/main/webapp Directory

Hello all, I am trying to unit test a webapp that I am developing in Maven/Eclipse. It is a Spring MVC webapp, and I need some unit tests to test my model controller. To do this, I need to use my webapp config .xml files to inject the controller, however, all my configuration (and other associated files that the configs reference) are ...

Spring 3 JSR-286 (portlets) docs

I know that Spring 3 supports JSR-286 (portlets version '2.0'). However I can't find a lot of documentation on that. Can anyone share some links about this? Thank you. ...

What is the most up-to-date way to write Java web applications and web-based front-end ?

What is the most up-to-date way to write Java web-based applications and front-end ? What is it? JSF, JSF2 or some framework like Spring MVC or Tapestry? What are pros and cons of each framework? ...

Status messages on the Spring MVC-based site (annotation controller)

What is the best way to organize status messages ("Your data has been successfully saved/added/deleted") on the Spring MVC-based site using annotation controller? So, the issue is in the way of sending the message from POST-method in contoller. ...

PHP Programmer wanting to learn Spring

I'm a PHP programmer and I want to try creating a webapp using the Spring framework. The problem is I'm clueless and I don't know where to start. What tutorials/books/websites do you guys suggest that I should learn from? What's IoC? Do I use it alongside MVC? What components of the Spring framework should I use? How do I know what to...

Deploying Multiple Environments in Spring-MVC

Currently all web apps are deployed using seperate config files: <!-- <import bean.... production/> --> <import bean... development/> This has disadvantages, even if you only need to swap out one config file, that I'm sure everyone is familiar with (wondering what just deployed without searching through XML is one of them) I want to ...

DWR and Jquery into spring MVC 2.5

Hi, From my shallow reading, Spring MVC does not support jquery directly. It does enable integration with DWR framework. From my understanding of DWR, it is an ajax framework that allows you to call javas methods from javascript. Can I use both in my application? With Jquery handling most of the javascript code and client side inter...

@Autowire strange problem

I have a strange behaviour when autowiring I have a similar code like this one, and it works @Controller public class Class1 { @Autowired private Class2 object2; ... } @Service @Transactional public class Class2{ ... } The problem is that I need that the Class2 implements an interface so I've only changed the Class2 s...