jsp 1 « MVC Controller « Spring Q&A

Spring Q&A
16.Java EE
22.MVC Controller
28.Spring Tool Suite
34.Web Service
Spring Q&A » MVC Controller » jsp 1 

1. call 2 or more views with one controller in spring java    stackoverflow.com

i want to call 2 views within one controller in spring with java. for example

how can i do that? or it is possible in spring? or can you suggest any other way to do ...

2. Is it bad practice to put view code in the controller?    stackoverflow.com

In MVC (such as JSP and Spring), is it bad practice to view related code in the controller? In my case, the controller does some work and then hands off the results ...

3. Spring SimpleFormController - Including Search Form In Success View    stackoverflow.com

UPDATE 1/31/10: Since this thread continues to get a lot of views...I am curious if it has been of help to anyone recently? Feel free to leave comments/feedback, thanks.

I ...

4. How to pass an object from Spring 3.0 controller to JSP view and test with JSTL    stackoverflow.com

First I have a Spring 3.0 controller with a method similar to the following. I'm passing the view an object named "message" and hoping to print that message via the view if ...

5. Spring mvc: controller returns [][], usable in jsp with foreach, but how to bind?    stackoverflow.com

I'm building a spring mvc application. Now the problem I have is the following. I have a controller which adds a DayInfo[][] to my ModelMap. (DayInfo has an id, a title (String) and Text(also ...

6. JSP Spring-MVC Reusing Controller Logic    stackoverflow.com


