You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by hiren <hi...@yahoo.co.in> on 2006/12/02 05:07:51 UTC

JSP and Jetspeed

I trying to use JSP in my portal code. But it is not working.  Below is my
code. If anyone can go through my code let me where I am going wrong.

I not worked before with JSP and Portal.


DIRECTORY STRUCTURE:

bookmark  -  WEB-INF - classes  - BookmarkPortlet.class
                               -  portlet.xml
                                 web.xml
                                
                                  jsp - view.jsp
                                         edit.jsp


---------------------------------------------------------------------------------------------------------------------------------
BookmarkPortlet.java


import java.io.IOException;
import java.io.Writer;
import javax.portlet.*;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;



public class BookmarkPortlet extends javax.portlet.GenericPortlet
{
	public void doEdit(RenderRequest request,RenderResponse response) 
		throws PortletException, IOException
	{
		response.setContentType("text/html");
		String jspName = getPortletConfig().getInitParameter("jspEdit");

		PortletURL addUrl = response.createActionURL();
		addUrl.setPortletMode(PortletMode.VIEW);
		addUrl.setParameter("add","add");
		request.setAttribute("addUrl",addUrl.toString());
		PortletURL cancelUrl = response.createRenderURL();
		cancelUrl.setPortletMode(PortletMode.VIEW);
		request.setAttribute("cancelUrl",cancelUrl.toString());
		PortletRequestDispatcher rd = 
			getPortletContext().getRequestDispatcher(jspName);
		rd.include(request,response);
		
	}
	

	public void doView(javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)
		throws javax.portlet.PortletException, java.io.IOException
	{
		response.setContentType("text/html");
		String jspName = getPortletConfig().getInitParameter("jspView");

		PortletRequestDispatcher rd = 
			getPortletContext().getRequestDispatcher(jspName);
		rd.include(request,response);
	}

	
	public void processAction(ActionRequest actionrequest, ActionResponse
actionresponse)
		throws PortletException, IOException
	{
		String removeName = actionrequest.getParameter("remove");

		if(removeName != null)
		{
			PortletPreferences prefs = actionrequest.getPreferences();
			prefs.reset(removeName);
			prefs.store();
		}

		String add = actionrequest.getParameter("add");
		if(add !=null)
		{
			PortletPreferences prefs = actionrequest.getPreferences();
			prefs.setValue(actionrequest.getParameter("name"),
				actionrequest.getParameter("value"));
			prefs.store();
		}

		
	}
}

---------------------------------------------------------------------------------------------------------------------------------


---------------------------------------------------------------------------------------------------------------------------------
view.jsp


<%@ page session="false" %>
<%@ page import="javax.portlet.*"%>
<%@ page import="java.util.*"%>
<%@ taglib uri='http://java.sun.com/portlet'
prefix='portlet' %>
<portlet:defineObjects/>
<%
ResourceBundle myText =
portletConfig.getResourceBundle(request.getLocale());
%>
<%=myText.getString("available_bookmarks")%><br>
<%
PortletPreferences prefs = renderRequest.getPreferences();

Enumeration e = prefs.getNames();
if (!e.hasMoreElements())
{
%>
<%=myText.getString("no_bookmarks")%><BR>
<%
}

while (e.hasMoreElements())
{
String name = (String)e.nextElement();
String value = prefs.getValue
(name,"<"+
myText.getString("undefined")+">");
%>
<%=value% ><%=name%> <BR>

<%
}
%>


---------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------
edit.jsp



<%@ 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());
%>
<%=myText.getString("available_bookmarks")%><br>

<FORM ACTION="<%=addUrl%>" METHOD="POST">
<TABLE CELLPADDING=0 CELLSPACING=4>
<TR>
<TD>
<%=myText.getString("name")%>
</TD>
<TD>
<%=myText.getString("url")%>
</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>
"<%=removeUrl.toString()% ">
[<%=myText.getString("delete")%>]

</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>

---------------------------------------------------------------------------------------------------------------------------------


---------------------------------------------------------------------------------------------------------------------------------
portlet.xml


<?xml version="1.0" encoding="UTF-8"?>
<portlet-app id="bookmark" version="1.0">
  <portlet id="Bookmark">
    <portlet-name>Bookmark</portlet-name>
    <display-name>Bookmark Portlet</display-name>
    <portlet-class>BookmarkPortlet</portlet-class>
<init-param>
<name>jspView</name>
<value>/jsp/view.jsp</value>
</init-param>
<init-param>
<name>jspEdit</name>
<value>/jsp/edit.jsp</value>
</init-param>


    <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
      <portlet-mode>EDIT</portlet-mode>
    </supports>
    <supported-locale>en</supported-locale>
    <portlet-info>
      <title>Bookmark</title>
      <short-title>List of URLs</short-title>
    </portlet-info>
  </portlet>
</portlet-app>

---------------------------------------------------------------------------------------------------------------------------------


---------------------------------------------------------------------------------------------------------------------------------
web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
                         "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <display-name>Bookmark Portlet</display-name>
  <description>Bookmark Application for maintaining list of
URLs</description>
</web-app>


---------------------------------------------------------------------------------------------------------------------------------


