Thanks very much, Aaron.

For my case I copied your "portletDefineObjects.jsp" file and included it in 
all jsp files. And I had to
put
<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI" %>
as a page directive in all the jsp files (of course I physically created "tld" 
directory and copied "portlet.tld" underneath).
Then it worked fine.

I tried to put that line in web.xml but it didn't work.

Thanks again!
Bill

----- Original Message ----
From: Aaron Evans <[EMAIL PROTECTED]>
To: Jetspeed Users List <[email protected]>
Sent: Friday, January 12, 2007 8:26:03 AM
Subject: Re: portlet tag not recognized in Eclipse

Do you declare the http://java.sun.com/portlet tag library in your web.xml?

If not, add it like so:

<taglib>
    <taglib-uri>http://java.sun.com/portlet</taglib-uri>
    <taglib-location>/WEB-INF/tld/portlet.tld</taglib-location>
  </taglib>

And put the portlet.tld in the WEB-INF/tld directory.  This is where
the jetspeed deploy puts it if it is not present (you don't want to
end up with dupes).

That should get your editor to recognize the tag.

However, I have found that with the JSP editor that I am using (BEA
Workshop JSP Editor for eclipse 3.1) that the objects declared and
instantiated by that tag (eg. renderRequest and portletConfig) are
still not recognized by my editor.

As a work around, I created a JSP file called
'view/include/portletDefineObjects.jsp' with the following content:


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="javax.portlet.RenderRequest" %>
<%@ page import="javax.portlet.RenderResponse" %>
<%@ page import="javax.portlet.PortletConfig" %>
<%
RenderRequest renderRequest = (RenderRequest)
request.getAttribute("javax.portlet.request");
RenderResponse renderResponse = (RenderResponse)
request.getAttribute("javax.portlet.response");
PortletConfig portletConfig = (PortletConfig)
request.getAttribute("javax.portlet.config");
%>

And then I use the include directive to pull this stuff into every
portlet JSP rather than the <portlet:defineObjects/> tag like so:

<[EMAIL PROTECTED] file="/WEB-INF/view/include/portletDefineObjects.jsp" %>

HTH,
aaron


On 1/11/07, Bill Bartels <[EMAIL PROTECTED]> wrote:
> In Eclipse I was editing a simple jsp file (from David's manning book), the 
> code is as follows:
>
> <%@ page session="false" %>
> <%@ page import="javax.portlet.*"%>
> <%@ page import="java.util.*"%>
> <%@ taglib uri='http://java.sun.com/portlet' prefix='portlet' %>
> <jsp:useBean id="addUrl" scope="request"
> class="java.lang.String" />
> <jsp:useBean id="cancelUrl" scope="request" class="java.lang.String" />
> <portlet:defineObjects/>
> <%
> ResourceBundle myText = portletConfig.getResourceBundle
> (request.getLocale());
> %>
> <B><%=myText.getString("available_bookmarks")%></B><br>
> <FORM ACTION="<%=addUrl%>" METHOD="POST">
> <TABLE CELLPADDING=0 CELLSPACING=4>
> <TR>
> <TD>
> <B><%=myText.getString("name")%></B>
> </TD>
> <TD>
> <B><%=myText.getString("url")%></B>
> </TD>
> <TD>
> </TD>
> </TR>
> <%
> PortletPreferences prefs = renderRequest.getPreferences();
> Enumeration e = prefs.getNames();
> while (e.hasMoreElements())
> {
> String name = (String)e.nextElement();
> String value = prefs.getValue(name, "<" + myText.getString("undefined") + 
> ">");
> %>
> <TR>
> <TD>
> <%=name%>
> </TD>
> <TD>
> <%=value%>
> </TD>
> <TD>
> <portlet:actionURL var="removeUrl">
> <portlet:param name="remove" value="<%=name%>"/>
> </portlet:actionURL>
> <A HREF ="<%=removeUrl.toString()%>">
> [<%=myText.getString("delete")%>] | #8
> </A>
> </TD>
> </TR>
> <%
> }
> %>
> <TR>
> <TD>
> <INPUT NAME="name" TYPE="text">
> </TD>
> <TD>
> <INPUT NAME="value" TYPE="text">
> </TD>
> <TD>
> <INPUT NAME="add" TYPE="submit"
> value="<%=myText.getString("add")%>">
> </TD>
> </TR>
> </TABLE>
> </FORM>
> <FORM ACTION="<%=cancelUrl%>" METHOD="POST">
> <INPUT NAME="cancel" TYPE="submit"
> VALUE="<%=myText.getString("cancel")%>">
> </FORM>
>
> However Ecliplse doesn't recognize <portlet:defineObjects/>, complaining it 
> is a "Unknown tag"; and "portletConfig cannot be resolved"; and also "
> removeUrl cannot be resolved".
>
> Anybody knows the reasons?
> Thanks,
> Bill
>
>
>
> ____________________________________________________________________________________
> Bored stiff? Loosen up...
> Download and play hundreds of games for free on Yahoo! Games.
> http://games.yahoo.com/games/front
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








 
____________________________________________________________________________________
Have a burning question?  
Go to www.Answers.yahoo.com and get answers from real people who know.

Reply via email to