On Thu, 20 Jan 2005 18:14:00 -0200, Flávio Maldonado
<[EMAIL PROTECTED]> wrote:
> I'm trying to put a link like this:
> " <html:link page="user.do?action=user.new">New User</html:link> "

It's not user.new, it's whatever user.new resolves to in your properties file.
I usually do something like:
<bean:define id="key">
        <bean:message key="button.show"/>
</bean:define>
<logic:redirect action="/search.do" paramId="action" paramName="key"/>



> 
> So, in my getKeyMethodMap, I did:
> 
> protected Map getKeyMethodMap() {
> Map map = new HashMap();
> map.put("user.new", "newUser");
> return map
> }
> And, my Struts-config.xml is like this:
> 
> <action path="/user" type="com.sednet.sedclin.server.actions.UserAction"
>     name="userForm"
>     scope="session"
>     parameter="action"
>     input="/server/userp1.jsp"
>     validate="false">
>     <forward name="success" path="/server/success.jsp"/>
> </action>
> 
> I have a method, in my LookupDispatchAction class, called:
> 
> public ActionForward newUser(ActionMapping mapping, ActionForm form,
> HttpServletRequest request, HttpServletResponse response){
>     //new user
>     return mapping.findForward('success');
> }
> What can I wait for? I wait that when I click in the Link, the 'action'
> variable receives 'user.new' value and it is mapped into the getKeyMethodMap
> to run the newUser method. But, when I click in the Link, I have this error
> message:
> =================================================
> java.lang.NullPointerException
> java.lang.Class.searchMethods(Class.java:1877)
> java.lang.Class.getMethod0(Class.java:1901)
> java.lang.Class.getMethod(Class.java:984)
> org.apache.struts.actions.DispatchAction.getMethod(DispatchAction.java:332)
> org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:264)
> org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:234)
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:465)
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> =================================================
> What can I do? What I'm doing wrong?
> Thanks for help!
> 
> Regards
> 
> Flávio Vilasboas Maldonado
> Diretor de Desenvolvimento
> SedNet Soluções em TI
> (35)3471-9381
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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

Reply via email to