-- 
View this message in context: http://www.nabble.com/JSP-and-Jetspeed-tf2741960.html#a7650317
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE : Re: Portlet Application not available

Posted by Audrey MORELLE <au...@yahoo.fr>.
> 1. manually 'infuse' the Jetspeed Container into the portlet 
application's web.xml
   
  I don't understand what do you mean by "infuse the Jetspeed Container". Can you explain ?
   
  > 3. 4.
   
  So I just have to drop my war file in both webapps directory, nothing in deploy directory ?
   
  Thank you for your answer.
   
  Audrey Morelle

David Sean Taylor <da...@bluesunrise.com> a écrit :
  Audrey MORELLE wrote:
> Any idea about "Is there any possibility to change information in
> database to force the deployement ? What are the data used to know if
> deployement is needed ?" ?
> 
We have been testing this with the latest SVN trunk, I don't see where 
the second deployment actually forces a re-registration of the portlet 
application. The checksum test always works here.

Here are the steps I took, with two Tomcat servers (tomcat-1, tomcat-2)

1. manually 'infuse' the Jetspeed Container into the portlet 
application's web.xml

2. build the portlet application war file, we'll call it "pa.war"

3. drop pa.war into tomcat-1/webapps directory
Tomcat picks up the new war file, deploys the new application
In the servlet init of the Jetspeed Container, a checksum test
is applied. A new checksum is detected, and the portlet application
is re-registered with Jetspeed.

4. drop pa.war into tomcat-2/webapps directory
Tomcat picks up the new war file, deploys the new application
In the servlet init of the Jetspeed Container, a checksum test
is applied. A new checksum is NOT detected, since we already 
deployed to tomcat-1, and the portlet application is NOT re-registered 
with Jetspeed.


5. navigate to either tomcat-1 or tomcat-2, both correctly show the 
latest pa.war portlets

The one outstanding problem, which we are working on a fix, is with the 
search indexes. Should have a patch ready this week

 		
---------------------------------
 Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.

Re: RE : Re: Portlet Application not available

Posted by David Sean Taylor <da...@bluesunrise.com>.
Audrey MORELLE wrote:
> Any idea about "Is there any possibility to change information in
> database to force the deployement ? What are the data used to know if
> deployement is needed ?" ?
> 
We have been testing this with the latest SVN trunk, I don't see where 
the second deployment actually forces a re-registration of the portlet 
application. The checksum test always works here.

Here are the steps I took, with two Tomcat servers (tomcat-1, tomcat-2)

1. manually 'infuse' the Jetspeed Container into the portlet 
application's web.xml

2. build the portlet application war file, we'll call it "pa.war"

3. drop pa.war into tomcat-1/webapps directory
    Tomcat picks up the new war file, deploys the new application
    In the servlet init of the Jetspeed Container, a checksum test
    is applied. A new checksum is detected, and the portlet application
    is re-registered with Jetspeed.

4. drop pa.war into tomcat-2/webapps directory
    Tomcat picks up the new war file, deploys the new application
    In the servlet init of the Jetspeed Container, a checksum test
    is applied. A new checksum is NOT detected, since we already 
deployed to tomcat-1, and the portlet application is NOT re-registered 
with Jetspeed.


5. navigate to either tomcat-1 or tomcat-2, both correctly show the 
latest pa.war portlets

The one outstanding problem, which we are working on a fix, is with the 
search indexes. Should have a patch ready this week



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE : Re: Portlet Application not available

Posted by Audrey MORELLE <au...@yahoo.fr>.
Any idea about "Is there any possibility to change information in database to force the deployement ? What are the data used to know if deployement is needed ?" ?
   
  Audrey Morelle

Audrey MORELLE <au...@yahoo.fr> a écrit :
  David Sean Taylor a écrit : 
> > Second problem :
> > 
> > We have 2 tomcat with jetspeed but only 1 database, they are exactly
> > the same. But when I copy my application war in both deploy directory
> > (not at the same moment), only one deploy it correctly, it works
> > fine. The other one seems to deploy, log said it is deployed and the
> > war disappear from deploy directory, the war is the new one in
> > webapps directory but the application directory is the old one. What
> > happens ? Is there anything that tells that the application is
> > already deployed in the database ?
> > 
> Yes, I know about that and will be working on a fix soon.
> In the meantime, recommend these steps:
> 
> 1. deploy as usual to tomcat instance #1
> 2. copy the expanded portlet app from tomcat #1 to tomcat #2's webapps 
> directory
> 
> In this case, the second webapp will not re-register
> 
Is there any possibility to change information in database to force the deployement ? What are the data used to know if deployement is needed ?
I'm not sure to be able to copy only the webapps directory, our deployement script (from development environment to production) is not made to allow that.

Audrey Morelle

 		
---------------------------------
 Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.

RE : Re: Portlet Application not available

