Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7761099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:03:36+00:00 2026-06-01T14:03:36+00:00

Started learning Wicket after ASP.NET MVC and feel a little bit confused about managing

  • 0

Started learning Wicket after ASP.NET MVC and feel a little bit confused about managing its URLs. Here’s the code:

Application:

package com.test.wicketapp1;

import org.apache.wicket.protocol.http.WebApplication;

public class WicketApplication extends WebApplication {
    public WicketApplication() {
        mountPage("/page1", HomePage.class);
        mountPage("/page2", Page2.class);       
    }

    @Override public Class<HomePage> getHomePage() {
        return HomePage.class;
    }
}

HomePage:

package com.test.wicketapp1;

import java.io.IOException;

import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.WebPage;

public class HomePage extends WebPage {
    private static final long serialVersionUID = 1L;

    public HomePage(final PageParameters parameters) throws IOException {
        BookmarkablePageLink<Page2> bookmarkablePageLink = new BookmarkablePageLink<Page2>("gopage2link", Page2.class);
        add(bookmarkablePageLink);
    }
}

HomePage markup:

<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
    <head>
        <title>Apache Wicket Quickstart</title> 
    </head>
    <body>
        <a href="#" wicket:id="gopage2link">go page 2</a>
    </body>
</html>

What I wanted to have is pretty simple. I expected that there would be 2 urls: “/page1” for HomePage.class and “/page2” for Page2.class, then my HomePage has a link that navigates to Page2 and when HomePage is rendered, that link should have an URL of “/page2”.

When I run the application and go to home page, it is rendered like this:

<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
    <head>
        <title>Apache Wicket Quickstart</title> 
    </head>
    <body>
        <a href="./wicket/bookmarkable/com.test.wicketapp1.Page2" wicket:id="gopage2link">go page 2</a>
    </body>
</html>

I expected to have something like:

<a href="/page2" wicket:id="gopage2link">go page 2</a>

instead. What did I miss?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:03:37+00:00Added an answer on June 1, 2026 at 2:03 pm

    The problem is – I should use app’s init method instead of ctor to define the mappings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just started learning ASP.net and I can't seem to get the GridView to
I started learning ASP.NET MVC3. So, while reading tutorials online and in books, I
i started learning a bit about mysql and while i was reading i was
I started learning c++ about 3 weeks ago after 2 years of java. It
I started learning Iphone development. As i'm reading about the cocoa development framework, few
I started learning haskell yesterday and I got stuck on a problem. After a
I started learning the scala actors framework about two days ago. To make the
Started learning TDD and met some misunderstandings about different approaches for writing tests. In
I have just started learning java and i have about 8 months time. My
I started learning functional programming (OCaml), but I don't understand one important topic about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.