Skip to main content

The "http://java.sun.com/JSP/Page" namespace

3 replies [Last post]
beaupral
Offline
Joined: 2009-03-18
Points: 0

Hi all,

I'm not sure if this is the right forum to ask, but I'm confused about the jsp namespace "http://java.sun.com/JSP/Page" and there isn't much information out there.

The problem is I can't declare this namespace in my .xhtml files (and use the "jsp:" tags), I always get

Warning: This page calls for XML namespace http://java.sun.com/JSP/Page declared with prefix jsp but no taglibrary exists for that namespace

Am I missing a .tld files ? I'm using tomcat 6 and Mojarra 2.0.2.FCS.

Thanks for any help!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
manuelbernhardt
Offline
Joined: 2010-07-15
Points: 0

Hi,

> The problem is I can't declare this namespace in my
> .xhtml files (and use the "jsp:" tags), I always get

This does look a bit odd to me -- to my knowledge, some JSF tags have a support in JSP (so you can use them in a JSP page), but I'm afraid the other way around just won't work -- the JSF lifecycle is rather different from the JSP lifecycle, so JSP tags won't run in a JSF view.

That is, some of the taglibs that exist for JSP also exist for JSF (like e.g. the JSTL core taglib). For the rest, you should be able to achieve the same kind of things you wanted to do with a jsp: tag in JSF, however probably in a different way.

Hope this helps,

Manuel

beaupral
Offline
Joined: 2009-03-18
Points: 0

Thanks for the answer Manuel,

I guess that now, my question is :

What is the use of the "jsp:root" tag and when can you use it (.jsp, .jsp, .xhtml) ?

Thanks

manuelbernhardt
Offline
Joined: 2010-07-15
Points: 0

Hi,

> Thanks for the answer Manuel,
>
> I guess that now, my question is :
>
> What is the use of the "jsp:root" tag and when can
> you use it (.jsp, .jsp, .xhtml) ?
>
> Thanks

I have never used the jsp:root tag directly. Also, from what I can read at

http://download.oracle.com/javaee/1.4/tutorial/doc/JSPX3.html
http://java.sun.com/products/jsp/syntax/1.2/syntaxref123.html

it looks to me like this tag was being used in very early versions of JSP (the Java Server Pages standard is at version 2.1 now).

So to answer your question, you can use jsp:root in .jsp files.

.xhtml files are used by Java Server Faces 2.x as a means to model JSF views.

Perhaps you might want to read a bit more on JSP/JSF and the history. Especially if you use Mojarra (the JSF 2.x RI) you are probably better of developing views in XHTML rather than with JSP & JSF tags from JSF 1.x