I am new to web Application development. In jsp page am entering name PRAKASH ,
but the name already exists in database means where i have to write validations for this criteria.
again on your bussiness logic....... send the name parameter to the database get the value of the in the jsp page as boolean if it exists then get true ..if get true than show that it is already exists
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32675
4
posted
0
Moving to a more appropriate forum.
Rajendra Prakash
Ranch Hand
Joined: Sep 10, 2009
Posts: 293
posted
0
I understand the logic which you said. I am new to development.
Can you say from which file you send request to database ( )
and which file you retrieve data
Rajendra Prakash
Ranch Hand
Joined: Sep 10, 2009
Posts: 293
posted
0
suppose am using jsp,servlet , struts , hibernate. From which file i send request to DB.
In which file i request data from DB
well in more appropriate way jsp use only for geting info and receive perameter in the servlets and a simple java class is used for database connectivity and methods make the object of java class in servlet and send response back to jsp page
Rajendra Prakash wrote:suppose am using jsp,servlet , struts , hibernate. From which file i send request to DB.
In which file i request data from DB
A service class inside the action or the action form--it kind of depends.
Rajendra Prakash
Ranch Hand
Joined: Sep 10, 2009
Posts: 293
posted
0
previously i used following code to validate username and password.
But now i am using struts , how can i get username and pwd instead of reques.getParameter()
I know there is getUsername() and getPassword() in ActionForm.
My question is , i need single line how to assign getUsername() and getPassword() to string variable.
Rajendra Prakash wrote:Its not struts ok. Give me that single line, how to get username and pwd in service method
what do you mean by single line?
this is the way :
Rajendra Prakash
Ranch Hand
Joined: Sep 10, 2009
Posts: 293
posted
0
How to do the same in struts.If you use struts means there will be ActionForm(getUsername () , getPwd() )
which eliminates request.getParameter() method.