Tagged Questions
0
votes
1answer
8 views
Spring MVC form:radiobuttons tag not setting value attribute
Here is relevant code from my controller:
@ModelAttribute("store_location_types")
public StoreLocationType[] getStoreLocationTypes() {
return StoreLocationType.values();
}
Here is the ...
0
votes
1answer
17 views
Prefix “redirect:” not able to resolve the view
I was following the application example in the book - Spring Recipes, Section 8-10. And I am stuck in an issue.
I'll try to keep it short.
I've Reservation bean containing following fields:
String ...
0
votes
0answers
8 views
SpringDataRest and show welcome-file-list/disable link discovery
I am using spring-data-rest(1.0.0.RELEASE) in my spring-mvc application
But I am getting following problem
In my WebConfig
@Import(RepositoryRestMvcConfiguration.class)
public static class ...
0
votes
0answers
21 views
Spring triple load controller on server start
I am using Tomcat 7 with Spring MVC 3.2.x RELEASE. The spring template code is generated by Intellij, I just added an syserr message output.
When I start the server the default controller is called ...
4
votes
1answer
31 views
Spring @RequestBody containing a list of different types (but same interface)
Let's say that I have a domain class :
public class Zoo{
private List<Animal> animals;
....
where an Animal is an interface with different implementations (Cat,Dog). Let's ...
0
votes
0answers
16 views
Constat redirecting to login site
Let assume that I have /admin and /login site. User want go to the /admin secured site (require login). Spring security ask user about creditials, after login user is redirected to default-target-url. ...
-1
votes
4answers
34 views
how to connect form values in jsp to controller in spring MVC
I am new to spring MVC. i want to attach a model bean to a form which binds values and pass it to controller. so i did the following way
in jsp
<form:form modelattribute="model">
...
0
votes
0answers
40 views
Spring MVC - request syntactically incorrect
I'm trying to talk to this request handler (sorry about the bad language, I'm brand new to spring, I think that's what it's called). I've looked around and seen recommendations to set the logging ...
0
votes
0answers
8 views
css file is not working in Spring Theme module. properties files are loaded properly but css are not working
I configured my confugration file ie. dispatcher-servlet.xml file for Themes using following beans
<bean id="themeSource" ...
0
votes
1answer
13 views
Controlling security on model updates in RESTful Spring MVC / HATEOS
Consider the following object:
class User {
Long userId
String emailAddress;
boolean isLocked;
}
If I implement an endpoint for the User resource, as follows:
@Controller
public class ...
1
vote
5answers
48 views
Setting Default Values in HashMap [duplicate]
I am trying to find a way to make a HashMap return a default value. For example if you look at the following this will printout "Test:=null" what if I want to request a default value so anytime I try ...
1
vote
0answers
33 views
REST interface implementation for exposing Neo4j nodes
I'm representing my nodes as domain entities. I'd like to expose my nodes via a REST interface using GET to query by id, POST to save a node with its related nodes and PUT to update a node and its ...
0
votes
2answers
36 views
Write a base Test Class with Junit4 in spring mvc
Im going to write test classes with spring mvc.I think writing base test class is good thing to do first.I have already written some service classes in service layer anyone can help me to write base ...
0
votes
1answer
24 views
Spring PagedListHolder get all records
I'm trying to create different options for a list view in a spring mvc3 controller where the user will be able to view list paginated in different records, e.g. 10, 25, 50 or all records. For this I'm ...
1
vote
2answers
56 views
How to inject property to interceptor in Spring MVC
I changed my spring mvc application configuration from xml to code.
since the change, all the injected properties in my interceptors are null (authenticationService).
the code looks like this:
...
1
vote
2answers
48 views
Spring MVC - @Valid on list of beans in REST service
In a Spring MVC REST service (json), I have a controller method like this one :
@RequestMapping(method = RequestMethod.POST, value = { "/doesntmatter" })
@ResponseBody
public List<...> ...
1
vote
2answers
92 views
How to configure a Spring REST Service to handle multiple versions?
Almost all APIs are dealing with different release versions. Often you see this kind of versioning:
http://api.com/v1/questions
http://api.com/v2/questions
..
But I haven't found a source ...
1
vote
1answer
22 views
Returning list using @Responsebody or return ModelAndView from spring controller which one better
First of all my language is not good and sorry for that and i am working with small organization and i am not getting coding standards or suggestions in the office .so let me know to which process ...
2
votes
1answer
35 views
Using Spring MVC, accepting POST requests with bad JSON leads to a default 400 error code server page being returned
I am working on a REST api. Receiving a POST message with bad JSON (e.g. { sdfasdfasdf } ) causes Spring to return the default server page for a 400 Bad Request Error. I do not want to return a ...
1
vote
1answer
41 views
Why Byte [] gets converted to String in JSON view
I am generating a JSON view using spring MVC and one of the attribute in the java object is byte array
public class Profile {
private String profId;
private byte[] image;
....
}
I am setting up ...
0
votes
0answers
17 views
Returning HMTL using Spring MVC's content negotiation mechanisms
I need to return text/html in my application using Spring's content negotiation functionality. I have based my solution on this approach.
...
-1
votes
2answers
45 views
Value '0000-00-00' can not be represented as java.sql.Date
I would like to share my problem with to help me.
I'm working on some project wich needs to extract data from DB And I use Spring MVC to build model from DB for selecting data after my model will ...
1
vote
1answer
23 views
How can I configure Spring 3 MVC to handle Errors similar to Exceptions?
There are countless articles explaining basic exception handling using Spring 3 MVC which I have successfully implemented. So now when one of my Controllers throws an Exception class it gets caught ...
0
votes
0answers
30 views
spring context reloading issue
I have a simple console based application written in spring 3. I've provide an api for this application so that it can be used in the other applications. I've another web application which is also ...
0
votes
2answers
27 views
Spring form with nested objects throws target object binding error
I am trying to use a Spring form with my controller and the entity it is mapping to has nested objects. When try to hit the page with the form it throws the below error.
Am I not initializing the ...
3
votes
0answers
41 views
Have different names in class field and bound form input with Spring forms?
Does anyone know if it is possible, using automatic Spring databinding with tags, to have the form name be different from the class/object field it is bound to?
I am working on a system where, by ...
0
votes
0answers
41 views
Why is Spring MVC auto retrying POST requests?
I'm getting some strange behavior with my web application and I can't seem to figure out what's going on.
The problem is that whenever the controller takes more than a certain time to respond, for ...
0
votes
1answer
46 views
favicon.ico not displaying in spring mvc 3.2.2 per Tomcat 7.0?
I'm new to spring mvc and my favicon.ico is not showing up in browser tab using spring 3.2.2 using tomcat 7.0. I have tried looking at related googling but still cannot get it to show up in the ...
1
vote
0answers
32 views
Spring Security + Spring MVC interceptor - mapping to the same pattern conflict?
I'm facing the following problem (although I'm not quite sure if it is a problem or not...):
I have implemented a 3-step user registration wizard using Spring MVC.
Upon 3rd step success, new ...
2
votes
1answer
66 views
Multiple File Upload using @Context HttpServletRequest with @FormDataParam in jersey
I have created a jersey restful web service where I managed to upload multiple number of files using @Context HttpServletRequest request as method signature which work nicely.
Thing is, to fetch other ...
0
votes
1answer
36 views
consuming a Spring mvc web service with jquery
I have a spring mvc Web service like this:
@Controller
@RequestMapping("/hello")
public class helloWs {
@RequestMapping(value= "/getObj", method = RequestMethod.GET)
public
@ResponseBody
...
0
votes
2answers
46 views
Put in javascript Variable in SQL prepeared statement (java)
how can I put the selectItem variable:
var e = document.getElementById("categoryName");
var selectItem = e.options[e.selectedIndex].text;
In:
var theData = [ // Start of ...
0
votes
0answers
25 views
Spring MVC define content type for XHTML
I have a Spring MVC application with jsp-pages and I ran into an issue with displaying of my XHTML page in IE8. Chrome and Firefox works fine, but IE just opens a plain xml file.
I guess the ...
0
votes
0answers
17 views
spring mvc 3 and google datatable
I am new to google.visualization.datasource and I was wondering if there is a simple example for creating the datatable with a helper class and return it back to the client but, without using query ...
0
votes
0answers
50 views
I am getting 404 error suddenly, I am using tomcat 7 +Eclipse juno
My browser is saying below status
HTTP Status 404 -
type Status report
message
description The requested resource is not available. Apache
Tomcat/7.0.33
My application was ...
0
votes
1answer
28 views
What is the best way to send a simple error response message from the server to calling jQuery ajax method (e.g., responseText)?
what I'm trying to do...
I want to send a response message back to the calling jQuery AJAX method, that I can then use to create a warning popup message.
I tried using the HttpServletResponse ...
0
votes
1answer
41 views
Spring bean getting confused
I have a spring web app A and a library B. B has its one config file. When using the B library in App i am creating new beans instead of autowiring. but still seeing that the beans initialized in ...
0
votes
1answer
27 views
Authorizing methods in Spring MVC Controller
My aim is to protect some methods in my Spring 2.5 MVC Controller only to be accessed by specific users for e.g for Managers can access all the methods but Viewers can access a few of them. Though I ...
0
votes
1answer
27 views
Read json web service spring mvc
I have a spring mvc Web service like this:
@Controller
@RequestMapping("/hello")
public class helloWs {
@RequestMapping(value= "/getObj", method = RequestMethod.GET)
public
@ResponseBody
User ...
0
votes
1answer
49 views
Java EE server for raspberry pi (Spring-MVC) [closed]
I'm searching a server for Raspberry Pi that supports Java EE Spring Framework.
Does anybody have an experience with some RPi servers?
2
votes
1answer
30 views
Httpsession management in springMVC
i am new to springMVC and started to do my sample application by doing what i learn. i am planning to implement Session management in spring MVC. I found this one helpful.
But i am not able to get it ...
0
votes
1answer
27 views
Integration Testing POSTing an entire object to Spring MVC controller
Is there a way to pass an entire form object on mock request when integration testing a spring mvc web app? All I can find is to pass each field separately as a param like this:
...
4
votes
3answers
87 views
In Spring, how will we make sure the atomicity of operations
In Spring how can we make sure that certain operations are always executed together. If any one of them fails, the entire transaction needs to be rolled back. I searched this a lot and found ...
0
votes
1answer
31 views
JSON Error in retrieving data
Here is Client side code:
function startAjax() {
$.ajax({
type : 'GET',
url : 'customers/ShowAllCustomers',//this is url mapping for controller
dataType: 'json',
...
0
votes
2answers
39 views
Can't @Autowire a bean into a controller - NoSuchBeanDefinitionException
I have a spring-mvc web app.
The following code has been simplified and sanitised to protect the guilty. The basic idea is that I have two separate context configuration files: one for MVC, the ...
0
votes
1answer
26 views
Spring MVC 3 ModelView is always Null after submit
I'm new on Spring MVC and I have an issue, I account on you for this problem and thank in advanced.
I have a Controller and first I call this mehod:
@RequestMapping(value = "/{prestadoraId}", method ...
0
votes
1answer
64 views
404 error in spring mvc with default template
I'm new to SpringSource,
and I created a Spring MVC Project from template,
and I did nothing but Run on Server home.jsp file
But I got 404 error
I didn't know what to do
because there is no error in ...
1
vote
1answer
52 views
Wildcards in requestmapping
I am working on my Spring application and as per below code, I am mapping multiple URL's to one method. I am making one method "root" to serve all the request which starts with index and root.
...
1
vote
2answers
39 views
Static content - Spring MVC
I know similar questions have been asked before but I still can't get this to work.
I'm having a spring MVC web-site with file tree that looks like this:
webapp\
resources\
style.css
...
1
vote
1answer
47 views
Link CSS and Images to Spring MVC maven Projcet
I have a Spring project created using maven. The following is my directory structure.
I want to add css images to this project. For this, i created a resources folder inside the web-inf directory ...