Akshay

> application. Please let me know your suggestions, and standard coding 
> techniques based on the MVC model -

I'll give you some suggestions, but I don't know if they're "standard."

> a. I would like to know if the following code represents a standard way of 
> implementing the above case.

It's close.

> b. As you can see, I am not using any screen java class corresponding to 
> form.java(the ones under the screen directory). So when is a screen class 
> used? Basically I am trying to figure out the line between an action and a 
> screen class.

The screen class is used to populate the context, etc. See
http://jakarta.apache.org/turbine/turbine-2/howto/velocity-site-howto.html

> public class FormAction extends VelocityAction
> {
>    public void doView(Rundata data, Context context)

Instead of your doView() function, put this logic in doBuildTemplate()
of a Screen class. If your screen is Form.vm then make a Form.java
screen. Read everything on the Turbine site.

>    public void doSubmit(Rundata data, Context context)
>    {
>      //get the request params
>      .
>      //get data from HttpSession
>      .
>      biz = new Biz( request );
>      biz.validate();
>      if ( formDataError )
>      {
>        context.put( "Data invalid. Please reenter data" );
>        this.doView(Rundata data, Context context);
>      }
> 
>      biz.saveToDatabase();
>    }
> }

That's pretty much what I do and it works well.

Does that help?

Eric

-- 
Eric Emminger
[EMAIL PROTECTED]


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

Reply via email to