Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Suggest selectors rather than request parameters

...

Another suggestion is to register a generic node creation form script, e.g. at /apps/sling/servlet/default/create.esp. You should be able to invoke that script by browsing to /gradapp/application/*.create. If you want the create.esp script to be able to render different forms
(e.g. one for applications, one for tabs) you could do so by checking on a query parameter.can use different selectors, like *.createTab, *.createApp, etc.

An older version of this answer suggests using a query parameter, this also works but we recommend using selectors in Sling, leading to cleaner and cachable URLs.

So this would workSo requesting:

Code Block
   /gradapp/application/*.create?typeToCreate=application

could give a form for creating application nodes , while:and

Code Block
   /gradapp/application/*.create?typeToCreate=tab

for showing the tab

...

form, but this is the preferred way:

Code Block

   /gradapp/application/*.createApp

for creating application nodes and

Code Block

   /gradapp/application/*.createTab

for showing could give the tab form.

See: http://markmail.org/message/htl6r3uctuzb6l5q and http://mail-archives.apache.org/mod_mbox/sling-users/200911.mbox/%3c8A802DC6-7472-4040-807A-D55524F30D3E@gmail.com%3e

...