Source:
private void initContent() { @SuppressWarnings("serial") Form<UsernamePassword> loginForm = new Form<UsernamePassword>("loginForm") { @Override protected void onSubmit() { AuthenticatedWebSession session = AuthenticatedWebSession.get(); if (session.signIn(user.getUsername(), user.getPassword())) { setDefaultResponsePageIfNecessary(); } else { error(new StringResourceModel("error", this, null).getString()); } } private void setDefaultResponsePageIfNecessary() { if (!continueToOriginalDestination()) { setResponsePage(getApplication().getHomePage()); } } }; loginForm.setModel(new CompoundPropertyModel<UsernamePassword>(user)); add(loginForm); loginForm.add(new RequiredTextField<String>("username")); loginForm.add(new PasswordTextField("password")); FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); add(feedbackPanel); add(new Image("topImage", CommonPictureLocator.getGreyscaleLogoBig())); MyImprintPanel imprintDialogue = new MyImprintPanel("imprintDialogue"); imprintDialogue.setOutputMarkupId(true); add(imprintDialogue); ExternalLink addUserLink = new ExternalLink("imprint", "#"); addUserLink.add(AttributeModifier.replace("onClick", "showModalButtonCloseDialogue('" + imprintDialogue.getMarkupId() + "'" + ",'" + getLocalizer().getString("imprint", this) + "',false,false,550,450)")); loginForm.add(addUserLink); add(new Link<Object>("lang.en") { private static final long serialVersionUID = -2740581767694866689L; @Override public void onClick() { getSession().setLocale(Locale.ENGLISH); setResponsePage(this.getPage()); } }); add(new Link<Object>("lang.de") { private static final long serialVersionUID = -6858440905643185661L; @Override public void onClick() { getSession().setLocale(Locale.GERMAN); setResponsePage(this.getPage()); } }); }

Target:
private void initContent() { @SuppressWarnings("serial") Form<UsernamePassword> loginForm = new Form<UsernamePassword>("loginForm") { @Override protected void onSubmit() { AuthenticatedWebSession session = AuthenticatedWebSession.get(); if (session.signIn(user.getUsername(), user.getPassword())) { setDefaultResponsePageIfNecessary(); } else { error(new StringResourceModel("error", this, null).getString()); } } private void setDefaultResponsePageIfNecessary() { if (!continueToOriginalDestination()) { setResponsePage(getApplication().getHomePage()); } } }; loginForm.setModel(new CompoundPropertyModel<UsernamePassword>(user)); add(loginForm); loginForm.add(new RequiredTextField<String>("username")); loginForm.add(new PasswordTextField("password")); FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); add(feedbackPanel); add(new Image("topImage", CommonPictureLocator.getGreyscaleLogoBig())); Panel imprintDialogue = new DefaultImprintPanel("imprintDialogue"); imprintDialogue.setOutputMarkupId(true); add(imprintDialogue); ExternalLink addUserLink = new ExternalLink("imprint", "#"); addUserLink.add(AttributeModifier.replace("onClick", "showModalButtonCloseDialogue('" + imprintDialogue.getMarkupId() + "'" + ",'" + getLocalizer().getString("imprint", this) + "',false,false,550,450)")); loginForm.add(addUserLink); add(new Link<Object>("lang.en") { private static final long serialVersionUID = -2740581767694866689L; @Override public void onClick() { getSession().setLocale(Locale.ENGLISH); setResponsePage(this.getPage()); } }); add(new Link<Object>("lang.de") { private static final long serialVersionUID = -6858440905643185661L; @Override public void onClick() { getSession().setLocale(Locale.GERMAN); setResponsePage(this.getPage()); } }); }