Posted by Audrey MORELLE <au...@yahoo.fr>.
Aaron Evans <aa...@gmail.com> a écrit :
> On 1/2/07, David Sean Taylor wrote:
> > Audrey MORELLE wrote:
> > > Hello,
> > >
> > > I have two problems that I don't understand.
> > >
> > > The first :
> > >
> > > Sometimes I deploy my portlet application (which is already deployed
> > > and working before) and I get this error : Portlet Application X not
> > > available But the thing that looks strange to me is that I have
> > > sometimes 1 or 2 portlets of the page which are working not the
> > > others, how is it possible if they come from the application which is
> > > said as not available ?!
> > >
> > > I'm note sure if my english is clear, so to recapitulate. (With
> > > fictitious names) I have 2 portlets P1 and P2 in the application
> > > portlet AP. I already deployed this AP and my two portlets are
> > > working on my page, everything is ok. Then I put my new version of
> > > AP.war in deploy directory and it is correctly (log are ok like other
> > > times) and fully deployed (I checked all files in the
> > > webapps/AP/WEB-INF directory). I refresh my page containing my two
> > > portlets and there, only P1 works, P2 shows "Portlet Application AP
> > > not available". In the console, I only have my trace of P1 and
> > > nothing about P2, not even an error. If I try to deploy another time,
> > > It's the same problème P1 is ok, P2 doesn't work. The only thing to
> > > do is to restart...
> > >
> > > I don't know what is the problem...
> >
> > I haven't seen that one either. Usually when there is a failure, its on
> > the entire portlet application, not just one of the portlets, and not
> > the other ones. This kind of problem is usually because of jar locking
> > on Windows, but that doesn't sound like the case here
> >
> > Perhaps a review of the Jetspeed and Tomcat log files might uncover a
> > clue...
> > >
> 
> I have seen this issue. Audrey, which version of jetspeed are you on?
> 2.0 I suspect...
> 
> This happens to me when we re-deploy an app where there is a change to
> the portlet.xml file. Most of the time, all portlets in that web app
> are "hosed" (technical term meaning non-functional) until we restart
> jetspeed/tomcat but sometimes one or two of the portlets in that app
> continue to function. Not sure why.
> 
> But in 2.0, if you make changes to portlet.xml, you have to restart
> and that fixes it. I believe this is fixed in 2.1.
> 
> -aaron
  I'm using the version with installer so 2.0.
Jetspeed and Tomcat log files don't show anything interesting.
  I will then restart jetspeed when needed.
  
David Sean Taylor <da...@bluesunrise.com> a écrit : 
> > Second problem :
> > 
> > We have 2 tomcat with jetspeed but only 1 database, they are exactly
> > the same. But when I copy my application war in both deploy directory
> > (not at the same moment), only one deploy it correctly, it works
> > fine. The other one seems to deploy, log said it is deployed and the
> > war disappear from deploy directory, the war is the new one in
> > webapps directory but the application directory is the old one. What
> > happens ? Is there anything that tells that the application is
> > already deployed in the database ?
> > 
> Yes, I know about that and will be working on a fix soon.
> In the meantime, recommend these steps:
> 
> 1. deploy as usual to tomcat instance #1
> 2. copy the expanded portlet app from tomcat #1 to tomcat #2's webapps 
> directory
> 
> In this case, the second webapp will not re-register
> 
  Is there any possibility to change information in database to force the deployement ? What are the data used to know if deployement is needed ?
I'm not sure to be able to copy only the webapps directory, our deployement script (from development environment to production) is not made to allow that.
   
  Audrey Morelle


 		
---------------------------------
 Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.

Re: Portlet Application not available

Posted by Aaron Evans <aa...@gmail.com>.
On 1/2/07, David Sean Taylor <da...@bluesunrise.com> wrote:
> Audrey MORELLE wrote:
> > Hello,
> >
> > I have two problems that I don't understand.
> >
> > The first :
> >
> > Sometimes I deploy my portlet application (which is already deployed
> > and working before) and I get this error : Portlet Application X not
> > available But the thing that looks strange to me is that I have
> > sometimes 1 or 2 portlets of the page which are working not the
> > others, how is it possible if they come from the application which is
> > said as not available ?!
> >
> > I'm note sure if my english is clear, so to recapitulate. (With
> > fictitious names) I have 2 portlets P1 and P2 in the application
> > portlet AP. I already deployed this AP and my two portlets are
> > working on my page, everything is ok. Then I put my new version of
> > AP.war in deploy directory and it is correctly (log are ok like other
> > times) and fully deployed (I checked all files in the
> > webapps/AP/WEB-INF directory). I refresh my page containing my two
> > portlets and there, only P1 works, P2 shows "Portlet Application AP
> > not available". In the console, I only have my trace of P1 and
> > nothing about P2, not even an error. If I try to deploy another time,
> > It's the same problème P1 is ok, P2 doesn't work. The only thing to
> > do is to restart...
> >
> > I don't know what is the problem...
>
> I haven't seen that one either. Usually when there is a failure, its on
> the entire portlet application, not just one of the portlets, and not
> the other ones. This kind of problem is usually because of jar locking
> on Windows, but that doesn't sound like the case here
>
> Perhaps a review of the Jetspeed and Tomcat log files might uncover a
> clue...
> >

I have seen this issue.  Audrey, which version of jetspeed are you on?
2.0 I suspect...

This happens to me when we re-deploy an app where there is a change to
the portlet.xml file.  Most of the time, all portlets in that web app
are "hosed" (technical term meaning non-functional) until we restart
jetspeed/tomcat but sometimes one or two of the portlets in that app
continue to function.  Not sure why.

