Hi all, this there a way to check if my actionclass is being call. I tried to put the Systm.out.println. but nothing is display so i assumed my action is not being call.
try{ SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); session =sessionFactory.openSession(); //Create new instance of Contact and set values in it by reading them from form object System.out.println("Inserting Record"); Content content = new Content(); content.setContent(cfrm.getContent()); content.setName(cfrm.getName()); content.setFile(cfrm.getFile()); content.setTitle(cfrm.getTitle()); session.save(content); System.out.println("Done"); }catch (Exception e) { System.err.print(e.getStackTrace()); } return mapping.findForward(SUCCESS); }
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd">
<!-- This is a blank Struts configuration file with an example welcome action/page and other commented sample elements.
Struts Validator is configured using the factory defaults and is ready-to-use.
NOTE: If you have a generator tool to create the corresponding Java classes for you, you could include the details in the "form-bean" declarations. Otherwise, you would only define the "form-bean" element itself, with the corresponding "name" and "type" attributes, as shown here. -->
So what behavior are you seeing? Note that the default value for the validate property of an action mapping is "true". It could be the case that validation is failing in which case the action class is never called.
- Brent
Suresh Kumar Ramasamy
Greenhorn
Joined: Mar 18, 2008
Posts: 7
posted
0
Brent Sterling wrote:So what behavior are you seeing? Note that the default value for the validate property of an action mapping is "true". It could be the case that validation is failing in which case the action class is never called.
- Brent
I know it is a 5 year old thread, but I am not able to resist posting Thanks. I spent almost a day debugging and only after reading your tip my problem got solved. Thank You.