spring-mvc

Spring MVC CRUD Application using annotation

I wanted to learn how to use annotation in Spring MVC using annotation. But apparently the Spring MC Step By Step that is bundled with Spring 2.5 download release uses concrete Controller hierarchy. Hopefully somebody could give me a good link where I could learn annotation driven spring mc application. ...

How to create reusable components in Spring MVC 3.0

Ok I really don't know where to start. I have been trying to develop reusable component-like pages in Spring MVC. I ended up using tiles. I had the idea from "Spring in action" book on writing ComponentControllerSupport class. But the problem starts with tile2 and spring 3.0. All old features of tile1 is deprecated and tile2 has changed ...

Auto Select Option Tag in Spring MVC

Hi, Does anybody have an idea on how to auto select option tag? I checked at the spring form tag library but cant see any property related to an option value being selected by default when the JSP is rendered. I basically have this <p> <label for="plantLabel" class="label">Plant:</label> <form:select path="strPlant" > ...

How do I create a Secure submit form in Spring 3.0.3?

Hi everyone, I am new to Spring (formerly a Struts guru) and I've decide to change all my code to Spring for the reason being that Spring is more Service-Oriented (and the possibility that I might also include a RESTful application form the same project is a possible option). As for now, in Struts, there was an SSL plugin to create a ...

Spring-MVC Annotation Problem

Hi All, I have an existing Spring MVC apps written in 2.5. I wanted to use the new annotation controller. I somewhat see that it is really flexible and would answer my other needs. My problem is, it seems I cannot mixed them both. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSch...

Custom authentication in Spring

Hi everyone, I have a question. In Struts, I have an Action that deals with user authentication, i.e., I took the user's credentials and used a DAO to validate user credentials. I want to maintain the same setup in Spring. I'm using Spring 3.0.3 RELEASE. My question is, I've read Spring Security and in there it specifies JDBC backend "...

form:options tag cause error : Bean property is not readable or has an invalid getter method

I want to use the form:options provided by Spring to provide choices. My JSP implemented with Spring 2.5 is <td><form:select path="billingType"> <form:options items="${addAccountCommand.billingTypeChoice}" itemValue="billingType" itemLabel="billingTypeName" /> </form:select> </td> My AccountCommand.java i...

How to prevent Spring Security 2.5 from overriding the loading of a Welcome Page (index.html)

Hello - I have a Spring MVC Web app that I'd like to show a simple Welcome Page (index.html). On that page, I just to have a 2 href links: one to bring me to the Login Page that is then implemented using Spring Security (2.5.6) and Hibernate 3 and the other to a Registration Page for new users. However, the problem is that Spring Secu...

How to return multiple @ModelAttribute in spring annotated controllers?

Hi, I am in the middle of converting my controllers to annotated style controllers in spring mvc. Basically I do this in the old style controller simpleformcontroller. protected Map referenceData(HttpServletRequest request) throws Exception { Map referenceData = new HashMap(); List<ItemVo> lstItem1 = eqrManager .searc...

Spring MVC: RESTful URLs + Freemarker + Tiles + Spring macros - can these work together?

Hi guys, I want to use RESTful URLs in Spring MVC 3.0.3, e.g. the following in my web.xml: <servlet> <servlet-name>addictedWebServices</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>addictedW...

Using Hibernate with Spring 3

My current web development tool is Spring 3, I've used Hibernate before, I'm actually quite familiar with it after I have access to the annotations and entities, and the session object. However, this will be my first time needing to actually set it up from scratch. Currently I have a datasource that I have used for JDBCTemplate, and I ...

Spring MVC Annotation relative path problem

Hi, I am trying to convert my app written in spring mvc 2.5 to use the annotated style of controller. Apparently, I am unable to get things going. Hope somebody could help me here. I have a mapping as below: <li><a href="eqr/eqrItemList.htm"><span>Equipment Qual Report</span></a></li> I created my controller like below: @Controll...

Spring MVC + FreeMarker: How to render option tag?

Hi there, The Spring 3 MVC docs state that option tags can be rendered like this: <tr> <td>Country:</td> <td> <form:select path="country"> <form:options items="${countryList}" itemValue="code" itemLabel="name"/> </form:select> </td> </tr> I am using FreeMarker with Spring MVC, so I ...

Do I need (Spring) MVC if I have Javascript/CXF?

I am developing a Java web services application that is (mostly) to be used by other SOA clients. Currently I am planning on using CXF to publish my various web services & methods using SOAP/XML. I am now being asked to investigate a thin client web-application for this tool. I have been looking into Javascript libraries such as ExtJS ...

Locales as part of the URL in Spring MVC

Hello! I'm now looking for a framework for multilingual web-applications. At the moment it seems to me that the best choice is Spring MVC. But I faced the fact that all the guidelines for developers suggests to switch languages using LocaleChangeInterceptor in such way: http://www.somesite.com/action/?locale=en Unfortunately, there ar...

Spring MVC doesnt work

hi I can t deploy my programm but when I click on submit form nothing happen,my controller is(Create ticket controller) <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="index.htm">indexController</prop> <prop k...

Passing errors back to the view from the service layer

Edit: I have looked into Spring 3's @ExceptionHandler annotation and combining this with Option 1 below looks to be a pretty clean solution. See http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-exceptionhandlers I also found this to be a good read: http://blog.decaresystems.ie/index.php/2006...

Spring 3 MVC: How to store € symbol from form?

Hi there, I am using Spring 3 MVC and MySQL 5 as my DB. I have created a form using Spring form tags for updating an object in my database. I enter "Ticket price: €35" into one of this form's text input fields and save the item. Then when I view the item in a display page, the text appears as "Ticket price: ?35". If I enter "Ticket ...

Spring 3 - Create ExceptionHandler for NoSuchRequestHandlingMethodException

Using Spring 3, I like to create an exception handler using the ExceptionHandler annotation that will handle "no page found (404)" requests. I am using the following code to do this. But when I point to a URL that does not exist, the default exception handler defined by Spring is being invoked. It might be that I'm handling the NoSu...

Spring 3 MVC + MySQL: cannot store € character

Hi there, I have Spring 3 MVC set up with Hibernate and MySQL 5. In a web form, I enter a single character into a field, € (i.e. just the one character). When I then attempt to save the data, I get the following exception: java.sql.BatchUpdateException: Data truncation: Data truncated for column 'name' at row 1 'name' is a String on m...