Hello,
I begin to learn spring, i'm working on a simple form but a have a problem(stupid but i'v just begun with spring)!
i'll give an example of my code, and some questions, ans thank you a lot for any helps!
i create a class for the form:
i'v a controller:Code:public class Form{ String Test; public Form(){ this.settest("valeur_test"); } public String getTest() { return this.Test; } public void setTest(String test_value) { this.Test=test_value; }
and this config file for the controllerCode:public class RequestController extends SimpleFormController { //just a simple submit which does nothing public ModelAndView onSubmit(Object command) throws ServletException { //Processing user Post request //Doing somth ... return new ModelAndView(new RedirectView(getSuccessView())); } }
and in my first jsp, i want just to have my attribute 'test' from the form class, and even i want to add some attributes that Form class has not, for example add attributes in the controller class for the model and view or smth like that, but i don't know howCode:<beans> <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/hello">RequestController</prop> </props> </property> </bean> <bean id="RequestController" class="RequestController"> <property name="sessionForm"> <value>true</value> </property> <property name="commandName"> <value>form</value> </property> <property name="commandClass"> <value>Form</value> </property> <property name="formView"> <value>Request</value> </property> <property name="successView"> <value>Requestsucc</value> </property> </bean>! i can't also have may 'test' in the jsp, i've:
i have the page in my browser, but with $Form.test (no value)Code:... <c:out value="${form.Test}"/> ...
perhaps a syntax error, but ??
many thanks for your helps!


! i can't also have may 'test' in the jsp, i've:
Reply With Quote
, it was cut/paste problem

