java - Error handling of a Custom Form Handler in ATG -


I'm new to ATG and I'm trying to use my own repositoryform handler. But I am not able to make assumptions on the form.

This is my .java file:

  public class MyLoginBean Ripojitriformahandlr {private String Lognam; Private string logpid; Private string message; Public string getLogname () {return logname; } Public Zero Set Logname (string logname) {this.logname = logname; } Public string getLogpwd () {return logpwd; } Public Zero setLogpwd (string logpid) {this.logpwd = logpwd; } Public string getMessage () {return message; } Public Zero Set Message (String Message) {this.message = message; } Public Boolean Handle Logname (DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws ServletException, IOException {Boolean tf = true; If (logname.isEmpty () || logname == faucet) {tf = false; SetMessage ("The user's name can not be empty"); } System.out.println ("inside the logname"); Return TF; } Public void handleFormException (DropletFormException exception, DynamoHttpServletRequest request, DynamoHttpServletResponse response) {// TODO auto generated method stub super.handleFormException (exception, request, response); }}  

And this is my .jsp file:

  & lt;% @ page language = "java" contentType = "text / html; charset = ISO-8859-1 "Page Encoding =" ISO-8859-1 "%> & Lt;% @ taglib uri = "/ dspTaglib" prefix = "dsp"%> & Lt; Dsp: Input Been = "/ ATG / Dynamo / Duplot / Error Message for Ish" /> & Lt; Dsp: import bean = "/ dynamica / myoginbin" /> & Lt ;! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.01 Transcription // N" "http://www.w3.org/TR/html4/loose.dtd"> & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = ISO-885 9-1" & gt; & Lt; Title & gt; Custom Login & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Dsp: form style = "color: white" & gt; & Lt; Table style = "background: # 3b5998" & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; Ul & gt; & Lt; Dsp: droplet name = "error message" first "& gt; dsp: param bean =" MyLoginBean.formExceptions "name =" exception "/>    & lt; / dsp: droplet & gt; ; & Lt; / ul & gt; & lt; / td> gt; & lt; / tr & gt; & lt; tr & gt; & lt; td & gt; Username: & lt; / td & gt; & Lt; td & gt; Password: & lt; / td> & lt; / tt & gt; & lt; tr & gt; & lt; td & gt; & lt; dsp: input type = "text" name = "Lognam" Bean = "Mayloginbinklagam" & gt; & Lt; / DSP input & gt; & Lt; / td & gt; & LT; TD & Gt; & lt; dsp: input type = "password" name = "logpid" bean = "mileoginbin.logped">  gt; td & gt; & lt; td & Gt; & lt; dsp: input type = "submit" bean = "myologinbill.login">  & lt; / tr & gt; ; & Lt; / table & gt; & lt; / dsp: form & gt; & lt; / Body & gt; & Lt; / Html & gt;  

I have tried all this till now and I am still trying something else. Please suggest this solution and tell me the mistakes, if any code pasted.

  1. Handle not override
  2. Use the set message instead For, use ATG's built-in behavior All Form Handlers GenericFarmHandler Superclass receives the excess of vector of form exceptions. To add an error, use it:

addFormException (new Dropteks Akspekshn ( "Your message"));

Then, at the end

return checksrand (getSuccessUrl (), getFailUrl (), PRievest, PRspace);

Checks whether any exception exception has been added, and if so, redirect the failed URL, otherwise successUrl is redirected.

  1. According to the conference, you should name your form handler * FormHandler, for example ProfileFormHandler, BillingInfoFormHandler, PaymentInfoFormHandler etc.

Hope this helps


Comments