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 Floßmann Christoph <Ch...@volke-muc.de> on 2004/06/23 08:41:14 UTC

RE: ***SPAM*** Simple Action in jsp (full code in mail)

Well, what a pitty! I finally found out what was wrong. My java class was in the wrong directory.
For some reasons they are found and the buildNormalContent method is executed when the java file is in
src/java/de/volke/jetspeed/modules/actions
but self defined actions are only available in
src/java/de/volke/jetspeed/modules/actions/portlets!!!!!!
Hope any one else can profit of my experience.
Chris

-----Original Message-----
From: Floßmann Christoph 
Sent: Tuesday, June 22, 2004 10:55 AM
To: Jetspeed Users List (E-Mail)
Subject: ***SPAM*** Simple Action in jsp (full code in mail)


Hello jetspeed users,

after my troubles with my ShoutBox Portlet I tried to reduce my code to a minimum.
Maybe someone tries it and tells me what's wrong.

=========================
Entry in portlets.xreg
=========================
	<portlet-entry name="ActionTest" hidden="false" type="ref" parent="JSP" application="false">
	    <meta-info>
        	<title>Action</title>
        	<description>Simple Test</description>
    	</meta-info>
	    <parameter name="template" value="Actiontest.jsp" hidden="false"/>
        <parameter name="action" value="ActionTest" hidden="true" cachedOnName="true" cachedOnValue="true"/>
    	<media-type ref="html"/>
	</portlet-entry>
=========================
The java source (be sure to put it in src/java/de/volke/jetspeed/modules/actions
=========================
package de.volke.jetspeed.modules.actions;

import org.apache.jetspeed.modules.actions.portlets.JspPortletAction;
import org.apache.jetspeed.portal.Portlet;
import org.apache.turbine.util.RunData;

public class ActionTest  extends JspPortletAction {

    protected void buildNormalContext(Portlet portlet, RunData rundata) throws Exception {
          System.out.println("Built ActionTest Portlet!");
    }

    public void doSomething(){
          System.out.println("Action!!!!");
    }
}
=========================
The jsp page in WEB-INF/templates/jsp/portlets/html
=========================
<%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld' prefix='jetspeed' %>
<jsp:useBean id="action" class="de.volke.jetspeed.modules.actions.ActionTest" scope="request" />

<%
    String jspeid = (String) request.getAttribute("js_peid");
%>

<form method="POST" action="<jetspeed:dynamicUri/>">
<INPUT TYPE="hidden" NAME="js_peid" VALUE="<%=jspeid%>">
<INPUT TYPE="SUBMIT" NAME="eventSubmit_doSomething" VALUE="Ok" style="width:60">
</form>


=========================
Now the message in the buildNormalContext method is displayed in the tomcat shell. But the doSomething method isn't working.

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


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