Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2008
    Posts
    73
    Rep Power
    0

    Default validation problem

    hello friends,
    i am making one application in struts1.2...
    in that i am doing validation using below code .. code is working fine but after validation check all value from that page is been reset

    in jsp:

    <tr>
    <td align="right" class="tr_main">Name</td>
    <td><input type="text" name="name"/>
    <html:errors property="name"/></td></tr>
    <tr>


    in from :

    public ActionErrors validate(ActionMapping mapping,
    HttpServletRequest request) {
    // TODO Auto-generated method stub
    ActionErrors errors=new ActionErrors();
    if (name == null || name.trim().equals(""))
    {
    errors.add("name",new ActionError("blank"));
    }

    return errors;
    }


    so in validation if some value is not matching than same jsp page but all value is been blank ... please suggest me what to do

    Thanks in advance

    Rakesh Mehta
    Rakesh Mehta

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    842
    Rep Power
    6

    Default

    Hi,
    My question here is you are having only one field right? So,if name is null it makes name field blank.
    Ramya:cool:

  3. #3
    Join Date
    Oct 2008
    Posts
    73
    Rep Power
    0

    Default Reply

    NO NO ..

    if i am having one field wrong then all other field are also been blank ...
    Rakesh Mehta

  4. #4
    sniffer139 is offline Member
    Join Date
    Feb 2010
    Posts
    19
    Rep Power
    0

Similar Threads

  1. VAlidation
    By chetna1982 in forum New To Java
    Replies: 2
    Last Post: 12-11-2008, 07:08 AM
  2. validation problem in list box
    By rakesh_n_mehta in forum Web Frameworks
    Replies: 0
    Last Post: 10-14-2008, 07:47 AM
  3. syruts validation
    By rakesh_n_mehta in forum Advanced Java
    Replies: 3
    Last Post: 10-13-2008, 06:16 PM
  4. java validation?
    By lockmac in forum New To Java
    Replies: 3
    Last Post: 08-14-2007, 04:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •