Sorry Ram, I thought you were having trouble making it work. So you are well on
your way to use Torque - contratulations!
I think you should move the init() call somewhere else, to an application wide
initialization.
I am not that acquainted with struts.. I think you must move all the data
manipulation (the setxxx() and save() ) to another class that inherits from
some Struts class (used to be an "Action") and not use servlets.
But I digress - don't pay attention to me. You can get proper Struts help in a
Struts mailing list.
Best regards,
Álvaro.
Ram <[EMAIL PROTECTED]> wrote: Well to be specific, I have configured the
torque, generated the sql schema
files and made it to run perfectly. I even tested using it inside a main
class like this.
public static void main(String[] args) throws Exception
{
String path = "../crm/Torque.properties";
Torque.init(path);
Contacts contacts = new Contacts();
contacts.setFirstname("Ramesh");
contacts.setLastname("R");
contacts.setMiddlename("n");
contacts.save();
}
But my purpose is to use it in struts. I am using it like this.
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
String path = "../crm/Torque.properties";
Torque.init(path);
Contacts contacts = new Contacts();
contacts.setFirstname("xyz");
contacts.setLastname("s");
contacts.setMiddlename("n");
contacts.save();
request.setAttribute("Id", contacts.getPrimaryKey());
return mapping.findForward("success");
}
Please guide whether am on a right track.
On Dec 17, 2007 7:54 AM, Alvaro Coronel wrote:
> Hi Ramesh. If you can be more specific, it will be a lot easier to help
> you. Tell us what you are trying to do, how you are trying and how it fails.
>
> Best regards,
> Álvaro.
>
>
>
> Ramesh R wrote: Hi,
>
>
>
> I am using torque for struts application. I am currently finding difficult
> configuring torque. Please guide me in how to do this.
>
>
>
>
>
> Thanks
>
>
>
> Ramesh r
>
>
>
>
>
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo!
> Search.
>
--
cheers !!
ramesh r
---------------------------------
Never miss a thing. Make Yahoo your homepage.