0

I have the following view:

@Component
@Scope("prototype")
@Route(value = "jobs", layout = JobsLayout.class)
@PageTitle("Jobs")
@AnonymousAllowed
public class AllJobsView extends VerticalLayout implements LocaleChangeObserver {

with route = "jobs". Such page is available via /jobs url

Now, I'd like the following pages:

/jobs/{job_id}/{job_name_slug}

for example

/jobs/123/solutions-architect

where I'll show the job description

also:

/jobs/123/edit
/jobs/123/apply

As you may see, the website may have tons of "dynamic" pages like

/jobs/123/solutions-architect
/jobs/4567/program-manager

and so on.

And also a few "static" pages like

/jobs/123/edit
/jobs/123/apply

All of them ("dynamic" and "static") are located under pretty much the same URL pattern.

How to properly configure such routes with Vaadin framework?

alexanoid
  • 24,051
  • 54
  • 210
  • 410
  • 1
    Have you tried https://vaadin.com/docs/latest/routing/additional-guides/route-templates – cfrick Aug 07 '22 at 18:35
  • Thank you! So based on the url parameters inside the 'setParameter' method, I may create different forms - `If edit - form1, if apply - form2 else - form3` ? – alexanoid Aug 07 '22 at 18:43
  • Also, just noting. When using `@Route` you should not use `@Component` and `@Scope` annotations. Routes will allow autowiring without those. – Tatu Lund Aug 08 '22 at 07:38
  • thank you! I removed `@Component` and `@Scope` – alexanoid Aug 08 '22 at 08:08

0 Answers0