But in 2.0, if you make changes to portlet.xml, you have to restart
and that fixes it.  I believe this is fixed in 2.1.

-aaron

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Portlet Application not available

Posted by David Sean Taylor <da...@bluesunrise.com>.
Audrey MORELLE wrote:
> Hello,
> 
> I have two problems that I don't understand.
> 
> The first :
> 
> Sometimes I deploy my portlet application (which is already deployed
> and working before) and I get this error : Portlet Application X not
> available But the thing that looks strange to me is that I have
> sometimes 1 or 2 portlets of the page which are working not the
> others, how is it possible if they come from the application which is
> said as not available ?!
> 
> I'm note sure if my english is clear, so to recapitulate. (With
> fictitious names) I have 2 portlets P1 and P2 in the application
> portlet AP. I already deployed this AP and my two portlets are
> working on my page, everything is ok. Then I put my new version of
> AP.war in deploy directory and it is correctly (log are ok like other
> times) and fully deployed (I checked all files in the
> webapps/AP/WEB-INF directory). I refresh my page containing my two
> portlets and there, only P1 works, P2 shows "Portlet Application AP
> not available". In the console, I only have my trace of P1 and
> nothing about P2, not even an error. If I try to deploy another time,
> It's the same problème P1 is ok, P2 doesn't work. The only thing to
> do is to restart...
> 
> I don't know what is the problem...

I haven't seen that one either. Usually when there is a failure, its on
the entire portlet application, not just one of the portlets, and not
the other ones. This kind of problem is usually because of jar locking
on Windows, but that doesn't sound like the case here

Perhaps a review of the Jetspeed and Tomcat log files might uncover a
clue...
> 
> Second problem :
> 
> We have 2 tomcat with jetspeed but only 1 database, they are exactly
> the same. But when I copy my application war in both deploy directory
> (not at the same moment), only one deploy it correctly, it works
> fine. The other one seems to deploy, log said it is deployed and the
> war disappear from deploy directory, the war is the new one in
> webapps directory but the application directory is the old one. What
> happens ? Is there anything that tells that the application is
> already deployed in the database ?
> 
Yes, I know about that and will be working on a fix soon.
In the meantime, recommend these steps:

1. deploy as usual to tomcat instance #1
2. copy the expanded portlet app from tomcat #1 to tomcat #2's webapps 
directory

In this case, the second webapp will not re-register

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Portlet Application not available

Posted by Audrey MORELLE <au...@yahoo.fr>.
Hello,
   
  I have two problems that I don't understand.
   
  The first :
   
  Sometimes I deploy my portlet application (which is already deployed and working before) and I get this error : Portlet Application X not available
  But the thing that looks strange to me is that I have sometimes 1 or 2 portlets of the page which are working not the others, how is it possible if they come from the application which is said as not available ?!
   
  I'm note sure if my english is clear, so to recapitulate.
  (With fictitious names) 
  I have 2 portlets P1 and P2 in the application portlet AP. 
  I already deployed this AP and my two portlets are working on my page, everything is ok.
  Then I put my new version of AP.war in deploy directory and it is correctly (log are ok like other times) and fully deployed (I checked all files in the webapps/AP/WEB-INF directory). 
  I refresh my page containing my two portlets and there, only P1 works, P2 shows "Portlet Application AP not available". 
  In the console, I only have my trace of P1 and nothing about P2, not even an error. 
  If I try to deploy another time, It's the same problème P1 is ok, P2 doesn't work. 
  The only thing to do is to restart...
   
  I don't know what is the problem...
   
  Second problem :
   
  We have 2 tomcat with jetspeed but only 1 database, they are exactly the same. But when I copy my application war in both deploy directory (not at the same moment), only one deploy it correctly, it works fine. The other one seems to deploy, log said it is deployed and the war disappear from deploy directory, the war is the new one in webapps directory but the application directory is the old one. What happens ? Is there anything that tells that the application is already deployed in the database ?
   
  Thank you for your future answers.
   
  Audrey Morelle

 		
---------------------------------
 Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.

Re: JSP and Jetspeed

Posted by Aaron Evans <aa...@gmail.com>.
You should check the jetspeed and the tomcat logs and post the error
and the stack trace.

