9 Replies - 4240 Views - Last Post: 28 July 2008 - 04:21 AM Rate Topic: -----

#1 vibinvictoria  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 99
  • Joined: 16-July 08

registration form

Posted 26 July 2008 - 09:55 AM

Hi all

Right now i am working on struts1.2

I have some doubt to work on jsp with struts

1. for example i fill user registration form and click sumbit button. In Some cases i check some validation. if exception thrown it's redirected to user reg. form. At that time user registered fileds are cleared.. But i want to maintain user registered data . - how to implement that one.
2. user registeration succes- after fill the form user got success message.
after that i press (f5) again form fields are submitted. not set any pk on database. how i handle the redudancy the data.


Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: registration form

#2 lordms12  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 30
  • View blog
  • Posts: 339
  • Joined: 16-February 08

Re: registration form

Posted 26 July 2008 - 01:06 PM

A simple solution is to do a query with your new form data before insert if returns something then show error or whatever you want.
Specifying database you are working on would be helpful.

I guess this may be asked on Databases section.
Was This Post Helpful? 0
  • +
  • -

#3 vibinvictoria  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 99
  • Joined: 16-July 08

Re: registration form

Posted 26 July 2008 - 02:01 PM

View Postlordms12, on 26 Jul, 2008 - 01:06 PM, said:

A simple solution is to do a query with your new form data before insert if returns something then show error or whatever you want.
Specifying database you are working on would be helpful.

I guess this may be asked on Databases section.


Quote

I am not asking about DB.
How to handle in jsp or struts.
Avoid duplicate data to insert

Was This Post Helpful? 0
  • +
  • -

#4 lordms12  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 30
  • View blog
  • Posts: 339
  • Joined: 16-February 08

Re: registration form

Posted 26 July 2008 - 02:10 PM

I told you a solution can be used with JSP!!!

There's other solutions can on database level like creating a trigger to check the data before inserted, some databases contain UNIQUE word I guess, primary key, ....
Was This Post Helpful? 0
  • +
  • -

#5 vibinvictoria  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 99
  • Joined: 16-July 08

Re: registration form

Posted 26 July 2008 - 02:24 PM

View Postlordms12, on 26 Jul, 2008 - 02:10 PM, said:

I told you a solution can be used with JSP!!!

There's other solutions can on database level like creating a trigger to check the data before inserted, some databases contain UNIQUE word I guess, primary key, ....


Quote

sorry i did't get..
i explain my problem
<form action="regUser.do" >
first name <input type="text" name="firstname">
last name <input type="text" name="lastname' >
<input type="submit">
</form>
in my database fields are  userid(auto), firstname varchar(20),lastname varchar(20).
first time i apply it's store in the 1, victoria,vibin
again i refresh the form 
it's store 2,victoria,vibin

so i wanna to avoid duplication..


Was This Post Helpful? 0
  • +
  • -

#6 lordms12  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 30
  • View blog
  • Posts: 339
  • Joined: 16-February 08

Re: registration form

Posted 26 July 2008 - 02:35 PM

Please do not use Quote for your own current post.

Execute this query SELECT firstname,lastname FROM YourTable if it returns null(no fields) then it's ok to insert in database else it is already exist
Was This Post Helpful? 0
  • +
  • -

#7 vibinvictoria  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 99
  • Joined: 16-July 08

Re: registration form

Posted 26 July 2008 - 02:43 PM

View Postlordms12, on 26 Jul, 2008 - 02:35 PM, said:

Please do not use Quote for your own current post.

Execute this query SELECT firstname,lastname FROM YourTable if it returns null(no fields) then it's ok to insert in database else it is already exist


Thanks for u reply ...
i got it.. nice thanks thanks a lot

again i doubt on object class..
In java Object is a base class of all class. ok
normally v extend the base in sub class.
but where its extends the Object class. can u tell me the signature of Object class
Was This Post Helpful? 0
  • +
  • -

#8 lordms12  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 30
  • View blog
  • Posts: 339
  • Joined: 16-February 08

Re: registration form

Posted 27 July 2008 - 11:30 AM

Here's the documentation for Object class.

Do you mean it works ok or not (SELECT firstname,lastname FROM YourTable WHERE firstname = 'name', lastname = 'name')
Was This Post Helpful? 0
  • +
  • -

#9 vibinvictoria  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 99
  • Joined: 16-July 08

Re: registration form

Posted 27 July 2008 - 08:09 PM

View Postlordms12, on 27 Jul, 2008 - 11:30 AM, said:

Here's the documentation for Object class.

Do you mean it works ok or not (SELECT firstname,lastname FROM YourTable WHERE firstname = 'name', lastname = 'name')


After some condition is not working.
right now i am working on online ticket reservation.
after ticket conformation, user press (f5) , i check the DB same data exist or not.

After some moment same user get another ticket , it n't updated.
Was This Post Helpful? 0
  • +
  • -

#10 lordms12  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 30
  • View blog
  • Posts: 339
  • Joined: 16-February 08

Re: registration form

Posted 28 July 2008 - 04:21 AM

What do you mean?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1