Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Spring MVC::SimpleFormController::initialization

Empfohlene Antworten

Hallo

ich habe eine Java Programm. Als Framework benutze ich Spring MVC.

Ich habe folgende classen:

public class Person{


   private int id;

   private String nachname;

   private String vorname;

   private Address address;


   // GETer und SETer Methoden

  ...

}


public class Address{


   private String strasse;

   private String stadt;

   private int nr;


   // GETer und SETer Methoden

  ...

}
Wenn ich es einfach mit Spring MVC auf eine *.jsp datei dasganze zuweisen möchte, geht es mit :
public ModelAndView handleRequest(...)
Ich habe Aber einen SimpleFormController, und meine Frage wäre wie kann ich die Form-Seite initializieren (also änlich wie mit handleRequest)??? Meine SimpleFormController-Klasse:
public class FormController extends SimpleFormController{


    protected final Log logger = LogFactory.getLog(getClass());

    private WebClientService webClientService;


	public FormController(){

		setCommandClass(Person.class);

		setCommandName("person");

	}


	public ModelAndView onSubmit(Object command) throws ServletException {

		// ...

		return new ModelAndView(new RedirectView(getSuccessView()));

	}


    /* Hier sollte so eine wie init()- Methode Sein */


}

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.