Paul Goepfert wrote:

[...]  try
       {
           session = request.getSession();
action = request.getParameter("action"); if(action.equals("enterInfo"))
           {
               return (mapping.findForward("enter"));
           }
           else if(action.equals("default"))
           {
               sorted = data.createSortedArray("ascending", "first");
               data.removeInsert(sorted);
               data.createContext(sorted);
               return (mapping.findForward("default"));
           }
           else
           {
               return  (mapping.findForward("sort"));
           }
       } [...]

This code reeks of code smell, regardless of any other issues, especially if you have to do something similar in any other action. This is, more or less, what DispatchAction (?) was created for. Here you've duplicated controller logic inside an action, which is really supposed to be a target of the controller.

So here you are expecting forwards named "enter", "default", and "sort".

<form name="menu" action=$link.setAction("Menu") method="get">
          <input type="hidden" name="action" value="menu">

menu

onchange="menu.action.value='enterInfo'"  >$text.get("menuEnter")</label>

enterInfo

onchange="menu.action.value='default'">$text.get("menuDefault")</label>

default

onchange="menu.action.value='sort'">$text.get("menuSort")</label>

sort

<action path="/Menu"
               type="actions.MenuAction"
               name="menuForm"
               scope="request">
         <forward name="enterInfo"
                  path="/info.vm" />
         <forward name="default"
                  path="/results.vm" />
         <forward name="sort"
                  path="/sort.vm" />
</action>

Okay, so that looks good.

Have you done a sanity check with a plain 'ol action with a forward to a JSP like Frank suggested?

Have you put in logging statements to make sure that the action parameter is what you expect it to be when you hit your action?

Have you been able to get _any_ Velocity file to render, i.e., hit one without going through Struts? An the related Have you checked on the Velocity list to make sure you have the VelocityViewServlet set up properly?

Have you checked the log files for error messages?

Dave



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

Reply via email to