On 12/2/06, hiren <hi...@yahoo.co.in> wrote:
>
> it is still not working.
>
> is my jsp code write ? I not never jsp coding before.
>
>
>
>
> Aaron Evans-2 wrote:
> >
> > Is your JSP under WEB-INF? In that case your jspView init param should
> > have the value of /WEB-INF/jsp/view.jsp.
> >
> >
> >
> > On 12/1/06, hiren <hi...@yahoo.co.in> wrote:
> >>
> >> I trying to use JSP in my portal code. But it is not working.  Below is
> >> my
> >> code. If anyone can go through my code let me where I am going wrong.
> >>
> >> I not worked before with JSP and Portal.
> >>
> >>
> >> DIRECTORY STRUCTURE:
> >>
> >> bookmark  -  WEB-INF - classes  - BookmarkPortlet.class
> >>                                -  portlet.xml
> >>                                  web.xml
> >>
> >>                                   jsp - view.jsp
> >>                                          edit.jsp
> >>
> >>
> >> ---------------------------------------------------------------------------------------------------------------------------------
> >> BookmarkPortlet.java
> >>
> >>
> >> import java.io.IOException;
> >> import java.io.Writer;
> >> import javax.portlet.*;
> >> import javax.portlet.GenericPortlet;
> >> import javax.portlet.PortletException;
> >> import javax.portlet.PortletRequestDispatcher;
> >> import javax.portlet.RenderRequest;
> >> import javax.portlet.RenderResponse;
> >>
> >>
> >>
> >> public class BookmarkPortlet extends javax.portlet.GenericPortlet
> >> {
> >>         public void doEdit(RenderRequest request,RenderResponse response)
> >>                 throws PortletException, IOException
> >>         {
> >>                 response.setContentType("text/html");
> >>                 String jspName =
> >> getPortletConfig().getInitParameter("jspEdit");
> >>
> >>                 PortletURL addUrl = response.createActionURL();
> >>                 addUrl.setPortletMode(PortletMode.VIEW);
> >>                 addUrl.setParameter("add","add");
> >>                 request.setAttribute("addUrl",addUrl.toString());
> >>                 PortletURL cancelUrl = response.createRenderURL();
> >>                 cancelUrl.setPortletMode(PortletMode.VIEW);
> >>                 request.setAttribute("cancelUrl",cancelUrl.toString());
> >>                 PortletRequestDispatcher rd =
> >>
> >> getPortletContext().getRequestDispatcher(jspName);
> >>                 rd.include(request,response);
> >>
> >>         }
> >>
> >>
> >>         public void doView(javax.portlet.RenderRequest request,
> >> javax.portlet.RenderResponse response)
> >>                 throws javax.portlet.PortletException,
> >> java.io.IOException
> >>         {
> >>                 response.setContentType("text/html");
> >>                 String jspName =
> >> getPortletConfig().getInitParameter("jspView");
> >>
> >>                 PortletRequestDispatcher rd =
> >>
> >> getPortletContext().getRequestDispatcher(jspName);
> >>                 rd.include(request,response);
> >>         }
> >>
> >>
> >>         public void processAction(ActionRequest actionrequest,
> >> ActionResponse
> >> actionresponse)
> >>                 throws PortletException, IOException
> >>         {
> >>                 String removeName = actionrequest.getParameter("remove");
> >>
> >>                 if(removeName != null)
> >>                 {
> >>                         PortletPreferences prefs =
> >> actionrequest.getPreferences();
> >>                         prefs.reset(removeName);
> >>                         prefs.store();
> >>                 }
> >>
> >>                 String add = actionrequest.getParameter("add");
> >>                 if(add !=null)
> >>                 {
> >>                         PortletPreferences prefs =
> >> actionrequest.getPreferences();
> >>
> >> prefs.setValue(actionrequest.getParameter("name"),
> >>                                 actionrequest.getParameter("value"));
> >>                         prefs.store();
> >>                 }
> >>
> >>
> >>         }
> >> }
> >>
> >> ---------------------------------------------------------------------------------------------------------------------------------
> >>
> >>
> >> ---------------------------------------------------------------------------------------------------------------------------------
> >> view.jsp
> >>
> >>
> >> <%@ page session="false" %>
> >> <%@ page import="javax.portlet.*"%>
> >> <%@ page import="java.util.*"%>
> >> <%@ taglib uri='http://java.sun.com/portlet'
> >> prefix='portlet' %>
> >> <portlet:defineObjects/>
> >> <%
> >> ResourceBundle myText =
> >> portletConfig.getResourceBundle(request.getLocale());
> >> %>
> >> <%=myText.getString("available_bookmarks")%><br>
> >> <%
> >> PortletPreferences prefs = renderRequest.getPreferences();
> >>
> >> Enumeration e = prefs.getNames();
> >> if (!e.hasMoreElements())
> >> {
> >> %>
> >> <%=myText.getString("no_bookmarks")%><BR>
> >> <%
> >> }
> >>
> >> while (e.hasMoreElements())
> >> {
> >> String name = (String)e.nextElement();
> >> String value = prefs.getValue
> >> (name,"<"+
> >> myText.getString("undefined")+">");
> >> %>
> >> <%=value% ><%=name%> <BR>
> >>
> >> <%
> >> }
> >> %>
> >>
> >>
> >> ---------------------------------------------------------------------------------------------------------------------------------
> >>
> >> ---------------------------------------------------------------------------------------------------------------------------------
> >> edit.jsp
> >>
> >>
> >>
> >> <%@ 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());
> >> %>
> >> <%=myText.getString("available_bookmarks")%><br>
> >>
> >> <FORM ACTION="<%=addUrl%>" METHOD="POST">
> >> <TABLE CELLPADDING=0 CELLSPACING=4>
> >> <TR>
> >> <TD>
> >> <%=myText.getString("name")%>
> >> </TD>
> >> <TD>
> >> <%=myText.getString("url")%>
> >> </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>
> >> "<%=removeUrl.toString()% ">
> >> [<%=myText.getString("delete")%>]
> >>
> >> </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>
> >>
> >> ---------------------------------------------------------------------------------------------------------------------------------
> >>
> >>
> >> ---------------------------------------------------------------------------------------------------------------------------------
> >> portlet.xml
> >>
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <portlet-app id="bookmark" version="1.0">
> >>   <portlet id="Bookmark">
> >>     <portlet-name>Bookmark</portlet-name>
> >>     <display-name>Bookmark Portlet</display-name>
> >>     <portlet-class>BookmarkPortlet</portlet-class>
> >> <init-param>
> >> <name>jspView</name>
> >> <value>/jsp/view.jsp</value>
> >> </init-param>
> >> <init-param>
> >> <name>jspEdit</name>
> >> <value>/jsp/edit.jsp</value>
> >> </init-param>
> >>
> >>
> >>     <supports>
> >>       <mime-type>text/html</mime-type>
> >>       <portlet-mode>VIEW</portlet-mode>
> >>       <portlet-mode>EDIT</portlet-mode>
> >>     </supports>
> >>     <supported-locale>en</supported-locale>
> >>     <portlet-info>
> >>       <title>Bookmark</title>
> >>       <short-title>List of URLs</short-title>
> >>     </portlet-info>
> >>   </portlet>
> >> </portlet-app>
> >>
> >> ---------------------------------------------------------------------------------------------------------------------------------
> >>
> >>
> >> ---------------------------------------------------------------------------------------------------------------------------------
> >> web.xml
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
> >> 2.3//EN"
> >>                          "http://java.sun.com/dtd/web-app_2_3.dtd">
> >> <web-app>
> >>   <display-name>Bookmark Portlet</display-name>
> >>   <description>Bookmark Application for maintaining list of
> >> URLs</description>
> >> </web-app>
> >>
> >>
> >> ---------------------------------------------------------------------------------------------------------------------------------
> >>
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/JSP-and-Jetspeed-tf2741960.html#a7650317
> >> Sent from the Jetspeed - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> >> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/JSP-and-Jetspeed-tf2741960.html#a7653394
> Sent from the Jetspeed - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: JSP and Jetspeed

