I suspect that

<c:out value="plantName: ${plant.plantName}"/>

is looking for the session attribute via the HTTPServletRequest object
rather than the Portlet's RenderRequest object.

Perhaps there is an equivalent portlet tag.

Personally (and call me old-school) I got sick of having to use tonnes
of nested, complicated tags to do the simplest of things a long time
ago so I just use scriplets. ;-)

Use this and you'll be all set (although you'll have to do a page
import of the Plant class):

<%= ((Plant) 
renderRequest.getPortletSession().getAttribute("plant")).getPlantName()
%>

-aaron

On 1/25/07, Michael Binette <[EMAIL PROTECTED]> wrote:
I have a portlet that is derived from GenericPortlet.  In the
processAction class I have the following code:

plant = new Plant();
plant.setPlantName("My Plant");
request.getPortletSession ().setAttribute("plant", plant,
PortletSession.PORTLET_SCOPE);


I also have a doView that simply returns the proper JSP file.  I also
put a log message in there to make sure that the attribute "plant"
existed and it does.

In the JSP I have the following:

<[EMAIL PROTECTED] contentType="text/html"%>
<[EMAIL PROTECTED] pageEncoding="UTF-8"%>
<%@ page import="javax.portlet.* "%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core
<http://java.sun.com/jsp/jstl/core>" prefix="c"%>
<%@ taglib uri="http://java.sun.com/portlet
<http://java.sun.com/portlet>" prefix="portlet"%>

<portlet:defineObjects />

<c:out value="plantName: ${plant.plantName}"/>

<form method="post" action="<portlet:actionURL/>" portletMode="view">
    Plant Name: <input type="text" name="plantName"
value="${plant.plantName}" />
    <input type="submit" name="savePlant" value="Save"/>
    <input type="submit" name="cancelEditPlant" value="Cancel"/>
</form>

The ${plant.plantName} does not work.  But if I change my processAction
method to put plant in APPLICATION_SCOPE, it works.  Am I missing
something here?

--
Thanks,
Michael Binette


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



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

Reply via email to