Author | Message |
---|---|
jgreen
Posts: 23
|
Posted 14:28 Nov 05, 2009 |
Hello, I am stuck on this error org.apache.jasper.JasperException: java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'OnlineAssignment' available as request attribute I assume that a bindingresult is the object passed back from the form that should be made into a command, but I might be mistaken about this. Is this a problem with not having a bean declared to catch the command? I have the bean for it, and i have set the commandName and class.
I have another question too. The xml files such as csns-data.xml and csns-servlet.xml get generated from building the project, correct? But I noticed that all of the Dao beans are declared in csns-data.xml, and when I do not declare my OnlineAssignmentDao in there (when I put it in spring-servlet instead) I get an error about it not existing. The error ceases when I put it in csns-data.xml. Since these xml files are generated by the servlet, where is this information coming from? I am thinking that when I submit my homework it will not work for you because this declaration will not be there, but I don't know where you declared all of the Dao beans, since they are not in spring-servlet. But I would like to put my bean declaration somewhere so that it does make it into the appropriate place. I hope this makes sense. I obviously do not understand completely how this linking up works, but I would like to. Thanks. |
cysun
Posts: 2935
|
Posted 14:46 Nov 05, 2009 |
Post a screenshot or the log message.
Modify conf/spring-data.xml. If you set up the Ant builder correctly, the build script will automatically update web/WEB-INF/csns-data.xml. You need to refresh the project so Eclipse is aware of the changes to csns-data.xml before running the project. It's the same things for other spring-*.xml/csns-*.xml files. Last edited by cysun at
14:48 Nov 05, 2009.
|
jgreen
Posts: 23
|
Posted 14:50 Nov 05, 2009 |
2009-11-05 14:44:38,646 ERROR InputTag: Neither BindingResult nor plain target object for bean name 'OnlineAssignment' available as request attribute |
cysun
Posts: 2935
|
Posted 14:54 Nov 05, 2009 |
Check commandName in the bean configuration - it should match the commandName in the <form> tag in the JSP. |
harshil4u
Posts: 8
|
Posted 15:13 May 13, 2011 |
I am getting this exception when i am trying to keep ADD Task on the same View(JSP) with the list tasks. If i keep "Add task" as different JSP then it's working.
If you know how to resolve this then please let me know.
|
cysun
Posts: 2935
|
Posted 15:19 May 13, 2011 |
Do redirect instead of forward after adding a task. |
harshil4u
Posts: 8
|
Posted 15:44 May 13, 2011 |
Hello, I am using "redirect" after adding task. Actually error is not generating after adding the task , exception occurs while selecting the "calendar" from resource menu itself. Means viewCalendar.jsp thowing error. The entire error message from console is
SEVERE: Servlet.service() for servlet jsp threw exception |
cysun
Posts: 2935
|
Posted 15:51 May 13, 2011 |
I assume you have two controllers: ViewCalendar and AddTask, and both use the same view, which is not a good design. The simple solution is to just use regular HTML form instead of the Spring <form> tag. And for AddTask, inherit AbstractController instead of SimpleFormController. Because to add a task, all you need from the input is the task title, you don't really need to use a command object - just do it with request.getParameter(). |