Posted by hiren <hi...@yahoo.co.in>.
it is still not working.

is my jsp code write ? I not never jsp coding before.




Aaron Evans-2 wrote:
> 
> Is your JSP under WEB-INF? In that case your jspView init param should
> have the value of /WEB-INF/jsp/view.jsp.
> 
> 
> 
> On 12/1/06, hiren <hi...@yahoo.co.in> wrote:
>>
>> I trying to use JSP in my portal code. But it is not working.  Below is
>> my
>> code. If anyone can go through my code let me where I am going wrong.
>>
>> I not worked before with JSP and Portal.
>>
>>
>> DIRECTORY STRUCTURE:
>>
>> bookmark  -  WEB-INF - classes  - BookmarkPortlet.class
>>                                -  portlet.xml
>>                                  web.xml
>>
>>                                   jsp - view.jsp
>>                                          edit.jsp
>>
>>
>> ---------------------------------------------------------------------------------------------------------------------------------
>> BookmarkPortlet.java
>>
>>
>> import java.io.IOException;
>> import java.io.Writer;
>> import javax.portlet.*;
>> import javax.portlet.GenericPortlet;
>> import javax.portlet.PortletException;
>> import javax.portlet.PortletRequestDispatcher;
>> import javax.portlet.RenderRequest;
>> import javax.portlet.RenderResponse;
>>
>>
>>
>> public class BookmarkPortlet extends javax.portlet.GenericPortlet
>> {
>>         public void doEdit(RenderRequest request,RenderResponse response)
>>                 throws PortletException, IOException
>>         {
>>                 response.setContentType("text/html");
>>                 String jspName =
>> getPortletConfig().getInitParameter("jspEdit");
>>
>>                 PortletURL addUrl = response.createActionURL();
>>                 addUrl.setPortletMode(PortletMode.VIEW);
>>                 addUrl.setParameter("add","add");
>>                 request.setAttribute("addUrl",addUrl.toString());
>>                 PortletURL cancelUrl = response.createRenderURL();
>>                 cancelUrl.setPortletMode(PortletMode.VIEW);
>>                 request.setAttribute("cancelUrl",cancelUrl.toString());
>>                 PortletRequestDispatcher rd =
>>                        
>> getPortletContext().getRequestDispatcher(jspName);
>>                 rd.include(request,response);
>>
>>         }
>>
>>
>>         public void doView(javax.portlet.RenderRequest request,
>> javax.portlet.RenderResponse response)
>>                 throws javax.portlet.PortletException,
>> java.io.IOException
>>         {
>>                 response.setContentType("text/html");
>>                 String jspName =
>> getPortletConfig().getInitParameter("jspView");
>>
>>                 PortletRequestDispatcher rd =
>>                        
>> getPortletContext().getRequestDispatcher(jspName);
>>                 rd.include(request,response);
>>         }
>>
>>
>>         public void processAction(ActionRequest actionrequest,
>> ActionResponse
>> actionresponse)
>>                 throws PortletException, IOException
>>         {
>>                 String removeName = actionrequest.getParameter("remove");
>>
>>                 if(removeName != null)
>>                 {
>>                         PortletPreferences prefs =
>> actionrequest.getPreferences();
>>                         prefs.reset(removeName);
>>                         prefs.store();
>>                 }
>>
>>                 String add = actionrequest.getParameter("add");
>>                 if(add !=null)
>>                 {
>>                         PortletPreferences prefs =
>> actionrequest.getPreferences();
>>                        
>> prefs.setValue(actionrequest.getParameter("name"),
>>                                 actionrequest.getParameter("value"));
>>                         prefs.store();
>>                 }
>>
>>
>>         }
>> }
>>
>> ---------------------------------------------------------------------------------------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------------------------------------------------------------------
>> view.jsp
>>
>>
>> <%@ page session="false" %>
>> <%@ page import="javax.portlet.*"%>
>> <%@ page import="java.util.*"%>
>> <%@ taglib uri='http://java.sun.com/portlet'
>> prefix='portlet' %>
>> <portlet:defineObjects/>
>> <%
>> ResourceBundle myText =
>> portletConfig.getResourceBundle(request.getLocale());
>> %>
>> <%=myText.getString("available_bookmarks")%><br>
>> <%
>> PortletPreferences prefs = renderRequest.getPreferences();
>>
>> Enumeration e = prefs.getNames();
>> if (!e.hasMoreElements())
>> {
>> %>
>> <%=myText.getString("no_bookmarks")%><BR>
>> <%
>> }
>>
>> while (e.hasMoreElements())
>> {
>> String name = (String)e.nextElement();
>> String value = prefs.getValue
>> (name,"<"+
>> myText.getString("undefined")+">");
>> %>
>> <%=value% ><%=name%> <BR>
>>
>> <%
>> }
>> %>
>>
>>
>> ---------------------------------------------------------------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------------------------------------------------------------------
>> edit.jsp
>>
>>
>>
>> <%@ 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());
>> %>
>> <%=myText.getString("available_bookmarks")%><br>
>>
>> <FORM ACTION="<%=addUrl%>" METHOD="POST">
>> <TABLE CELLPADDING=0 CELLSPACING=4>
>> <TR>
>> <TD>
>> <%=myText.getString("name")%>
>> </TD>
>> <TD>
>> <%=myText.getString("url")%>
>> </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>
>> "<%=removeUrl.toString()% ">
>> [<%=myText.getString("delete")%>]
>>
>> </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>
>>
>> ---------------------------------------------------------------------------------------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------------------------------------------------------------------
>> portlet.xml
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <portlet-app id="bookmark" version="1.0">
>>   <portlet id="Bookmark">
>>     <portlet-name>Bookmark</portlet-name>
>>     <display-name>Bookmark Portlet</display-name>
>>     <portlet-class>BookmarkPortlet</portlet-class>
>> <init-param>
>> <name>jspView</name>
>> <value>/jsp/view.jsp</value>
>> </init-param>
>> <init-param>
>> <name>jspEdit</name>
>> <value>/jsp/edit.jsp</value>
>> </init-param>
>>
>>
>>     <supports>
>>       <mime-type>text/html</mime-type>
>>       <portlet-mode>VIEW</portlet-mode>
>>       <portlet-mode>EDIT</portlet-mode>
>>     </supports>
>>     <supported-locale>en</supported-locale>
>>     <portlet-info>
>>       <title>Bookmark</title>
>>       <short-title>List of URLs</short-title>
>>     </portlet-info>
>>   </portlet>
>> </portlet-app>
>>
>> ---------------------------------------------------------------------------------------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------------------------------------------------------------------
>> web.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
>> 2.3//EN"
>>                          "http://java.sun.com/dtd/web-app_2_3.dtd">
>> <web-app>
>>   <display-name>Bookmark Portlet</display-name>
>>   <description>Bookmark Application for maintaining list of
>> URLs</description>
>> </web-app>
>>
>>
>> ---------------------------------------------------------------------------------------------------------------------------------
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/JSP-and-Jetspeed-tf2741960.html#a7650317
>> Sent from the Jetspeed - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/JSP-and-Jetspeed-tf2741960.html#a7653394
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: JSP and Jetspeed

