Andy,
Once again, the JSP support in Jetspeed is a little behind. In the recent
months, I attempted to enhance this support including the issues you are
inquiring about. Please note that JspPortletAction functionality that I'm
referring to has been added in version 1.4b2-dev (CVS head) so you won't
find it in the 1.4b1 release.
I think that a good example of interactive JSP based portlet is long
overdue. Providing such example is on my list of things to do after the new
Jetspeed release. In the meantime, let me try to answer some of your
questions:
>
> After seeing a couple threads on the subject I decided I would
> formalize the
> issue. It sounds as though I am not the only one who can't get a jsp
> portlet to behave as expected when dealing with forms. Simply put, all I
> want to do is have a jsp in a portlet that has a form. There are a few
> requirements:
>
> -When I click on the submit button I shouldn't post everything
> back to the
> server, only the information in my portlet, or at least the only
> thing that
> should fire on the server is something that I want.
>
> -The portal should only display a change in that particular pane
> that it is
> displayed in. If 5 portlets are on a page and one of them is mine, then
> only mine should show any change of state if I interact with it
> by pressing
> the submit button.
>
> While getting this to work between a servlet and jsps outside of
> the portal
> is a breeze, I haven't for the life of me got this to work inside
> jetspeed.
>
> Specifically I have the following questions
>
> -What is the action of a form in the included JSP? (Scott Weaver
> was nice
> enough to suggest $jslink.template, but I assume that is some kind of
> velocity paradigm and didn't work for me, resulting in a 404 error.)
>
The form action can be specified as follows:
<FORM METHOD="POST" ACTION="<jetspeed:uriLookup type="Home"/>">
Note the usage of uriLookup tag. You may find other custom tag examples in
the "JSP1_1andJetspeedTagLib" portlet.
> -Are action classes the tool to use to process the input
> parameters posted
> to the server (as if you use the jsp portlet you can't get at the jsp
> portlet code)? I assume that the action class would model that
> of a servlet
> outside of jetspeed.
You are correct. I assume that your action extends JspPortletAction.
>
> To register an action class with jetspeed, if I have a class
> called called
> com.mycompany.portal.actions.MyActionClass with a method called
> "doNext()",
> would I put
>
> module.properties=com.mycompany.portal
>
> in the TurbineResources.properties file
It would be best to follow the Turbine package naming conventions and put
your action in the following package: com.mycompany.modules.actions. Then
the entry in TurbineResources.properties would be:
module.packages = com.mycompany.modules
>
> and then in the portlet's xreg file put
>
> <parameter name="action" value="actions.MyActionClass" hidden="false"
> cachedOnName="true" cachedOnValue="true"/>
Following my recommendation for package naming conventions, the value of
action parameter would be "MyActionClass".
>
> And in the jsp, for the button would I put
>
> <input type="submit" name="eventSubmit_doNext" value="Next >>">
>
That's correct. You should also add the following hidden field on your form:
<INPUT TYPE="hidden" NAME="js_peid" VALUE="<%=jspeid%>">
Retrieve the value of "jspeid" using the followng scriplet:
String jspeid = (String) request.getAttribute("js_peid");
The addition of this field will ensure that when your form is submitted,
only the action for the portlet identified by "js_peid" is processed. This
is especially important if you have multiple instances of the same JSP
portlet on your page. If actions for other portlets on the same page are
fired, that usually means that these portlets are now written to support
this model (i.e. they don't include the "js_peid" field in their form).
> And then for the form's action I would put what?
>
> If someone can assist and can get me a working example I would be
> more than
> happy to make a doc of exactly how to do this so that we don't
> have to keep
> posting the same question to the newsgroup. Thanks in advance.
>
I hope that his helps.
Best regards,
Mark C. Orciuch
Next Generation Solutions, Ltd.
e-Mail: [EMAIL PROTECTED]
web: http://www.ngsltd.com
--
To unsubscribe, e-mail: <mailto:jetspeed-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-user-help@;jakarta.apache.org>