You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Federico Paparoni <fe...@gmail.com> on 2010/05/11 16:30:26 UTC

Application packaging

Hi all,

I read the documentation available on the Sling website and tested the basic
examples.
Everything works, but now I want to create something like espblog, to better
examine Sling features.
I created a maven project and deployed it using the Felix console but it
doesn't work.
In this example I created some jsp but when i try to call them, the browser
downloads it.
In the log I can see

11.05.2010 16:18:10.516 *INFO* [FelixDispatchQueue] slingblog BundleEvent
INSTALLED
11.05.2010 16:18:10.516 *INFO* [FelixDispatchQueue] slingblog BundleEvent
RESOLVED
11.05.2010 16:18:10.548 *INFO* [Background Install
C:\DOCUME~1\a155876\IMPOST~1\Temp\install1474139204158110668.tmp]
org.apache.sling.jcr.co
ntentloader.internal.ContentLoaderService createFile: Cannot find content
type for created.html.jsp, using application/octet-stream
11.05.2010 16:18:10.704 *INFO* [Background Install
C:\DOCUME~1\a155876\IMPOST~1\Temp\install1474139204158110668.tmp]
org.apache.sling.jcr.co
ntentloader.internal.ContentLoaderService createFile: Cannot find content
type for home.html.jsp, using application/octet-stream
11.05.2010 16:18:10.735 *INFO* [Background Install
C:\DOCUME~1\a155876\IMPOST~1\Temp\install1474139204158110668.tmp]
org.apache.sling.jcr.co
ntentloader.internal.ContentLoaderService createFile: Cannot find content
type for new.html.jsp, using application/octet-stream
11.05.2010 16:18:10.986 *INFO* [FelixDispatchQueue] slingblog BundleEvent
STARTED

How can I tell Sling these are JSP?

Cheers

Federico

Re: Re: Application packaging

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Federico,

On Wed, May 12, 2010 at 11:26 AM, Federico Paparoni
<fe...@gmail.com> wrote:
> ...In
> the espBlog example I put one script under /apps/blog and then calling
> /content/blog/*.html browser receive the result of esp script. In that case
> which resource I'm calling? This two folder apps and content have some
> particular feature?...

Yes, there is some magic in that case ;-)

That sample uses the path-based-rtp bundle (samples/path-based-rtp) to
provide default resource types for non-existing resources, based on
their path.

Requesting /content/espblog/*.html provides a resource with the
"espblog" resource type, so the html rendering of that is handled by
the apps/espblog/html.esp script. Looking at the "recent requests"
page in the OSGi console at /system/console should show that.

In the general case, as Vidar says, you should set a
sling:resourceType on your nodes to trigger the appropriate scripts.

HTH,
-Bertrand

R: Re: Application packaging

Posted by Federico Paparoni <fe...@gmail.com>.
Ok I understand it, but I don't understand how I have to call the node. In
the espBlog example I put one script under /apps/blog and then calling
/content/blog/*.html browser receive the result of esp script. In that case
which resource I'm calling? This two folder apps and content have some
particular feature?

Il giorno 11 mag, 2010 10:25 p., "Vidar Ramdal" <vi...@idium.no> ha scritto:

On Tue, May 11, 2010 at 4:30 PM, Federico Paparoni <
federico.paparoni@gmail.com> wrote: > Hi all, > ...
I don't think you have to. Those messages are from the content loader,
which is the component responsible for registering the files in the
repository. That does not affect script resolution later.

You shouldn't request the JSP files directly from the browser, but
rather request a resource (like a JCR node) which has it's
sling:resourceType property set to correspond to a script.

--
Vidar S. Ramdal <vi...@idium.no> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00 / +47 21 531941, ext 2070

Re: Application packaging

Posted by Vidar Ramdal <vi...@idium.no>.
On Tue, May 11, 2010 at 4:30 PM, Federico Paparoni
<fe...@gmail.com> wrote:
> Hi all,
>
> I read the documentation available on the Sling website and tested the basic
> examples.
> Everything works, but now I want to create something like espblog, to better
> examine Sling features.
> I created a maven project and deployed it using the Felix console but it
> doesn't work.
> In this example I created some jsp but when i try to call them, the browser
> downloads it.
> In the log I can see
>
> 11.05.2010 16:18:10.516 *INFO* [FelixDispatchQueue] slingblog BundleEvent
> INSTALLED
> 11.05.2010 16:18:10.516 *INFO* [FelixDispatchQueue] slingblog BundleEvent
> RESOLVED
> 11.05.2010 16:18:10.548 *INFO* [Background Install
> C:\DOCUME~1\a155876\IMPOST~1\Temp\install1474139204158110668.tmp]
> org.apache.sling.jcr.co
> ntentloader.internal.ContentLoaderService createFile: Cannot find content
> type for created.html.jsp, using application/octet-stream
> 11.05.2010 16:18:10.704 *INFO* [Background Install
> C:\DOCUME~1\a155876\IMPOST~1\Temp\install1474139204158110668.tmp]
> org.apache.sling.jcr.co
> ntentloader.internal.ContentLoaderService createFile: Cannot find content
> type for home.html.jsp, using application/octet-stream
> 11.05.2010 16:18:10.735 *INFO* [Background Install
> C:\DOCUME~1\a155876\IMPOST~1\Temp\install1474139204158110668.tmp]
> org.apache.sling.jcr.co
> ntentloader.internal.ContentLoaderService createFile: Cannot find content
> type for new.html.jsp, using application/octet-stream
> 11.05.2010 16:18:10.986 *INFO* [FelixDispatchQueue] slingblog BundleEvent
> STARTED
>
> How can I tell Sling these are JSP?

I don't think you have to. Those messages are from the content loader,
which is the component responsible for registering the files in the
repository. That does not affect script resolution later.

You shouldn't request the JSP files directly from the browser, but
rather request a resource (like a JCR node) which has it's
sling:resourceType property set to correspond to a script.

-- 
Vidar S. Ramdal <vi...@idium.no> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00 / +47 21 531941, ext 2070