For Programmers: Free Programming Magazines  


Home > Archive > Java Beans > March 2004 > struts: scaffold- error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author struts: scaffold- error
marcelino

2004-03-29, 12:33 pm

Hi,

I try to address more then one action with one form. Actually I'm
using the 'scaffold.http.RelayAction' class. I have both jars strus
and commons- scaffold in my WEB-INF- lib- folder.

This is the error I get trying to submit:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
--and so on-- at the end:

Caused by: java.lang.NullPointerException
at mdpro.prototyp.form.ProtokollBearbeitenForm. setProtokoll_thema(ProtokollBearbeitenFo
rm.java:128)
... 45 more
--------------------------------------------------------------------------

The submits and form in my jsp:

<html:form action="/protokollBearbeitenFind" focus="protokoll_thema">
<INPUT TYPE="hidden" NAME="dispatch" VALUE="error" >
<td class="tdButton">
<html:submit onclick="set('speichern');" >Speichern</html:submit>
<html:submit onclick="set('neu');" >Neu/html:submit>
</td>
</html:form>
--------------------------------------------------------------------------
The javascript- method set:

function set(target)
{
document.forms[0].dispatch.value=target;
}

-----------------------------------------------------------------------------
The action- mapping in struts-config:

<action path="/protokollBearbeitenFind"
type="org.apache.scaffold.http.RelayAction"
name="protokollBearbeitenForm"
scope="request"
validate="false">
<forward name="speichern" path="/protokollSpeichern"/>
<forward name="neu" path="/protokollNeu"/>
</action>
----------------------------------------------------------------------------
I think the execute-method is implemented in the RelayAction with the
line:

return (mapping.findForward(request.getParameter(Tokens.DISPATCH)));

--------------------------------------------------------------------------

I guessI miss a detail, but till jet I couldn't figure out what.

If you can help me I would appreciate

marcelino
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com