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 "Chamberlain James O. CONTR J9C998" <Ja...@je.jfcom.mil> on 2003/05/21 16:56:30 UTC

Newbie question about JSP portlets and forms

I have a JSP portlet (page1.jsp) that has a form and I would like it to
submit that form to another portlet(page2.jsp). The second portlet would
ideally pull the parameters that it needs from the request and display
the results. This is a very simplistic design with all the code in the
two JSPs. I cannot get this to work properly. I have tried setting the
action attribute of the form to a jetspeed:portletlink and
jetspeed:forward, neither allows the parameters to be passed.

How should this work?

This is a very simple application.

My portlet code is listed below:

page1.jsp:
<%@ page language="java" session='true' %>
<%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld'
prefix='jetspeed' %>

Here is the portlet test:
<hr>
<form method='post' action='<jetspeed:portletlink name="Page2"
action="controls.Maximize" />' >
<table border='0' cellspacing='1' cellpadding='3'>
<tr>
	<td>First name:</td>
	<td><input type='text' name='fname' value='<jetspeed:info
requestedInfo="FirstName" />'></td>
</tr>
<tr>
	<td>Last name:</td>
	<td><input type='text' name='lname' value='<jetspeed:info
requestedInfo="LastName" />'></td>
</tr>
<tr>
	<td>Email:</td>
	<td><input type='text' name='email' value='<jetspeed:info
requestedInfo="Email" />'></td>
</tr>
<tr>
	<td align='left'><input type='reset' name='reset'
value='Reset'></td>
	<td align='right'><input type='submit' name='submit'
value='Submit'></td>
</tr>
</table>
</form>





Page2.jsp:
<%@ page language="java" session='true' %>
<%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld'
prefix='jetspeed' %>

<jsp:useBean id="myBean" scope="session" class="testing.FormBean" />
<jsp:setProperty name="myBean" property="*" />

Here is the completed test form:
<hr>
<table border='0' cellspacing='1' cellpadding='3'>
<tr>
	<td>First name:</td>
	<td><jsp:getProperty name='myBean' property='fname' /></td>
</tr>
<tr>
	<td>Last name:</td>
	<td><jsp:getProperty name='myBean' property='lname' /></td>
</tr>
<tr>
	<td>Email:</td>
	<td><jsp:getProperty name='myBean' property='email' /></td>
</tr>
</table>

Any help would be greatly appreciated.

Regards,

James Chamberlain
General Dynamics - Advanced Information Systems
Concept Development Department
U.S. Joint Forces Command
james.chamberlain@je.jfcom.mil

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