Servlet « MVC « Spring Q&A





1. error handling with spring + servlet spec    stackoverflow.com

I have a web-app (2.5 servlet spec) with a spring dispatcherservlet handling anything coming on /error/* and an error page configured to route that to /error/ something like this:

<servlet>
    ...

2. Introducing Spring MVC    stackoverflow.com

I'd like to introduce Spring MVC to an application that has up till now used simple direct access to JSP files i.e www.example.com/login.jsp which contains the business logic and presentation details. I'd ...

3. How to best use JTidy with a Spring servlet container?    stackoverflow.com

I have a Java servlet container using the Spring Framework. Pages are generated from JSPs using Spring to wire everything up. The resulting HTML sent to the user isn't ...

4. spring mvc servlet initialization    stackoverflow.com

I am new to spring MVC. I am looking for a place in my spring mvc applicationwhere I can initialize all sorts of things in the application. usually I did that in ...

5. Help with first spring MVC page using annotations    stackoverflow.com

I'm trying to get http://localhost:8080/test to map to the index.jsp page. The jsp file is stored in the folder:

/web-inf/jsp/index.jsp
what I have so far:
@Controller
public class HomeController {


    @RequestMapping(value ...

6. How to implement pagination in Spring MVC 3    stackoverflow.com

Is there any out-of-the-box, easy to implement, standard pagination component/tag-lib or code-sample available for pagination in Spring MVC? Cheers

7. Converting jsp to servlet in spring mvc and installers for java webapplication    stackoverflow.com

I i have developed a java web application using spring mvc and used jetty server, its a intranet application where i want to distribute it to the end user in a form ...

8. Spring MVC, forward    stackoverflow.com

Is there any difference between

public class Controller1 extends AbstractController {
    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request,
          ...

9. How to stop Spring MVC blocking all other Servlets?    stackoverflow.com

I'm using Spring 2.5 MVC and wan't to add another third-party Servlet. The Problem is, that Spring MVC catches all request, so the Servlet isn't getting any request. Here a web.xml ...





10. Does spring mvc have response.write to output to the browser directly?    stackoverflow.com

I am using spring mvc with freetemplate. In asp.net, you can write straight to the browser using Response.Write("hello, world"); Can you do this in spring mvc?

11. How to use Servlet 3 @WebServlet & async with Spring MVC 3?    stackoverflow.com

I would like to integrate the servlet 3.0 async support with spring MVC. Something like:

@RequestMapping("/chat")
@WebServlet(name="myServlet", asyncSupported=true)
public String getMessage(String userName) {
      ......
}
is it possible?

12. Spring root WebApplicationContext for Servlet    stackoverflow.com

I have a webapp that uses SpringMVC DispatcherServlet to load a WebApplicationContext. The Spring reference documentation says:

"each DispatcherServlet has its own WebApplicationContext, which inherits ...

13. In spring MVC, where to start and end counter to test for speed execution time?    stackoverflow.com

I want to know how long it takes a particular page to render, where are the various parts in the Spring MVC framework that I can start and stop my timer? BTW, ...

14. Howto get rid of ?    stackoverflow.com

Up to now, <mvc:annotation-driven /> has caused plenty of trouble for me, so I would like to get rid of it. Although the spring framework docs clearly say what ...

15. What's the difference between and in servlet?    stackoverflow.com

I am migrating from Spring 2.5 to Spring 3. They have introduced <mvc:annotation-driven /> which does some black magic. This is expected to be declared in servlet configuration file only. In spring ...

16. spring mvc 3.0: put a bunch of .jsp files under spring's control    stackoverflow.com

In my spring mvc 3.0 project I have a directory full of .jsp files (~150) which I want to put under spring's control. Until now they where invoked by web.xml directly, ...





17. Custom page not found and other error webpages in Spring 3.0    stackoverflow.com

I want to display a custom 404 page not found error page (among others). I'm using Spring 3.0 and don't know how to do this.. I know I can ...

18. Where to put default-servlet-handler in Spring MVC configuration    stackoverflow.com

In my web.xml, the default servlet mapping, i.e. /, is mapped to Spring dispatcher. In my Spring dispatcher configuration, I have DefaultAnnotationHandlerMapping, ControllerClassNameHandlerMapping and AnnotationMethodHandlerAdapter which allows me to map url ...

19. How to create ZIP file for a list of "virtual files" and output to httpservletresponse    stackoverflow.com

My goal is to put multiple java.io.File objects into a zip file and print to HttpServletResponse for the user to download. The files were created by the JAXB marshaller. It's a ...

20. How to integrate the Spring Framework with Crystal report    stackoverflow.com

here is my problem I have spring framework and I want to integrate Crystal report the problem is when Report call the servlet CrystalReportViewerServlet, the spring dispacher don't find it so how ...

21. Why getservletcontext isn't found?    stackoverflow.com

I'm trying to use getServletContext().getRealPath( "/" ) , but I keep getting this error: cannot find symbol symbol : method getServletContext() location: interface javax.servlet.http.HttpSession String path = ...

22. spring mvc forward to jsp    stackoverflow.com

I currently have my web.xml configured to catch 404s and send them to my spring controller which will perform a search given the original URL request. The functionality is all there as ...

23. servlet not available error in eclipse spring mvc projects    stackoverflow.com

i am running the project using eclipse. in one project i get the following error

18/02/2011 12:23:41 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native ...

24. Equivalent of mvc:default-servlet-handler in Spring annotation-based configuration?    stackoverflow.com

Is it possible to have the equivalent of <mvc:default-servlet-handler/> defined in an AnnotationConfig(Web)ApplicationContext? Right now I have:

@Configuration
@ImportResource("classpath:/mvc-resources.xml")
class AppConfig {
  // Other configuration...
}
with just the following in my resources/mvc-resources.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans ...

25. Handling Exceptions like ServletRequestBindingException in Spring rather than Servlet Container    stackoverflow.com

I am using springmvc for a REST project and whenever the client calls a rest resource with the wrong HTTP method, a servletrequestbindingexception is thrown. I cannot handle these exceptions with ...

26. How can my Spring-Flex project use a vanilla HttpServlet via Java?    stackoverflow.com

I've got a bit of a tricky question. I'm trying to figure out the best way to leverage a vanilla HttpServlet from a Spring-Flex (with BlazeDS) project I'm working on. ...

27. Getting spring servlet application context    stackoverflow.com

I need to get the servlet application context in the business layer of an spring mvc application. I've tried implementing ApplicationContextAware interface, autowiring a WebApplicationContext field, and even implementing ServletContextAware and getting ...

28. get param value to generate a chart    stackoverflow.com

user enter two date it need to click on a button... if the date are valid, the same jsp page is called and some value are setted in the request... in this jsp, ...

29. manage form data with cookies and servlets    stackoverflow.com

I've been checking info about cookies data persistence and retrival. it seems that cookies can only manage key value pairs, i want to store data from a form (like name, description, ...

30. Spring MVC - servlet requested source not available    stackoverflow.com

I tried to make a simple web app with Spring MVC and I follow this tutorial from Netbeans:

http://netbeans.org/kb/docs/web/quickstart-webapps-spring.html
And I get the problem: The requested source not available ? My questions:
  1. What is this ...

31. Spring MVC 3 getInitParameter    stackoverflow.com

When I previously developed servlet applications without Spring, I could read configuration parameters like this in my servlet:

@Override public void init() throws ServletException { 

    ServletContext sc = ...

32. Can a Spring MVC app be multithreaded even if its servlets are not?    stackoverflow.com

When you talk about a Spring app being multithreaded, are you necessarily referring to whether the servlets that are defined in that app are multithreaded? Or can a Spring app be configured ...

33. Spring Servlet Mapping from *.html to SO type mapping    stackoverflow.com

I have a spring app with one servlet that has url-mapping of *.html. Everything is working great with my annotated controllers. My question is how can I setup my servlet and ...

34. Using Spring ResourceServlet to serve multiple resources simultaneously    stackoverflow.com

The JavaDoc for the ResourceServlet states that it can return a list of resources. But examples of this usage pattern seem to be sparse at best. We have a web.xml with the ...

35. Simple Servlet mapping    stackoverflow.com

I am trying to implement Spring onto a small app. I am getting the following:

WARNING: No mapping found for HTTP request with URI [/audiClave/] in DispatcherServlet with name 'appServlet'
Here is my web.xml ...

36. Servlet Mapping Issue    stackoverflow.com

I have a spring-based web application. In a controller I specified the following:

@RequestMapping(value = "/foo/index.html", method = RequestMethod.GET)
public ModelAndView handleIndex(HttpServletRequest request,
        HttpServletResponse response) throws ...

37. Unit testing Spring MVC web-app: Could not autowire field: private javax.servlet.ServletContext    stackoverflow.com

I would like to make tests for my web-app, but context configuration crashes on autowiring servletContext. Error below. Autowiring servletContext works good when i run web-app on tomcat/jetty.

java.lang.IllegalStateException: Failed ...

38. Spring 3.0 with default servlet 2.3    stackoverflow.com

Just out of curiosity I want to know why does the spring releases comes with servlet 2.3 api and not with servlet 2.5 spec? I downloaded spring 3.0 and I see ...

39. Get HTML content by HttpServletResponse / HttpServletRequest    stackoverflow.com

Is there any way to obtain a HTML content by HttpServletResponse or HttpServletRequest? I need to print a PDF based on HTML object.

40. How to Configure context:component-scan in spring dispatch servlet    stackoverflow.com

I want to call a controller method in oauth2 class org.springframework.security.oauth2.provider.endpoint

@RequestMapping(value = "/oauth/authorize", method = RequestMethod.POST)
public void approveOrDeny(@RequestParam("user_oauth_approval")
               ...

41. How to use default-servlet-handler    stackoverflow.com

I want to configure Spring MVC to serve dynamic files mixed with static files, like this (URL => File):

/iAmDynamic.html   => /WEB-INF/views/iAmDynamic.html.ftl
/iAmAlsoDynamic.js => /WEB-INF/views/iAmAlsoDynamic.js.ftl
/iAmStatiHtml      => ...

42. mvc:default-servlet-handler error in deployment.    forum.springsource.org

mvc:default-servlet-handler error in deployment. Hello, With Spring 3.0.5, I got the following error when I deploy a WAR file to Glassfish 3.1, Caused by: org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 23 in XML document ...

43. standard way to map Spring 3 MVC servlet to Root context?    forum.springsource.org

standard way to map Spring 3 MVC servlet to Root context? What is the standard way to map a Spring 3 MVC servlet to the server root context when using Tiles ...

44. Error package org.springframework.web.servlet.mvc does not exist    forum.springsource.org

Error package org.springframework.web.servlet.mvc does not exist Hi, After following the steps of Sample application building tutorial, I am getting following error. I hv added all the libraries. I am using Java ...

45. Question about     forum.springsource.org

Hi, I can't understand what's the purpose of the tag. The reference documentation on this says: This tag allows for mapping the DispatcherServlet to "/" (thus overriding the mapping of ...

46. Spring MVC servlet specification compatibility    forum.springsource.org

One of our teams is debating whether to use struts or spring for MVC. Having worked first hand with both, I recommended they go with Spring. One of their cons, however, ...

47. Share application context with non-MVC servlet    forum.springsource.org

Share application context with non-MVC servlet Hi- My application uses Spring MVC for normal interaction except for one servlet. That servlet is a low-level protocol-oriented one for which Spring MVC is ...

48. How to void setting all the model ojbects in servlet everytime?    forum.springsource.org

SOS! How to void setting all the model ojbects in servlet every time? Hi folks, I am new to Spring and developing a shopping portal website. I would like to seek ...

49. SpringappController.java:1: package org.springframework.web.servlet.mvc does not exis    forum.springsource.org

SpringappController.java:1: package org.springframework.web.servlet.mvc does not exis Folks, I am having a bit of trouble. I am a java newbie, working through the spring MVC example. At step 9, I cannot figure ...

50. Spring MVC with non-Spring servlets?    forum.springsource.org

Can I use Spring MVC in the same web app with non Spring servlets and jsps? We want to integrate Spring only on new features. I can't seem to find any ...

51. Best Practices - Servlet Initialization, Singleton Models and Spring Framework    forum.springsource.org

Best Practices - Servlet Initialization, Singleton Models and Spring Framework Hello All: I'm sure many of you have encountered this scenario and I'm looking for some guidance on best practices. I ...

52. Problems accessing MVC-managed objects in Servlet    forum.springsource.org

Problems accessing MVC-managed objects in Servlet Hi, I'm having a problem. We have a Spring MVC project running nicely, with all kinds of annotated controllers, DAO objects, business objects, etc. Spring ...

53. spring mvc and existing servlet    forum.springsource.org

spring mvc and existing servlet hello, we has a requirement to integrate spring mvc functions into our app. we have currently a front-end controller that is standard servlet that handles all ...

54. Spring Portlet MVC 3.0 Release : File not found: /WEB-INF/servlet/view    forum.springsource.org

Spring Portlet MVC 3.0 Release : File not found: /WEB-INF/servlet/view I have written a simple HelloWorld portlet with Spring 3 Portlet MVC and deploy to Vignette Portal Server and it throws ...

55. mvc:default-servlet-handler    forum.springsource.org

It seems that the default-servlet-handler tag has not yet been added to the schema at http://www.springframework.org/schem...ng-mvc-3.0.xsd. Is it missing, or am I doing it wrong? For now, I can get the ...