spring-mvc

Spring Bind Exception

i got exception in my controller class using bindexception.using reject method how i can print the message in my jsp. ...

Testing Spring MVC Output

Hello, So I have an MVC project that exposes my services in JSON format. What would be the ideal method of (unit?) testing whether or not my methods return correct content (in terms of JSON syntax as well)? Thank you, Sammy ...

Resolving views in Spring MVC with Freemarker - including jsp page

When using the FreemarkerServlet, it is possible to include JSP pages alongside Freemarker content. However, I'm using Freemarker as a view resolver in my Spring MVC application and so don't use the FreemarkerServlet. Is there any way I can still use @include_page in my Freemarker templates when I'm not using the FreemarkerServlet? Than...

Spring 3 Annotations

I can't get spring annotations to work at all, I'm just trying to get the simplest thing to work... .../mycontext/something -> invokes method: @RequestMapping(value = "/something") @ResponseBody public String helloWorld() { System.out.println("hello world"); return "Hello World"; } My main problem is no matter how hard I try,...

Redirect on Ajax Jquery Call

Hi, I am newbie to ajax here and I know somebody would have encountered this problem already. I have a legacy app built on Spring MVC, it has a interceptor(filter) that redirects the user to the login page whenever there is no session. public class SessionCheckerInterceptor extends HandlerInterceptorAdapter { public boolean preHandle(...

Best practice to manage the path breadcrumbs in Spring without Web flow

I am engaged in a project where I need to show path bread crumbs to the user like Home (This is linked to home page) >> (page name) and like Home >> contacts and in contacts like Contacts >> create Contacts >> edit etc. Is there a best practice how to do this in spring without he usage of spring web flow? I am not us...

Spring MVC handle button event in list

Hi, i created a list of Users <div class="usersList"> <c:forEach items="${users}" var="user"> <div class="listElementAction"> <c:out value="${user.id}"/> </div> <div class="listElement"> <c:out value="${user.firstName}"/> </div> ...

Get command object

I am writing a spring 2.5 application and in my jsp I'm writing my own tags. It's about a list of objects...when I change the number of rows that list shows(a combobox), I am doing a submit on my form returning back to the view(obviosly with the new number of rows returned). When listing with my own tags I need to get the properties fr...

Why my onsubmitg is not firing - Spring

Hi, i have a controller public class EditUserController extends BaseController { public EditUserController() { setCommandClass(User.class); setCommandName("editaUser"); } public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException...

How to populate a drop down list in Spring MVC

Hi, would like to populate a drop down list on a jsp page i have my page that looks like <form:form method="POST" action="addRss.htm" commandName="addNewRss" cssClass="addUserForm"> <div class="floatL"> <div class="padding5"> <div class="fieldContainer"> ...

Using jQuery, how do I way attach a string array as a http parameter to a http request?

I have a spring controller with a request mapping as follows @RequestMapping("/downloadSelected") public void downloadSelected(@RequestParam String[] ids) { // retrieve the file and write it to the http response outputstream } I have an html table of objects which for every row has a checkbox with the id of the object as the valu...

how to bind a table of items to a List attribute in spring

I have an object with a List type attribute called parts and a few plain ones. I want to display this list and allow the user to add and remove entries from this list. The problem is when the form gets submitted only the plain attributes get bound. The list attribute remains null. To illustrate what I'm looking for, in JSF they have a "d...

Encoding problem using Spring MVC

Hi all, I have a demo web application that creates users. When I try to insert data in other languages (like french) the characters are not encoded correctly. The code on the controller is: @SuppressWarnings("unchecked") @RequestMapping(value = "/user/create.htm", params={"id"}, method = RequestMethod.GET) public String edit(@...

Input not firing in jsp page

Hi, i have been using the spring mvc frameworks lately for a university project. Could you tell me why this work <FORM METHOD=POST ACTION="SaveName.jsp"> <input type="image" class="floatR marginTMinus10" src="images/delete.png" name="image" value="${rssItem.id}" alt="Delete"/> </FORM> while this not...

Stuck at Spring MVC tutorial for newbies

Hi, I am stuck on this Spring MVC tutorial for newbies: http://sites.google.com/site/springmvcnetbeans/step-by-step/ I am the point 1.12 "Try out application". When I put in my address bar hello.htm it doesn't work, but hello.jsp works. But I guess point was somehow to hide this JSP extension. I followed tutorial precisely. What might ...

Bind multiple request parameters to one object in Spring 3

Hi, I can't figure out a way to bind several arguments and headers to one request parameter using annotations in Spring 3. For example, let's say I'm getting this request: Headers: Content-type: text/plain; POST Body: Name: Max Now I want it all to mysteriously bind to this object: class NameInfo { String name; } Using some ...

Spring SimpleMappingExceptionResolver not going to default view

I am playing with the SimpleMappingExceptionResolver to see how it works and to see if it will be of use to us for a client but I am having problems understanding it. What I have tried is visiting a particular page in my application and having it throw an exception in the handleRequestInternal method. When I throw a RecoverableDataAcce...

Create a file and store in Java web application folder

I would like to create an xml file and store in a folder within my spring Mvc web application. I can get the root of my application with request.getContextPath() but how do i get the application's relative path so it will work on any machine indipendently by the location of the application's folder? Like C:/folder/folder/MYAPPLICATI...

Spring datagrid with checkboxes

I have a web-application in spring where tasks should be assigned to workers (say programmers). the application should be able to list tasks (unassigned tasks) in a grid On another side, the application should list workers (say programmers) the manager should be able to choose select tasks (or checking), and choose workers to whom he...

How to add context parameter after loading spring context

I want to add a servlet context parameter/attribute through spring configuration. I need this because the value I want to add in servlet context is available only after spring container loads. I'm adding the value inside the servlet context as I need the value in almost all my .jsp files. Essentially I need a mechanism opposite to this...