public List<NewsModel> getFeed(String feedname, @RequestParam("start", optional) Integer startIndex) {
   return feedService.getFeaturedNewsByName(feedname);

public String goToNewsPage(Model m, String newsPageName) {
   m.addAttribute("stories", feedService.getFeaturedNewsByName(newsPageName));
   return getGenericNewsViewName();
as you can see I'm ...

7. How do you call a controller method from an onchange event?    stackoverflow.com

How do you call a controller method from an onchange event? I'm using Spring MVC. I have a <form:list> and I wish to update the current page when an onchange event is triggered ...

8. Spring MVC: JSP or JSON view in Controller method depending on request    stackoverflow.com

Using @ResponseBody my controller returns a JSON representation of my pojo by default, but is possible to change the view to JSP by default, and return a JSON response only when ...

9. Spring MVC Multiaction Controller getParameter returning null    stackoverflow.com

I am new to Spring MVC, need guidance My jsp is like :

<form:form name="form1" method="post" action="input.htm?method=getHealth">
<td >
<form:select path="envList">
<form:options items="${envList}"/>
My .java is like:
public class InputController extends MultiActionController {
    public ModelAndView ...

10. Annotated Controllers in Spring, passing parameter to jsp    stackoverflow.com

I'm trying to complete that tutorial with annotated controllers. I got stuck on the Step 2. Here is what they have for Simple Controllers:

public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse ...

11. Problem in Spring enabled controller page rendering in jsp    stackoverflow.com

When i do this.

public ModelAndView catchAll(@PathVariable String viewName) {
    return new ModelAndView("legacy/" + viewName);
it give an error on the browser that
legacy/123.jsp is not available
How can I ...

12. pass object from jsp to spring controller    stackoverflow.com

i created a class name Person, then i pass its 1 obect via spring controller to jsp page say abc.htm now i want it transfer back to another controller from abc.htm how could ...

13. how to pass 2 Domain obects to 1 jsp page via controller    stackoverflow.com

guys i need your help, please tell me how can i pass 2 different domain object in 1 jsp page via one spring controller. and also tell how can i retrieve it, let i ...

14. how to pass an object value to 2 jsp pages via spring controller    stackoverflow.com

i have 2 model class

public class Abcd {

    private String name;
    private String familyName;

// getters and setters

public class Bcd {

    private String ...

15. Including a page using spring    stackoverflow.com

I'm using spring to display a jsp page. That's fine. Now I'd like to include another page in it. I know I can use the <jsp:include> tag in my page however ...

16. how to pass a ArrayList from Jsp to Spring (annotation base) Controllers    stackoverflow.com

can any body please tell me how to pass a ArrayList of Array from Jsp to pring controller, as i want my user fill some form in which 1 object data is ...

17. transfer UTF8 input from a JSP form to a Spring controller breaks umlauts    stackoverflow.com

Possible Duplicate:
UTF-8 encoding and http parameters
I have a UTF8 encoded JSP with a pure UTF8 header (and the text file is also encoded as ...

18. Using SpEL and eval to call a controller method    stackoverflow.com

I was wondering if it was possible to call a controller method using the tag from a JSP page, a bit like the way it's done in JSF. My Controller

public class ...

19. How to create a jwt image within a spring controller    stackoverflow.com

Hey, I have a spring controller as shown below which is there to create certain image.

public class ImageMapController extends AbstractController {

protected ModelAndView handleRequestInternal( HttpServletRequest request,

20. Spring Web MVC: Simple controller - $-expression doesn't work    stackoverflow.com

I'm starting with Spring Web MVC. I have very simple controller and view, but when i open page http://localhost:8080/springonly/spring/hello i get: ${message}, not Hello World Anybody know what is wrong ...

21. Javascript cannot be found to be loaded from the JSP/controller path    stackoverflow.com

When I try to load a js file externally I keep getting a 404 error in the firebug NET console. The JSP can't seem to be detecting the js file and ...

22. Spring MVC: processing values from timesheet - multiple objects    stackoverflow.com

I'm working on a timesheet/actiontracker application. I'm using Spring MVC. This is my current situation: I got a form with all the tasks. Next to these tasks there are seven textboxes (which ...

23. passing paramters from jsp to Controller in spring MVC    stackoverflow.com

I am trying out a sample project using Spring MVC annotated Controllers. All the examples i have found online so far bind the jsp to a particular model and the controller ...

24. spring controller    stackoverflow.com

how do i load a list into a tbody id? i'm returning in my controller the tbody id of my jsp but it thinks im returning a view and gives an ...

25. How to pass varStatus count from JSP to Controller?    stackoverflow.com

I am fairly new to Spring with annotations and JSTL. I am trying to pass the value of index count from JSP to Spring Controller. However, I do not know how ...

26. Problem about triggering View's $(document).ready handler on Controller response in Spring MVC    stackoverflow.com

We are trying to change our HttpServlet to Spring's DispatcherServlet. We use jQuery and JSP in client side. And there is some dynamic stuff in our pages. For ex there is


27. How to include a controller from jsp page    stackoverflow.com

I'm using Spring MVC. I want to include menu page (named menu.jsp) with a controller (named MenuController) to my main page. If I call http://localhost:8080/myWeb/menu.htm everything is fine. But I ...

28. Passing JSON object from Controller to View(jsp)    stackoverflow.com

I am trying to send JSON object to my view from controller but unable to send it. Please help me out! I am using following code

public class SystemController extends AbstractController{


29. How to pass the entire object from jsp to spring controller    stackoverflow.com

I am new to Spring MVC and hope someone can help me figure out this issue. I have jsp like this:

  <table border="1">
    <td ...

30. Passing special Characters from JSP to Controller    stackoverflow.com

I have some fields with special characters. When I pass those fields from JSP by submiting the form to Springs Controller then it is displayed as shown below.

á - á
é - ...

31. Handling one jsp-page with 2 different Spring controllers    stackoverflow.com

Does anybody know if one can map single jsp page to two different controllers in Spring? For example, I have a page(with a few forms) with a several functionality submit buttons ...

32. How to bind a List using @ModelAttribute to controller from a JSP form    stackoverflow.com

I am trying to get a list of selected candidates to my controller using @modelAttribute with their respective id and blurb. I am able to bring one Candidate correctly but i ...

33. Spring MVC Image Controller, to display Image Bytes in JSP    stackoverflow.com

I have a Spring MVC application, and one of the JSPs must show images coming from a database. The images are stored in the DB as Blobs. What is the easiest way to ...

34. How to bind list from form to controller through initbinder, registerCustomEditor    stackoverflow.com

I am trying to bind form data List to a controller via initBinder. in jsp, i've got a form which gets employee's id, candidate's blurb. The initbinder fin's details of the ...

35. How to handle two different submit operation from same form in a spring controller    stackoverflow.com

I have two submit buttons in my JSP add,remove. I don't really know how to differentiate the operations in the controller side.

<form:form modelAttribute="emp" action="/empl" method="POST"> 
    <input type="submit" ...

36. Refer to html elements by class in spring mvc controller    stackoverflow.com

I know how to refer to HTML elements by name with request.getParameter("foo"); But I have various groups of elements within a form that each have a seperate 'class' attribute. Is there any ...

37. How to get attribute as expression value from controller?    stackoverflow.com

I keep getting this exception:

javax.el.PropertyNotFoundException: Property 'message' not found on type com.itworx.twitter.model.User
when I try to run this code from my controller:
@RequestMapping(value="/profile", method=RequestMethod.GET)
    public ModelAndView goProfile(@ModelAttribute("user") ...

38. spring webmvc mapping the jsp (without controllers)    stackoverflow.com

I am trying to get my hands on Spring 3 web-mvc. I have a simple page link (you know.. <a href="xyz"> thing. Somehow spring mvc doesn't like that.. eer.. well, my spring ...

39. Passing JSP parameters to spring controller    stackoverflow.com

I am having issues with passing values between jsp to controller.. my home.jsp includes another file check.jsp..

<jsp:include page="check.html" flush="true">
    <jsp:param name="param1" value="1" />
    <jsp:param name="param2" value="expert" ...

40. Spring mvc controller return Collection(set, list), jsp use it as array    stackoverflow.com

In controller:

return model.addAttribute("test", new Set<test>());
In JSP, could use jstl
<c:forEach items="${test}" var=value>
to get value from Set. Is it any way to convert Set to array In JSP? Instead of using jstl , ...

41. Getting error while accessing the Map from Spring Controller to JSP using JSTL    stackoverflow.com

I have a spring controller in which I am returning a Map named "model"; model contains some set of values but importantly also contains an ArrayList. Now I am returning this ...

42. Retaining an index for Controller inside jsp foreach    stackoverflow.com

I have a forEach loop in a jsp that loops through a list of objects and displays html table data for each object. I want to have an export link under ...

43. How to get a form value in a controller    stackoverflow.com

I am using Spring MVC. How can I get text box value of the following snippet in my controller method?

<form name="forgotpassord" action="forgotpassword" method="POST" >

44. How to redirect form a controller and get value in jsp    stackoverflow.com

Here forgotUser is key of a map, that i set in a controller's method, which redirect to message.jsp, now how can i use it this map in message.jap to show value ...

45. How to get PathVariable (String) in a Controller method    stackoverflow.com

@RequestMapping(value = "/user/search/{email}")
    public String auditUseremail(@PathVariable("email") String email,Map<String, Object> map) {

this is my conroller class function, which is called when ...

46. Spring controller to reload same page when form is submitted    stackoverflow.com

I'm having a problem with creating a Spring controller that would reload the same page when a form is filled in. What I want to achieve is a page for changing passwords. ...

47. Ajax request not passed to controller    stackoverflow.com

I send an AJAX request to my controller. This development done in JSP and Spring environment. SimpleFormController is overridden by the controller I'm using. Using JavaScript I create the object and ...

48. Passing object from JSP to spring controller    stackoverflow.com

I have the below table in a .JSP page:

<form:form method="post" action="update.dtt" id="contactForms" modelAttribute="contactForms" >
<c:forEach items="${pList}" var="cf">
<td align="center"><c:out value="${cf.fname}" /></td>
<td align="center"><c:out value="${cf.lname}" /></td>
<td align="center"><c:out value="${cf.cprovider}" /></td>
<td align="center"><c:out value="${cf.id}" /></td>
<td align="center"><c:out value="${cf.phone}" /></td>
<td><input ...

49. Controller for each JSP page    forum.springsource.org

Controller for each JSP page Hi, I approached Spring recently. I have two JSP and I want everyone to create a control, is it possible? It 's the best way? My ...

51. Passing several different objects from JSP to controller    forum.springsource.org

Passing several different objects from JSP to controller Hello everyone, I have some issues with the project i'm working on. I want to display a page which allows to insert a ...

52. How to invoke converter in controller (or JSP)?    forum.springsource.org

How to invoke converter in controller (or JSP)? Hello everyone. I am Spring Framework newbe, and I managed to make a very simple CMS, using Hibernate data persistence (I use mySQL ...

53. multiactioncontroller jsp include    forum.springsource.org

multiactioncontroller jsp include Guys, I have a Multiactioncontroller I can call a particular method directly from url where I mapped it and it's fine a controller is being called. But I ...

54. retrieve controller class name from jsp    forum.springsource.org

55. How to call one jsp from anopther jsp in spring .. I am using simpleformcontroller    forum.springsource.org

How to call one jsp from anopther jsp in spring .. I am using simpleformcontroller MVC , hibernate framework created one button on jsp & calling javascript function .. but wht ...

56. acegilogin.jsp through Spring controllers?    forum.springsource.org

acegilogin.jsp through Spring controllers? Hello Again, One of my design objectives is to hide my view technology from the user, so I am interested in routing the login through my controllers. ...

57. How to include a controller from jsp page    forum.springsource.org

Hi, i like to include a page (menu pages) with a controller in all my other jsp page. I use sitemesh and i try this in my default.jsp : <%@ include ...

58. Handling Controller Exceptions in a JSP    forum.springsource.org

Handling Controller Exceptions in a JSP What is the best way to send information about an exception back to a JSP from a SimpleFormController. For instance, I have the following code ...

59. How to use JSP results inside a controller    forum.springsource.org

How to use JSP results inside a controller Hi, I am having problems invoking a JSP from inside a controller and then using the resulting markup of that JSP for another ...

60. Displaying errrors from controller on JSP page    forum.springsource.org

Displaying errrors from controller on JSP page I have a controller that I add an error message to, but am having trouble getting it to show up on my jsp page. ...

61. Using sessionvariable in jsp created in controller    forum.springsource.org

Hai users, I created a session variable in refrenceData of the controller.I am not able to access the variable in my jsp file.Can anyone help me in doing that. Thanks anieshuk ...

62. Forwarding /page.do to WEB-INF/page.jsp (w/out Controller)    forum.springsource.org

Hello. I have .do extensions being handled by Spring MVC. I have many .do and Controller url mappings. However, I have other .jsp files that I don't want to write controllers ...

63. Forwarding to straight jsp, css, or html file, not controller    forum.springsource.org

Forwarding to straight jsp, css, or html file, not controller Simple question: I have Spring forwarding to controllers for all URL's that require processing to create the response. For example, in ...

64. Returning List from Controller and iterate over it in the JSP    forum.springsource.org

Hi all. I am returning List in ModelAndView from the Controller. I want to iterate over this List in the JSP and show the values in a combo box. I am ...

65. controller associated with included jsp not used    forum.springsource.org

Hi, i have a jsp file, A.jsp that has an associated controller. inside A, i do a standard inclusion like: Code:

<%@ include file="/WEB-INF/jsp/B.jsp" %>
also B has ...

66. forwarding http request jsp -> controller -> jsp    forum.springsource.org

forwarding http request jsp -> controller -> jsp I'm trying to clean up an application for a client, but they are quite entrenched a an old(ish) architecture and I can't implement ...

67. Link to jsp without passing via Controller    forum.springsource.org

Hi, is there a simple way to tell Spring to not pass via the controller for certain pages? In a wizardController, i have a href on a jsp that just shows ...

68. Please help, JSP view without controller    forum.springsource.org

Please help, JSP view without controller Hey ppl! Im trying to return a view that is not attached to a controller however its in my WEB-INF/jsp directory because i still want ...

69. Simple JSP controller    forum.springsource.org

I just want my controller to poplulate some values to display on a JSP. All the controllers seem to complicated for that. What do the more experienced developers recommend? I'm on ...

70. validating a fields in jsp using MultiActionController    forum.springsource.org

hi, ia m new to spring i would like to validate the fields of a jsp using multiactioncontroller.can anyone help me out with some sample code.or can anyone suggest me materials ...

71. send array of values from SimpleFormController to jsp    forum.springsource.org

send array of values from SimpleFormController to jsp Excuse me for my bad English This controller directs to editDepartment.jsp which contains the form of editind of department. I need send array ...

72. Any way to populate dropdown in JSP with dummy controller ParameterizableViewControll    forum.springsource.org

My controller is pretty "dumb" as shown below. Right now I am hardcoding the dropdown in the JSP. I want to retrieve it from database to make it dynamic. Can I ...

73. A Controller issue when including JSPS    forum.springsource.org

Hi, I have multiple JSPs which will be included into a different JSPs using jsp:include. Each jsp will perform a different function (One to Post, One to View). I wanted to ...

74. Accessing page number in a JSP view of AbstractWizardFormController    forum.springsource.org

Accessing page number in a JSP view of AbstractWizardFormController Hi, I believe my query relates more to JSP/EL than to Spring MVC framework. I have an AbstractWizardFormController with several views. I ...

75. Controller registers errors, but they're not accessible in the view JSP page    forum.springsource.org

Mar 26th, 2007, 07:07 PM #1 bluzcat View Profile View Forum Posts Private Message Junior Member Join Date Mar 2007 Posts 13 Controller registers errors, but they're not accessible in the ...

76. SimpleFormController invokes doSubmitAction for form view if inside jsp:include    forum.springsource.org

Hi, I found that if the form is called as a page in jsp:include, even when the controller is called first time to render the form view, doSubmitAction is called. I ...

77. Error Display on jsp in AbstractWizardFormController    forum.springsource.org

Error Display on jsp in AbstractWizardFormController hi, i m using AbstractWizardFormController. its working having 3 objects as a part of command object. each object is geing populated on each page. i ...

78. JSP Forward to Controller?    forum.springsource.org

JSP Forward to Controller? In our app, we have a lot of widgets that follow the users around. There might be, for example, a little widget (kinda like a portlet) that ...

79. controller and jsp having applet    forum.springsource.org

controller and jsp having applet hi, i want to send some data to my jsp that is a view and this jsp contains an applet that will use the data... i ...

80. Controller not forwarding to different jsp controller    forum.springsource.org

Controller not forwarding to different jsp controller Hi, I am a newbie at spring and would appreciate some help on this problem. I have these controllers and jsps defined in empapp-servlet.xml ...

81. How do I include another Spring Controller page within an existing JSP?    forum.springsource.org


82. one controller for login handle two different jsp post    forum.springsource.org

one controller for login handle two different jsp post In my app which im are about to implement Spring bit by bit. I have two ways to login 1. from an ...

83. redirect page in abstractwizardformcontroller not in jsp    forum.springsource.org

redirect page in abstractwizardformcontroller not in jsp is there any way through which i can redirect page in abstractformcontroller. normally we send parameters like _finist, _target1 through jsp page. Is there ...

84. reading values in JSP from controller    forum.springsource.org

It seems you did everything right. What kind of controller are you using? Does the "handleRequestInternal" method get called? Use a debug output before you return your ModelAndView.

85. redirecting to another controller from a jsp    forum.springsource.org

redirecting to another controller from a jsp Hello I have a problem where I have a controller that populates a array of product objects Then the jsp displays the product objects. ...

86. MultiActionController + JSP help    forum.springsource.org

Hi, I'm a newbie, and I want to use MultiActionController in the same jsp The only way that I found is but I would like to ...

87. Spring MVC - More than one controller for a JSP    forum.springsource.org

Spring MVC - More than one controller for a JSP Hi, I am using spring mvc with hibernate on oracle. I want to be able to do the following: Is it ...

88. Simple jsp tag question and controller question    forum.springsource.org

Simple jsp tag question and controller question Hello together, In show.jsp I list all my desired objects, so I added a

with a link "view" to show the details of ...

89. testing jsps and controllers    forum.springsource.org

testing jsps and controllers Is there a nice way to test my jsps against my modelandview? I would like to be able to change elements within my modelandview and render the ...

90. Do I need a controller to call a static jsp-page?    forum.springsource.org

I defined several SimpleUrlHandlerMappings that map a xyz.html to an appropriate controller, which calls a jsp-page as the view component. Now I have a html-resource (mypage.html) that just has to call ...

91. Sending controller response to multiple jsp pages    forum.springsource.org

Sep 22nd, 2008, 05:36 PM #1 rsrch View Profile View Forum Posts Private Message Junior Member Join Date Apr 2008 Posts 24 Sending controller response to multiple jsp pages Hi, I ...

92. multiactioncontroller jsp page form help    forum.springsource.org

hey, i havea quick question about multiactioncontroller. On my jsp view page, i have my form. Code:

95. invoking controller from JSP    forum.springsource.org

96. How to get controller name in jsp view file    forum.springsource.org

97. Best practice design to pass an objet of a collection from a jsp to a controller    forum.springsource.org

Best practice design to pass an objet of a collection from a jsp to a controller Hello, I'm writing this post to get some advice on how to design my web ...

98. How to create a controller/jsp for a one to many relationship?    forum.springsource.org

How to create a controller/jsp for a one to many relationship? First off, great work on a fantastic framework! I started off my latest project with spring roo. My data model ...

99. [MVC] Configure a controller who return null to be evaluated as JSP    forum.springsource.org

[MVC] Configure a controller who return null to be evaluated as JSP Hi everyone, I'm using Srping in my webapp. Since some times I want to allow users to extend some ...

100. best practice to format object before rendering jsp in the MultiActionController?    forum.springsource.org

What is the best practice to formated domain object before rendering JSP in the MultiActionController ? e.g. I need to format date (property in the domain object) to desire format before ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.