Posted by Aaron Evans <aa...@gmail.com>.
Is your JSP under WEB-INF? In that case your jspView init param should
have the value of /WEB-INF/jsp/view.jsp.



On 12/1/06, hiren <hi...@yahoo.co.in> wrote:
>
> I trying to use JSP in my portal code. But it is not working.  Below is my
> code. If anyone can go through my code let me where I am going wrong.
>
> I not worked before with JSP and Portal.
>
>
> DIRECTORY STRUCTURE:
>
> bookmark  -  WEB-INF - classes  - BookmarkPortlet.class
>                                -  portlet.xml
>                                  web.xml
>
>                                   jsp - view.jsp
>                                          edit.jsp
>
>
> ---------------------------------------------------------------------------------------------------------------------------------
> BookmarkPortlet.java
>
>
> import java.io.IOException;
> import java.io.Writer;
> import javax.portlet.*;
> import javax.portlet.GenericPortlet;
> import javax.portlet.PortletException;
> import javax.portlet.PortletRequestDispatcher;
> import javax.portlet.RenderRequest;
> import javax.portlet.RenderResponse;
>
>
>
> public class BookmarkPortlet extends javax.portlet.GenericPortlet
> {
>         public void doEdit(RenderRequest request,RenderResponse response)
>                 throws PortletException, IOException
>         {
>                 response.setContentType("text/html");
>                 String jspName = getPortletConfig().getInitParameter("jspEdit");
>
>                 PortletURL addUrl = response.createActionURL();
>                 addUrl.setPortletMode(PortletMode.VIEW);
>                 addUrl.setParameter("add","add");
>                 request.setAttribute("addUrl",addUrl.toString());
>                 PortletURL cancelUrl = response.createRenderURL();
>                 cancelUrl.setPortletMode(PortletMode.VIEW);
>                 request.setAttribute("cancelUrl",cancelUrl.toString());
>                 PortletRequestDispatcher rd =
>                         getPortletContext().getRequestDispatcher(jspName);
>                 rd.include(request,response);
>
>         }
>
>
>         public void doView(javax.portlet.RenderRequest request,
> javax.portlet.RenderResponse response)
>                 throws javax.portlet.PortletException, java.io.IOException
>         {
>                 response.setContentType("text/html");
>                 String jspName = getPortletConfig().getInitParameter("jspView");
>
>                 PortletRequestDispatcher rd =
>                         getPortletContext().getRequestDispatcher(jspName);
>                 rd.include(request,response);
>         }
>
>
>         public void processAction(ActionRequest actionrequest, ActionResponse
> actionresponse)
>                 throws PortletException, IOException
>         {
>                 String removeName = actionrequest.getParameter("remove");
>
>                 if(removeName != null)
>                 {
>                         PortletPreferences prefs = actionrequest.getPreferences();
>                         prefs.reset(removeName);
>                         prefs.store();
>                 }
>
>                 String add = actionrequest.getParameter("add");
>                 if(add !=null)
>                 {
>                         PortletPreferences prefs = actionrequest.getPreferences();
>                         prefs.setValue(actionrequest.getParameter("name"),
>                                 actionrequest.getParameter("value"));
>                         prefs.store();
>                 }
>
>
>         }
> }
>
> ---------------------------------------------------------------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------------------------------------------------------------------
> view.jsp
>
>
> <%@ page session="false" %>
> <%@ page import="javax.portlet.*"%>
> <%@ page import="java.util.*"%>
> <%@ taglib uri='http://java.sun.com/portlet'
> prefix='portlet' %>
> <portlet:defineObjects/>
> <%
> ResourceBundle myText =
> portletConfig.getResourceBundle(request.getLocale());
> %>
> <%=myText.getString("available_bookmarks")%><br>
> <%
> PortletPreferences prefs = renderRequest.getPreferences();
>
> Enumeration e = prefs.getNames();
> if (!e.hasMoreElements())
> {
> %>
> <%=myText.getString("no_bookmarks")%><BR>
> <%
> }
>
> while (e.hasMoreElements())
> {
> String name = (String)e.nextElement();
> String value = prefs.getValue
> (name,"<"+
> myText.getString("undefined")+">");
> %>
> <%=value% ><%=name%> <BR>
>
> <%
> }
> %>
>
>
> ---------------------------------------------------------------------------------------------------------------------------------
>
> ---------------------------------------------------------------------------------------------------------------------------------
> edit.jsp
>
>
>
> <%@ 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());
> %>
> <%=myText.getString("available_bookmarks")%><br>
>
> <FORM ACTION="<%=addUrl%>" METHOD="POST">
> <TABLE CELLPADDING=0 CELLSPACING=4>
> <TR>
> <TD>
> <%=myText.getString("name")%>
> </TD>
> <TD>
> <%=myText.getString("url")%>
> </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>
> "<%=removeUrl.toString()% ">
> [<%=myText.getString("delete")%>]
>
> </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>
>
> ---------------------------------------------------------------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------------------------------------------------------------------
> portlet.xml
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <portlet-app id="bookmark" version="1.0">
>   <portlet id="Bookmark">
>     <portlet-name>Bookmark</portlet-name>
>     <display-name>Bookmark Portlet</display-name>
>     <portlet-class>BookmarkPortlet</portlet-class>
> <init-param>
> <name>jspView</name>
> <value>/jsp/view.jsp</value>
> </init-param>
> <init-param>
> <name>jspEdit</name>
> <value>/jsp/edit.jsp</value>
> </init-param>
>
>
>     <supports>
>       <mime-type>text/html</mime-type>
>       <portlet-mode>VIEW</portlet-mode>
>       <portlet-mode>EDIT</portlet-mode>
>     </supports>
>     <supported-locale>en</supported-locale>
>     <portlet-info>
>       <title>Bookmark</title>
>       <short-title>List of URLs</short-title>
>     </portlet-info>
>   </portlet>
> </portlet-app>
>
> ---------------------------------------------------------------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------------------------------------------------------------------
> web.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
> 2.3//EN"
>                          "http://java.sun.com/dtd/web-app_2_3.dtd">
> <web-app>
>   <display-name>Bookmark Portlet</display-name>
>   <description>Bookmark Application for maintaining list of
> URLs</description>
> </web-app>
>
>
> ---------------------------------------------------------------------------------------------------------------------------------
>
>
> --
> View this message in context: http://www.nabble.com/JSP-and-Jetspeed-tf2741960.html#a7650317
> Sent from the Jetspeed - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org