Note that there are some explanatory texts on larger screens.

plurals
  1. POnavigating between forms using annotation-based controllers
    primarykey
    data
    text
    <p>I am new to annotated controllers and i have a problem. Ive heard it is possible to navigate between forms using them, but cant achieve that.</p> <p>Well probably I could use SWF but for whole project controllers are more suitable.</p> <p>My controllers looks like this:</p> <pre><code>@Controller public class AnDBChooseController { @RequestMapping("/dbchoose") public ModelAndView choose(@ModelAttribute("db") ComponentDB db){ ModelAndView mv=new ModelAndView(); switch(db.getDbAction()){ case 1: // dodanie komponentu if (db.getDbType().equals(ComponentDB.DB_CAPACITOR)){ mv.addObject("capacitor",new Capacitor()); mv.setViewName("addcapacitor"); }else if (db.getDbType().equals(ComponentDB.DB_RESISTOR)){ mv.setViewName("addresistor"); } break; case 2: // future break; case 3: // future break; default: // future break; } return mv; } } </code></pre> <p>This controller should send me to addcapacitor.jsp</p> <p>Secound controller (witch never starts)</p> <pre><code>@Controller public class AnAddCapacitorController { ComponentParamTypeService paramService; @ModelAttribute("subclass") public ArrayList&lt;ComponentParamType&gt; getSubclasses(){ System.out.println("I am here :]"); return paramService.getParamsForType(ComponentParamType.SUBCLASS_CAPACITOR); } @RequestMapping("/addcapacitor") public String add(@RequestParam("capacitor")Capacitor capacitor){ return "addcapacitordetails"; } public ComponentParamTypeService getParamService() { return paramService; } public void setParamService(ComponentParamTypeService paramService) { this.paramService = paramService; } } </code></pre> <p>Of course "I am here :]" never shows on console :(</p> <p>How should change that so i am redirected to addcapacitor whitout loosing model parameters?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload