Hi all,

after successfully working with jetspeed 1.5 and implementing some static 
portlets, I want to go a step further and create dynamic portlets with forms.
Unfortunately I have a problem, I cannot understand and solve, because I think 
I already elimitated the mistakes. Still it does not work.

My understanding regarding parameters/forms is:
- they are primarily used to pass data/information from a portlet to another 
portlet or to the portlet itself. I can achieve this by registering parameters 
in the portlet registry entry or do it dynamically in the code(? I am not sure 
on this one). I get and set parameters using the "rundata".
- Processing forms' data/information is done with the action.class for the 
specific portlet, which is declared under the portlet registry 
entry "<parameter action="XYZaction.class"/>". The action specific method in 
this class is invoked by declaring it in the form's INPUT(submit-button), e.g. 
<FORM>
  <INPUT TYPE="SUBMIT" NAME="eventSubmit_dorefresh" VALUE="Refresh" >
</FORM>

The problem is:
I cannot get
a) the parameter value of the portlet
b) the submitted form values of the portlet.

Why am I wrong? I mean, which important point am I missing?
I can get to see all attributes of the portlet, like JSPID, SSL Session, and 
so on, but not the one I defined!!

The do refresh code looks like this:
public void doRefresh(RunData rundata, Portlet portlet)
{
  String temp = "";
  temp = rundata.getParameters().getString("sql");
  PortletSessionState.setAttribute(portlet, rundata, "sql", temp);
}
"sql" is a parameter I defined in the portlet:
<parameter name="sql" value="select * from test" hidden="false" 
cachedOnName="true" cachedOnValue="true">
  <security-ref parent="admin-only"/>
  <meta-info>
    <title>SQL Query</title>
    <description>A descr.</description>
  </meta-info>
</parameter>

I want to access it in the template.jsp:
if(rundata == null)
  out.write("No Data to run!");
else
{
  for (Enumeration e = request.getAttributeNames(); e.hasMoreElements();)
  {
    out.write(e.nextElement().toString() + " <br>");
  }
  out.write("---------------- <br>");
  out.write("SSL Session: " + (String) 
request.getAttribute "javax.servlet.request.ssl_session") + "<br>");
  out.write("PEID: " + (String) request.getAttribute("js_peid") + "<br>");
  out.write("TEMPLATE: " + (String) request.getAttribute("template") + "<br>");
  out.write("SQL: " + (String) request.getAttribute("sql") + "<br>");
}

The last out.write results in "Null" and I don't have any idea.

Any help appreciated and more than welcome :o)

Ciao,
  Tommaso


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

Reply via email to