my handler forwards to internalresourceview 'apiForm' ? but then i get error
404 RequestURI=/WEB-INF/pages/apiForm.jsp . i'm sure apiForm.jsp located in /WEB-INF/pages/
13:45:02,034 DEBUG
[org.springframework.web.servlet.view.JstlView]
- Forwarding to resource [/WEB-INF/pages/apiForm.jsp] in
InternalResourceView 'apiForm'
...
Hi,
I use the following custom editor in MANY Spring-MVC controllers according to:
A controller
binder.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, NumberFormat.getNumberInstance(new Locale("pt", "BR"), true));
Other controller
binder.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(B...
Hello,
I'm developping a web-app and i'm using Spring framework. Thing is, i never properly learned to use Spring and i'm kind of lost in all this.
However, using Annotations-based controllers, i was able to create most of my app!
Now, the problem is that i would need to be able ton intercept requests before they're sent to the contro...
in my dao, in each method, when i call jdbctemplate, i should call with new jdbctemplate(). right? or get one static instant of jdbctemplate and reuse ? how about jpatemplate?
...
hello dudes. is this possible? i am basically making a Spring CRUD web app using MultiActionController class and would want my forms validated. i have used a SimpleUrlController before and valang works perfectly.
...
Hi,
I am new to Spring MVC. But I had certain experience in working with Struts 1.x. I would like to know if it is a common practice to customize DispatcherServlet while working with Spring MVC, like people sometimes customize ActionServlet or RequestProcessor in Struts 1.x?
Or let's extend the question a little bit. Where are the entr...
I am transitioning code that used implementations of Spring MVC's Controller to use the annotation stereotype @Controller. Everything is going fine except for one issue:
Given a request/response, how do I programmatically handle requests for annotation-based controllers?
Previously, (regardless of implementation) I was able to call:
...
Hi guys,
I'm quite new to Spring, and I would like to understand a bit more about sessions. I've mapped a legacy database with Hibernate annotated entities and built a couple of service objects to fetch, retrieve etc. My entities also contain other entities (mapped through foreign keys) and sets of entities. When I traverse the entitiy ...
Hi,
I'm new to spring controllers using annotated controllers.
Here is my configuration
Bean definition
<bean
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
Controller
package learn.web.controller.annotation;
import javax.servlet.http.HttpServletRequest;
import learn.web.controller.Bas...
In an annotation-based Spring MVC controller, what is the preferred way to set cache headers for a specific path?
...
I work with a front-end developer who writes JSP files. We have a form that is working correctly, except validation/binding/processing errors can't seem to be displayed with Spring's <form:errors/> tag.
I've confirmed that the error is being set, and what is apparently the correct path for the errors. Supposedly <form:errors path="*" /...
This is an example of using ThrowawayController in Spring MVC:
public class DisplayCourseController
implements ThrowawayController {
private Integer id;
public void setId(Integer id) { this.id = id; }
public ModelAndView execute() throws Exception {
Course course = courseService.getCourse(id);
...
What's the best way of storing session related data of a user (like, for example a log of recent actions a user has done) in a Spring MVC (2.5) web application ?
Using the classic javax.servlet.http.HttpSession or by specifying scope="session" in controller beans, and storing the data in a session object ?
...
I have a controller class as in the following code segment:
@Controller
public class SiteEntryController
{
@RequestMapping(value="/index.htm")
public ModelAndView handleIndex(
@RequestParam(value="enableStats", required=false) String enableStats)
{
ModelMap map = new ModelMap();
...........
return ne...
Hi,
In my Grails app, I need to bind a request parameter to a Date field of a command object. In order to perform the String-to-Date conversion, one needs to register an appropriate PropertyEditor in grails-app\conf\spring\resources.groovy
I've added the following bean definiton:
import org.springframework.beans.propertyeditors.Custom...
Under what exact circumstances do @SessionAttributes get cleared? I've discovered some confusing behaviour when trying to use two models in a page.
When I do a GET followed by a POST using this controller...
@Controller
@RequestMapping("/myPage*")
@SessionAttributes(value = {"object1", "object2"})
public class MyController {
@Reque...
I want to display custom error message in jsp for spring security authentication exceptions.
For wrong username or password,
spring displays : Bad credentials
what I need : Username/Password entered is incorrect.
For user is disabled,
spring displays : User is disabled
what I need : Your account is diabled, please contact ad...
I am trying to use a MultiActionController in spring mvc, but I keep getting a 404 with the following message in the log
(org.springframework.web.servlet.PageNotFound)
No mapping found for HTTP request with
URI [/www.mysite.no/a/b/c] in
DispatcherServlet with name 'myServlet'
It looks like I'm following the book example, but ...
Is there some trick to getting a SpringMVC custom view to cause a file download in the broswer? I've implemented the render method from org.springframework.web.servlet.View but the code results in my data being written to the page as a blob of data rather having a download action start.
try {
Document oDoc = (Document) model.get("o...
Hi,
Suppose the following class
public class Message {
// some code
}
And a Spring Validator implementation (no Spring knowledge required)
public class MessageValidator implements Validator {
public boolean supports(Class clazz) {
if(clazz.isAssignableFrom(Message.class))
return true;
else if(<AN...