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 Gence Soysal <Ge...@syntegra.com> on 2003/04/23 08:01:37 UTC

setTemplate in VelocityPortletAction problem

Hi all,

I've got a VelocityPortlet that is tied to a velocity template and a 
VelocityPortletAction (via the portlets.xreg file). The portlet contains a form.
The submit button is tied to the doUpdate() method in the action class. I have
been unable to do the following:

1. Forward the user to a "success" screen if the form submission was valid. I
tried using setTemplate(rundata, "success.vm") but I get an 
InvocationTargetException caused by a NullPointer on the setTemplate line.

2. Pass the values from the form back into the .vm if the form submission was NOT
valid (so that everything is filled out for the user to just simply correct 
his/her mistakes). Neither of these seem to work:

	rundata.getUser().setTemp("myuser", myuser);
      context.put("myuser", myuser);

(where myuser is a bean class that contains all the form info, and
"myuser" is the identifier for the .vm file). Shouldn't I be just able to say

	<input type="text" name="FirstName" value="$!myuser.FirstName">

in my .vm file?

I have no problem retrieving the data.getMessage() value.

Thanks in advance,

Gence

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